[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

jorlow at chromium.org jorlow at chromium.org
Fri Feb 26 22:18:56 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 23e69620511e78cca658f8d55a2eb08dd02a5a94
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 12 20:29:44 2010 +0000

    2010-02-12  Jeremy Orlow  <jorlow at chromium.org>
    
            Reviewed by Darin Fisher.
    
            [Chromium] Add a blockedByPolicy output to WebStorageArea::setItem.
            https://bugs.webkit.org/show_bug.cgi?id=34897
    
            * public/WebStorageArea.h:
            (WebKit::WebStorageArea::setItem):
            * src/WebStorageAreaImpl.cpp:
            (WebKit::WebStorageAreaImpl::setItem):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54731 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 0e3288b..9cd3644 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,16 @@
+2010-02-12  Jeremy Orlow  <jorlow at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [Chromium] Add a blockedByPolicy output to WebStorageArea::setItem.
+        https://bugs.webkit.org/show_bug.cgi?id=34897
+
+        * public/WebStorageArea.h:
+        (WebKit::WebStorageArea::setItem):
+        * src/WebStorageAreaImpl.cpp:
+        (WebKit::WebStorageAreaImpl::setItem):
+        * src/WebStorageAreaImpl.h:
+
 2010-02-11  Jeremy Orlow  <jorlow at chromium.org>
 
         Reviewed by David Levin.
diff --git a/WebKit/chromium/public/WebStorageArea.h b/WebKit/chromium/public/WebStorageArea.h
index 19d98c6..5e2c11c 100644
--- a/WebKit/chromium/public/WebStorageArea.h
+++ b/WebKit/chromium/public/WebStorageArea.h
@@ -45,6 +45,12 @@ class WebStorageArea {
 public:
     virtual ~WebStorageArea() { }
 
+    enum Result {
+        ResultOK = 0,
+        ResultBlockedByQuota,
+        ResultBlockedByPolicy
+    };
+
     // The number of key/value pairs in the storage area.
     virtual unsigned length() = 0;
 
@@ -57,10 +63,22 @@ public:
     // no entry for that key.
     virtual WebString getItem(const WebString& key) = 0;
 
-    // Set the value that corresponds to a specific key. QuotaException is set if
-    // the StorageArea would have exceeded its quota. The value is NOT set when there's
-    // an exception.  url is the url that should be used if a storage event fires.
-    virtual void setItem(const WebString& key, const WebString& newValue, const WebURL& url, bool& quotaException, WebString& oldValue) = 0;
+    // Set the value that corresponds to a specific key. Result will either be ResultOK
+    // or some particular error. The value is NOT set when there's an error.  url is the
+    // url that should be used if a storage event fires.
+    virtual void setItem(const WebString& key, const WebString& newValue, const WebURL& url, Result& result, WebString& oldValue)
+    {
+        bool quotaException = false;
+        setItem(key, newValue, url, quotaException, oldValue);
+        result = quotaException ? ResultBlockedByQuota : ResultOK;
+    }
+    // FIXME: Remove soon (once Chrome has rolled past this revision).
+    virtual void setItem(const WebString& key, const WebString& newValue, const WebURL& url, bool& quotaException, WebString& oldValue)
+    {
+        Result result;
+        setItem(key, newValue, url, result, oldValue);
+        quotaException = result != ResultOK;
+    }
 
     // Remove the value associated with a particular key.  url is the url that should be used
     // if a storage event fires.
diff --git a/WebKit/chromium/src/WebStorageAreaImpl.cpp b/WebKit/chromium/src/WebStorageAreaImpl.cpp
index 92a923a..9a7fd5c 100644
--- a/WebKit/chromium/src/WebStorageAreaImpl.cpp
+++ b/WebKit/chromium/src/WebStorageAreaImpl.cpp
@@ -66,7 +66,7 @@ WebString WebStorageAreaImpl::getItem(const WebString& key)
     return m_storageArea->getItem(key);
 }
 
-void WebStorageAreaImpl::setItem(const WebString& key, const WebString& value, const WebURL& url, bool& quotaException, WebString& oldValue)
+void WebStorageAreaImpl::setItem(const WebString& key, const WebString& value, const WebURL& url, Result& result, WebString& oldValue)
 {
     int exceptionCode = 0;
 
@@ -75,9 +75,9 @@ void WebStorageAreaImpl::setItem(const WebString& key, const WebString& value, c
 
     if (exceptionCode) {
         ASSERT(exceptionCode == WebCore::QUOTA_EXCEEDED_ERR);
-        quotaException = true;
+        result = ResultBlockedByQuota;
     } else
-        quotaException = false;
+        result = ResultOK;
 }
 
 void WebStorageAreaImpl::removeItem(const WebString& key, const WebURL& url, WebString& oldValue)
diff --git a/WebKit/chromium/src/WebStorageAreaImpl.h b/WebKit/chromium/src/WebStorageAreaImpl.h
index 7e90531..e9a11c2 100644
--- a/WebKit/chromium/src/WebStorageAreaImpl.h
+++ b/WebKit/chromium/src/WebStorageAreaImpl.h
@@ -45,7 +45,7 @@ public:
     virtual unsigned length();
     virtual WebString key(unsigned index);
     virtual WebString getItem(const WebString& key);
-    virtual void setItem(const WebString& key, const WebString& value, const WebURL& url, bool& quotaException, WebString& oldValue);
+    virtual void setItem(const WebString& key, const WebString& value, const WebURL& url, Result& result, WebString& oldValue);
     virtual void removeItem(const WebString& key, const WebURL& url, WebString& oldValue);
     virtual void clear(const WebURL& url, bool& somethingCleared);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list