Title: [177202] trunk/Source/WebCore
Revision
177202
Author
[email protected]
Date
2014-12-11 18:26:36 -0800 (Thu, 11 Dec 2014)

Log Message

Web Inspector: Crash when trying to inspect LocalStorage
https://bugs.webkit.org/show_bug.cgi?id=139573

Reviewed by Anders Carlsson.

Move away from PageGroup::localStorage and instead to StorageNamespaceProvider.
This matches what DOMWindow::localStorage does to get the StorageArea for a document.

* inspector/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::findStorageArea):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (177201 => 177202)


--- trunk/Source/WebCore/ChangeLog	2014-12-12 02:16:22 UTC (rev 177201)
+++ trunk/Source/WebCore/ChangeLog	2014-12-12 02:26:36 UTC (rev 177202)
@@ -1,3 +1,16 @@
+2014-12-11  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Crash when trying to inspect LocalStorage
+        https://bugs.webkit.org/show_bug.cgi?id=139573
+
+        Reviewed by Anders Carlsson.
+
+        Move away from PageGroup::localStorage and instead to StorageNamespaceProvider.
+        This matches what DOMWindow::localStorage does to get the StorageArea for a document.
+
+        * inspector/InspectorDOMStorageAgent.cpp:
+        (WebCore::InspectorDOMStorageAgent::findStorageArea):
+
 2014-12-11  Simon Fraser  <[email protected]>
 
         Transform-style should not kill position:fixed

Modified: trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp (177201 => 177202)


--- trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp	2014-12-12 02:16:22 UTC (rev 177201)
+++ trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp	2014-12-12 02:26:36 UTC (rev 177202)
@@ -46,6 +46,7 @@
 #include "SecurityOrigin.h"
 #include "Storage.h"
 #include "StorageNamespace.h"
+#include "StorageNamespaceProvider.h"
 #include "VoidCallback.h"
 #include <inspector/InspectorFrontendDispatchers.h>
 #include <inspector/InspectorValues.h>
@@ -201,9 +202,13 @@
     }
 
     Page* page = m_pageAgent->page();
-    if (isLocalStorage)
-        return page->group().localStorage()->storageArea(targetFrame->document()->securityOrigin());
-    return page->sessionStorage()->storageArea(targetFrame->document()->securityOrigin());
+    Document* document = targetFrame->document();
+    if (isLocalStorage) {
+        if (document->securityOrigin()->canAccessLocalStorage(document->topOrigin()))
+            return page->storageNamespaceProvider().localStorageNamespace().storageArea(document->securityOrigin());
+        return page->storageNamespaceProvider().transientLocalStorageNamespace(*document->topOrigin()).storageArea(document->securityOrigin());
+    }
+    return page->sessionStorage()->storageArea(document->securityOrigin());
 }
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to