Title: [100101] trunk/Source/WebCore
Revision
100101
Author
[email protected]
Date
2011-11-13 23:53:27 -0800 (Sun, 13 Nov 2011)

Log Message

SecurityPolicy should refer to isUnique rather than isEmpty
https://bugs.webkit.org/show_bug.cgi?id=72242

Reviewed by Eric Seidel.

It doesn't make sense to tweak the security policy for unique origins
because they're different every time.  Previously, this code checked
for empty origins, which are technically a subset of unique origins.  I
don't think it's possible to call this code in a way that can detect
the difference, but we're eventually going to remove the isEmpty
function.

* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
(WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (100100 => 100101)


--- trunk/Source/WebCore/ChangeLog	2011-11-14 07:50:55 UTC (rev 100100)
+++ trunk/Source/WebCore/ChangeLog	2011-11-14 07:53:27 UTC (rev 100101)
@@ -1,5 +1,23 @@
 2011-11-13  Adam Barth  <[email protected]>
 
+        SecurityPolicy should refer to isUnique rather than isEmpty
+        https://bugs.webkit.org/show_bug.cgi?id=72242
+
+        Reviewed by Eric Seidel.
+
+        It doesn't make sense to tweak the security policy for unique origins
+        because they're different every time.  Previously, this code checked
+        for empty origins, which are technically a subset of unique origins.  I
+        don't think it's possible to call this code in a way that can detect
+        the difference, but we're eventually going to remove the isEmpty
+        function.
+
+        * page/SecurityPolicy.cpp:
+        (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
+        (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
+
+2011-11-13  Adam Barth  <[email protected]>
+
         Move isSecureTransitionTo from SecurityOrigin to SecurityContext
         https://bugs.webkit.org/show_bug.cgi?id=72241
 

Modified: trunk/Source/WebCore/page/SecurityPolicy.cpp (100100 => 100101)


--- trunk/Source/WebCore/page/SecurityPolicy.cpp	2011-11-14 07:50:55 UTC (rev 100100)
+++ trunk/Source/WebCore/page/SecurityPolicy.cpp	2011-11-14 07:53:27 UTC (rev 100101)
@@ -99,8 +99,8 @@
 void SecurityPolicy::addOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, bool allowDestinationSubdomains)
 {
     ASSERT(isMainThread());
-    ASSERT(!sourceOrigin.isEmpty());
-    if (sourceOrigin.isEmpty())
+    ASSERT(!sourceOrigin.isUnique());
+    if (sourceOrigin.isUnique())
         return;
 
     String sourceString = sourceOrigin.toString();
@@ -115,8 +115,8 @@
 void SecurityPolicy::removeOriginAccessWhitelistEntry(const SecurityOrigin& sourceOrigin, const String& destinationProtocol, const String& destinationDomain, bool allowDestinationSubdomains)
 {
     ASSERT(isMainThread());
-    ASSERT(!sourceOrigin.isEmpty());
-    if (sourceOrigin.isEmpty())
+    ASSERT(!sourceOrigin.isUnique());
+    if (sourceOrigin.isUnique())
         return;
 
     String sourceString = sourceOrigin.toString();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to