Title: [113309] trunk
Revision
113309
Author
commit-qu...@webkit.org
Date
2012-04-05 03:52:47 -0700 (Thu, 05 Apr 2012)

Log Message

[BlackBerry] Clear local storage won't take effect until browser exit and relaunch
https://bugs.webkit.org/show_bug.cgi?id=83253

Patch by Jonathan Dong <jonathan.d...@torchmobile.com.cn> on 2012-04-05
Reviewed by Rob Buis.

.:

RIM PR: #146871
Added a manual test case to test the behavior when press
button "Clear Local Storage" from browser settings.
It has to be a manual test as it requires user interaction.

* ManualTests/blackberry/clear-localstorage.html: Added.

Source/WebKit/blackberry:

RIM PR: #146871
Cleared the local storage namespace of a WebPage's PageGroup
when WebPage::clearLocalStorage() get called.
Also deleted unused global function clearLocalStorage().

* Api/BlackBerryGlobal.cpp:
* Api/BlackBerryGlobal.h:
(WebKit):
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPage::clearLocalStorage):

Modified Paths

Added Paths

Diff

Modified: trunk/ChangeLog (113308 => 113309)


--- trunk/ChangeLog	2012-04-05 10:41:07 UTC (rev 113308)
+++ trunk/ChangeLog	2012-04-05 10:52:47 UTC (rev 113309)
@@ -1,3 +1,17 @@
+2012-04-05  Jonathan Dong  <jonathan.d...@torchmobile.com.cn>
+
+        [BlackBerry] Clear local storage won't take effect until browser exit and relaunch
+        https://bugs.webkit.org/show_bug.cgi?id=83253
+
+        Reviewed by Rob Buis.
+
+        RIM PR: #146871
+        Added a manual test case to test the behavior when press
+        button "Clear Local Storage" from browser settings.
+        It has to be a manual test as it requires user interaction.
+
+        * ManualTests/blackberry/clear-localstorage.html: Added.
+
 2012-04-04  Kent Tamura  <tk...@chromium.org>
 
         Add _javascript_ and CSS code for the calendar picker implementation

Added: trunk/ManualTests/blackberry/clear-localstorage.html (0 => 113309)


--- trunk/ManualTests/blackberry/clear-localstorage.html	                        (rev 0)
+++ trunk/ManualTests/blackberry/clear-localstorage.html	2012-04-05 10:52:47 UTC (rev 113309)
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+  <body>
+    <p>This test case is used to test the function of clear local storage by clicking "Clear Local Storage" button
+    from Settings -> Privacy & Security. This is for <a href=""
+    <div>
+    <script type="text/_javascript_">
+      if (!sessionStorage.getItem("key")) {
+        // initialize test case
+        document.write("Status: <span style='color:yellow'>Initial</span>");
+        sessionStorage.setItem("key", "value");
+        localStorage.setItem("key", "value");
+
+        // notify to clear the local storage and refresh the page.
+        document.write("<p>Please clear the local storage from Settings -> Privacy & Security by pressing \"Clear Local Storage\" button, then reload this page to see the result.</p>");
+      } else {
+        document.write("Result: ");
+        if (!localStorage.getItem("key")) {
+          // success
+          document.write("<span style='color:green'>PASS</span>");
+        } else {
+          // fail
+          document.write("<span style='color:red'>FAIL</span>");
+        }
+        document.write("<p>If you want to run this test case again, please restart the browser.</p>");
+      }
+    </script>
+    </div>
+  </body>
+</html>

Modified: trunk/Source/WebKit/blackberry/Api/BlackBerryGlobal.cpp (113308 => 113309)


--- trunk/Source/WebKit/blackberry/Api/BlackBerryGlobal.cpp	2012-04-05 10:41:07 UTC (rev 113308)
+++ trunk/Source/WebKit/blackberry/Api/BlackBerryGlobal.cpp	2012-04-05 10:52:47 UTC (rev 113309)
@@ -136,10 +136,6 @@
     cacheStorage().empty();
 }
 
-void clearLocalStorage(const WebString& pageGroupName)
-{
-}
-
 void clearDatabase(const WebString& pageGroupName)
 {
 }

Modified: trunk/Source/WebKit/blackberry/Api/BlackBerryGlobal.h (113308 => 113309)


--- trunk/Source/WebKit/blackberry/Api/BlackBerryGlobal.h	2012-04-05 10:41:07 UTC (rev 113308)
+++ trunk/Source/WebKit/blackberry/Api/BlackBerryGlobal.h	2012-04-05 10:52:47 UTC (rev 113309)
@@ -37,8 +37,6 @@
 void clearAppCache(const WebString& pageGroupName);
 void reopenAllAppCaches();
 void closeAllAppCaches();
-void clearLocalStorage(const WebString& pageGroupName);
-void closeAllLocalStorages();
 void clearDatabase(const WebString& pageGroupName);
 void reopenAllTrackerDatabases();
 void closeAllTrackerDatabases();

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (113308 => 113309)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-04-05 10:41:07 UTC (rev 113308)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-04-05 10:52:47 UTC (rev 113309)
@@ -4871,8 +4871,10 @@
 
 void WebPage::clearLocalStorage()
 {
-    BlackBerry::WebKit::clearLocalStorage(d->m_page->groupName());
-    clearDatabase(d->m_page->groupName());
+    if (PageGroup* group = d->m_page->groupPtr()) {
+        if (StorageNamespace* storage = group->localStorage())
+            storage->clearAllOriginsForDeletion();
+    }
 }
 
 void WebPage::clearCredentials()

Modified: trunk/Source/WebKit/blackberry/ChangeLog (113308 => 113309)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-04-05 10:41:07 UTC (rev 113308)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-04-05 10:52:47 UTC (rev 113309)
@@ -1,3 +1,21 @@
+2012-04-05  Jonathan Dong  <jonathan.d...@torchmobile.com.cn>
+
+        [BlackBerry] Clear local storage won't take effect until browser exit and relaunch
+        https://bugs.webkit.org/show_bug.cgi?id=83253
+
+        Reviewed by Rob Buis.
+
+        RIM PR: #146871
+        Cleared the local storage namespace of a WebPage's PageGroup
+        when WebPage::clearLocalStorage() get called.
+        Also deleted unused global function clearLocalStorage().
+
+        * Api/BlackBerryGlobal.cpp:
+        * Api/BlackBerryGlobal.h:
+        (WebKit):
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPage::clearLocalStorage):
+
 2012-04-04  Rob Buis  <rb...@rim.com>
 
         [BlackBerry] Make the switch statement in WebPage::notifyAppActivationStateChange() stronger
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to