Bug 1320186: Don't sanitize storage values more than once. r=aswan
authorKris Maglione <maglione.k@gmail.com>
Tue, 06 Jun 2017 18:59:06 -0700
changeset 410751 f79cc01cb73f6beba75b92bb0719438d5f6accc1
parent 410750 3ccce72b9da08d67bdc520985bc78f2a40853a55
child 410752 827b05e1b8f77ff34829b7002a582363b41c9f92
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaswan
bugs1320186
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1320186: Don't sanitize storage values more than once. r=aswan MozReview-Commit-ID: y6S5LqS7fL
toolkit/components/extensions/ExtensionStorage.jsm
toolkit/components/extensions/ext-storage.js
--- a/toolkit/components/extensions/ExtensionStorage.jsm
+++ b/toolkit/components/extensions/ExtensionStorage.jsm
@@ -137,21 +137,21 @@ this.ExtensionStorage = {
       "ExtensionStorage: Finish writing extension data",
       promise);
 
     return promise.then(() => {
       AsyncShutdown.profileBeforeChange.removeBlocker(promise);
     });
   },
 
-  set(extensionId, items, context) {
+  set(extensionId, items) {
     return this.read(extensionId).then(extData => {
       let changes = {};
       for (let prop in items) {
-        let item = this.sanitize(items[prop], context);
+        let item = items[prop];
         changes[prop] = {oldValue: extData[prop], newValue: item};
         extData[prop] = item;
       }
 
       this.notifyListeners(extensionId, changes);
 
       return this.write(extensionId);
     });
--- a/toolkit/components/extensions/ext-storage.js
+++ b/toolkit/components/extensions/ext-storage.js
@@ -26,17 +26,17 @@ this.storage = class extends ExtensionAP
     let {extension} = context;
     return {
       storage: {
         local: {
           get: function(spec) {
             return ExtensionStorage.get(extension.id, spec);
           },
           set: function(items) {
-            return ExtensionStorage.set(extension.id, items, context);
+            return ExtensionStorage.set(extension.id, items);
           },
           remove: function(keys) {
             return ExtensionStorage.remove(extension.id, keys);
           },
           clear: function() {
             return ExtensionStorage.clear(extension.id);
           },
         },