Title: [107953] trunk/Source/WebCore
Revision
107953
Author
[email protected]
Date
2012-02-16 10:08:23 -0800 (Thu, 16 Feb 2012)

Log Message

Web Inspector: cache settings values
https://bugs.webkit.org/show_bug.cgi?id=78815

Reviewed by Vsevolod Vlasov.

* inspector/front-end/Settings.js:
(WebInspector.Setting.prototype.get if):
(WebInspector.Setting.prototype):
(WebInspector.Setting.prototype.):
(WebInspector.Setting.prototype.set this):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (107952 => 107953)


--- trunk/Source/WebCore/ChangeLog	2012-02-16 17:51:27 UTC (rev 107952)
+++ trunk/Source/WebCore/ChangeLog	2012-02-16 18:08:23 UTC (rev 107953)
@@ -1,3 +1,16 @@
+2012-02-16  Pavel Feldman  <[email protected]>
+
+        Web Inspector: cache settings values
+        https://bugs.webkit.org/show_bug.cgi?id=78815
+
+        Reviewed by Vsevolod Vlasov.
+
+        * inspector/front-end/Settings.js:
+        (WebInspector.Setting.prototype.get if):
+        (WebInspector.Setting.prototype):
+        (WebInspector.Setting.prototype.):
+        (WebInspector.Setting.prototype.set this):
+
 2012-02-16  Terry Anderson  <[email protected]>
 
         WebKit does not support DOM 3 Events FocusEvent

Modified: trunk/Source/WebCore/inspector/front-end/Settings.js (107952 => 107953)


--- trunk/Source/WebCore/inspector/front-end/Settings.js	2012-02-16 17:51:27 UTC (rev 107952)
+++ trunk/Source/WebCore/inspector/front-end/Settings.js	2012-02-16 18:08:23 UTC (rev 107953)
@@ -135,19 +135,23 @@
 
     get: function()
     {
-        var value = this._defaultValue;
+        if (typeof this._value !== "undefined")
+            return this._value;
+
+        this._value = this._defaultValue;
         if (window.localStorage != null && this._name in window.localStorage) {
             try {
-                value = JSON.parse(window.localStorage[this._name]);
+                this._value = JSON.parse(window.localStorage[this._name]);
             } catch(e) {
                 window.localStorage.removeItem(this._name);
             }
         }
-        return value;
+        return this._value;
     },
 
     set: function(value)
     {
+        this._value = value;
         if (window.localStorage != null) {
             try {
                 window.localStorage[this._name] = JSON.stringify(value);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to