Title: [92872] trunk/Source/WebKit/chromium
Revision
92872
Author
[email protected]
Date
2011-08-11 12:24:50 -0700 (Thu, 11 Aug 2011)

Log Message

Remove the temporary workaround added by http://trac.webkit.org/changeset/51338
https://bugs.webkit.org/show_bug.cgi?id=65908

Patch by Marja Hölttä <[email protected]> on 2011-08-11
Reviewed by Adam Barth.

SecurityOrigin for a file URL returns "file://", and
SecurityOrigin::createFromString("file://") creates a unique (null)
security origin (because "file://" is first canonicalized to "file:///"
and that is a directory). This means the conversion SecurityOrigin ->
string -> SecurityOrigin doens't give back the same SecurityOrigin in
case of file URLs.

WebStorageNamespaceImpl::createStorageArea contains a workaround which
changes the string "file://" into "file:///a" before giving it to
SecurityOrigin::createFromString.

If SecurityOrigin::m_enforceFilePathSeparation is true, then
SecurityOrigin::toString() returns "null" for file URLs, and this
problem does not exist, and the workaround code is not ran.

This patch removes the workaround.

* src/WebStorageNamespaceImpl.cpp:
(WebKit::WebStorageNamespaceImpl::createStorageArea):

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (92871 => 92872)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-08-11 19:22:57 UTC (rev 92871)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-08-11 19:24:50 UTC (rev 92872)
@@ -1,3 +1,30 @@
+2011-08-11  Marja Hölttä  <[email protected]>
+
+        Remove the temporary workaround added by http://trac.webkit.org/changeset/51338
+        https://bugs.webkit.org/show_bug.cgi?id=65908
+
+        Reviewed by Adam Barth.
+
+        SecurityOrigin for a file URL returns "file://", and
+        SecurityOrigin::createFromString("file://") creates a unique (null)
+        security origin (because "file://" is first canonicalized to "file:///"
+        and that is a directory). This means the conversion SecurityOrigin ->
+        string -> SecurityOrigin doens't give back the same SecurityOrigin in
+        case of file URLs.
+
+        WebStorageNamespaceImpl::createStorageArea contains a workaround which
+        changes the string "file://" into "file:///a" before giving it to
+        SecurityOrigin::createFromString.
+
+        If SecurityOrigin::m_enforceFilePathSeparation is true, then
+        SecurityOrigin::toString() returns "null" for file URLs, and this
+        problem does not exist, and the workaround code is not ran.
+
+        This patch removes the workaround.
+
+        * src/WebStorageNamespaceImpl.cpp:
+        (WebKit::WebStorageNamespaceImpl::createStorageArea):
+
 2011-08-10  John Abd-El-Malek  <[email protected]>
 
         [chromium] Update WebScrollbar so that it works with overlay scrollbars on Lion

Modified: trunk/Source/WebKit/chromium/src/WebStorageNamespaceImpl.cpp (92871 => 92872)


--- trunk/Source/WebKit/chromium/src/WebStorageNamespaceImpl.cpp	2011-08-11 19:22:57 UTC (rev 92871)
+++ trunk/Source/WebKit/chromium/src/WebStorageNamespaceImpl.cpp	2011-08-11 19:24:50 UTC (rev 92872)
@@ -61,20 +61,7 @@
 
 WebStorageArea* WebStorageNamespaceImpl::createStorageArea(const WebString& originString)
 {
-    WTF::String originWebCoreString = originString;
-    if (originWebCoreString == "file://") {
-        // FIXME: We should really be passing around WebSecurityOrigin objects
-        //        to represent security origins instead of strings.  One issue
-        //        with using strings is that createFromString(toString) does
-        //        not round-trip for file URLs because file:// looks like a
-        //        directory (which is sandboxed).
-        //
-        // For the time being, we work around this issue by using "file:///a",
-        // which does not look like a directory.  We should fix this when
-        // jorlow gets back from vactation.
-        originWebCoreString = "file:///a";
-    }
-    RefPtr<WebCore::SecurityOrigin> origin = WebCore::SecurityOrigin::createFromString(originWebCoreString);
+    RefPtr<WebCore::SecurityOrigin> origin = WebCore::SecurityOrigin::createFromString(originString);
     return new WebStorageAreaImpl(m_storageNamespace->storageArea(origin.release()));
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to