Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/prefs.js

Issue 29332926: Issue 3446 - Remove code migrating prefs and files to chrome.storage (Closed)
Patch Set: Created Dec. 21, 2015, 2:48 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/io.js ('k') | safari/ext/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/prefs.js
===================================================================
--- a/lib/prefs.js
+++ b/lib/prefs.js
@@ -253,48 +253,13 @@
Prefs.onLoaded._dispatch();
};
- // Migrate preferences for users updating from old versions.
- // TODO: Remove the migration code after a few releases.
- ext.storage.migratePrefs({
- map: function(key, value)
- {
- if (key in defaults || key == "stats_total")
- {
- if (key != "currentVersion")
- {
- try
- {
- value = JSON.parse(value);
- }
- catch (e)
- {
- return null;
- }
- }
+ ext.storage.get(prefs.map(prefToKey), function(items)
+ {
+ for (let key in items)
+ overrides[keyToPref(key)] = items[key];
- if (key == "stats_total")
- {
- key = "blocked_total";
- value = value.blocked;
- }
-
- return {key: prefToKey(key), value: value};
- }
-
- return null;
- },
-
- done: function()
- {
- ext.storage.get(prefs.map(prefToKey), function(items)
- {
- for (let key in items)
- overrides[keyToPref(key)] = items[key];
-
- localLoaded = true;
- checkLoaded();
- });
- }
+ localLoaded = true;
+ checkLoaded();
});
if (require("info").platform == "chromium" && "managed" in chrome.storage)
« no previous file with comments | « lib/io.js ('k') | safari/ext/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld