-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed: caching keys didn't work since chrome.local doesn't support
binary data; instead use IndexedDB for storing them.
- Loading branch information
1 parent
ffd41c7
commit 4866da9
Showing
5 changed files
with
75 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
packages/anonymous-communication/test/helpers/in-memory-database.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* WhoTracks.Me | ||
* https://whotracks.me/ | ||
* | ||
* Copyright 2017-present Ghostery GmbH. All rights reserved. | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0 | ||
*/ | ||
|
||
/** | ||
* Implements the IndexedDBKeyValueStore interface. | ||
*/ | ||
export default class InMemoryDatabase { | ||
constructor() { | ||
this.db = new Map(); | ||
} | ||
|
||
async open() {} | ||
|
||
async close() {} | ||
|
||
async get(key) { | ||
return this.db.get(key); | ||
} | ||
|
||
async set(key, value) { | ||
this.db.set(key, value); | ||
} | ||
|
||
async remove(key) { | ||
return this.db.delete(key); | ||
} | ||
|
||
async clear() { | ||
this.db.clear(); | ||
} | ||
|
||
async keys() { | ||
return [...this.db.keys()]; | ||
} | ||
} |
72 changes: 0 additions & 72 deletions
72
packages/anonymous-communication/test/helpers/memory-map.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters