[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

apavlov at chromium.org apavlov at chromium.org
Wed Dec 22 11:24:38 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit d7b33a86a1848ff3ecf99cd164992b12c11e1185
Author: apavlov at chromium.org <apavlov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jul 22 14:23:27 2010 +0000

    2010-07-22  Alexander Pavlov  <apavlov at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: Modifying settings actually modifies defaultValues
            https://bugs.webkit.org/show_bug.cgi?id=42816
    
            Avoid using live modifiable objects as property default values.
    
            * inspector/front-end/Settings.js:
            (WebInspector.Settings):
            (WebInspector.Settings.prototype.reset):
            (WebInspector.Settings.prototype._load):
            (WebInspector.Settings.prototype.installSetting):
            (WebInspector.Settings.prototype._get):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63889 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a20d4ad..908a1bf 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-07-22  Alexander Pavlov  <apavlov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: Modifying settings actually modifies defaultValues
+        https://bugs.webkit.org/show_bug.cgi?id=42816
+
+        Avoid using live modifiable objects as property default values.
+
+        * inspector/front-end/Settings.js:
+        (WebInspector.Settings):
+        (WebInspector.Settings.prototype.reset):
+        (WebInspector.Settings.prototype._load):
+        (WebInspector.Settings.prototype.installSetting):
+        (WebInspector.Settings.prototype._get):
+
 2010-07-22  Ben Murdoch  <benm at google.com>
 
         Reviewed by Simon Fraser.
diff --git a/WebCore/inspector/front-end/Settings.js b/WebCore/inspector/front-end/Settings.js
index 39c1e1e..450e694 100644
--- a/WebCore/inspector/front-end/Settings.js
+++ b/WebCore/inspector/front-end/Settings.js
@@ -71,38 +71,42 @@ WebInspector.populateSessionSettings = function(settingsString)
 WebInspector.Settings = function(sessionScope)
 {
     this._sessionScope = sessionScope;
-    this._defaultValues = {};
+    this._store = {};
 }
 
 WebInspector.Settings.prototype = {
     reset: function()
     {
         this._store = {};
+        // FIXME: restore default values (bug 42820)
         this.dispatchEventToListeners("loaded");
     },
 
     _load: function(settingsString)
     {
         try {
-            this._store = JSON.parse(settingsString);
+            var loadedStore = JSON.parse(settingsString);
         } catch (e) {
             // May fail;
-            this._store = {};
+            loadedStore = {};
         }
+        if (!loadedStore)
+            return;
+        for (var propertyName in loadedStore)
+            this._store[propertyName] = loadedStore[propertyName];
     },
 
     installSetting: function(name, propertyName, defaultValue)
     {
         this.__defineGetter__(name, this._get.bind(this, propertyName));
         this.__defineSetter__(name, this._set.bind(this, propertyName));
-        this._defaultValues[propertyName] = defaultValue;
+        if (!(propertyName in this._store))
+            this._store[propertyName] = defaultValue;
     },
 
     _get: function(propertyName)
     {
-        if (propertyName in this._store)
-            return this._store[propertyName];
-        return this._defaultValues[propertyName];
+        return this._store[propertyName];
     },
 
     _set: function(propertyName, newValue)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list