Title: [114890] trunk/Source
Revision
114890
Author
gav...@chromium.org
Date
2012-04-23 05:53:24 -0700 (Mon, 23 Apr 2012)

Log Message

Move ReferrerPolicy out of SecurityPolicy class into its own header in platform.
https://bugs.webkit.org/show_bug.cgi?id=84516

Source/WebCore:

Reviewed by Adam Barth.

No change in behaviour; same enum, different class.

* GNUmakefile.list.am:
* Target.pri:
* WebCore.exp.in:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::processReferrerPolicy):
* dom/Document.h:
(WebCore::Document::referrerPolicy):
(Document):
* page/SecurityPolicy.h:
* platform/ReferrerPolicy.h: Added.
(WebCore):

Source/WebKit/chromium:

Reviewed by Adam Barth.

No change in behaviour; same enum, different class.

* src/AssertMatchingEnums.cpp:
* src/WebSecurityPolicy.cpp:
(WebKit::WebSecurityPolicy::generateReferrerHeader):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114889 => 114890)


--- trunk/Source/WebCore/ChangeLog	2012-04-23 12:37:50 UTC (rev 114889)
+++ trunk/Source/WebCore/ChangeLog	2012-04-23 12:53:24 UTC (rev 114890)
@@ -1,3 +1,28 @@
+2012-04-23  Gavin Peters  <gav...@chromium.org>
+
+        Move ReferrerPolicy out of SecurityPolicy class into its own header in platform.
+        https://bugs.webkit.org/show_bug.cgi?id=84516
+
+        Reviewed by Adam Barth.
+
+        No change in behaviour; same enum, different class.
+
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.exp.in:
+        * WebCore.gypi:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        (WebCore::Document::processReferrerPolicy):
+        * dom/Document.h:
+        (WebCore::Document::referrerPolicy):
+        (Document):
+        * page/SecurityPolicy.h:
+        * platform/ReferrerPolicy.h: Added.
+        (WebCore):
+
 2012-04-23  Vineet Chaudhary  <rgf...@motorola.com>
 
         JS binding code generator doesn't handle "attribute unsigned long[]" well

Modified: trunk/Source/WebCore/GNUmakefile.list.am (114889 => 114890)


--- trunk/Source/WebCore/GNUmakefile.list.am	2012-04-23 12:37:50 UTC (rev 114889)
+++ trunk/Source/WebCore/GNUmakefile.list.am	2012-04-23 12:53:24 UTC (rev 114890)
@@ -3521,6 +3521,7 @@
 	Source/WebCore/platform/PopupMenuStyle.h \
 	Source/WebCore/platform/PurgeableBuffer.h \
 	Source/WebCore/platform/PurgePriority.h \
+	Source/WebCore/platform/ReferrerPolicy.h \
 	Source/WebCore/platform/RunLoop.cpp \
 	Source/WebCore/platform/RunLoop.h \
 	Source/WebCore/platform/RuntimeApplicationChecks.cpp \

Modified: trunk/Source/WebCore/Target.pri (114889 => 114890)


--- trunk/Source/WebCore/Target.pri	2012-04-23 12:37:50 UTC (rev 114889)
+++ trunk/Source/WebCore/Target.pri	2012-04-23 12:53:24 UTC (rev 114890)
@@ -2333,6 +2333,7 @@
     platform/PlatformTouchEvent.h \
     platform/PlatformTouchPoint.h \
     platform/PopupMenu.h \
+    platform/ReferrerPolicy.h \
     platform/qt/ClipboardQt.h \
     platform/qt/CookieJarQt.h \
     platform/qt/QWebPageClient.h \

Modified: trunk/Source/WebCore/WebCore.exp.in (114889 => 114890)


--- trunk/Source/WebCore/WebCore.exp.in	2012-04-23 12:37:50 UTC (rev 114889)
+++ trunk/Source/WebCore/WebCore.exp.in	2012-04-23 12:53:24 UTC (rev 114890)
@@ -383,7 +383,7 @@
 __ZN7WebCore14SecurityOrigin6createERKNS_4KURLE
 __ZN7WebCore14SecurityPolicy18setLocalLoadPolicyENS0_15LocalLoadPolicyE
 __ZN7WebCore14SecurityPolicy18shouldHideReferrerERKNS_4KURLERKN3WTF6StringE
-__ZN7WebCore14SecurityPolicy22generateReferrerHeaderENS0_14ReferrerPolicyERKNS_4KURLERKN3WTF6StringE
+__ZN7WebCore14SecurityPolicy22generateReferrerHeaderENS_14ReferrerPolicyERKNS_4KURLERKN3WTF6StringE
 __ZN7WebCore14SecurityPolicy27resetOriginAccessWhitelistsEv
 __ZN7WebCore14SecurityPolicy29addOriginAccessWhitelistEntryERKNS_14SecurityOriginERKN3WTF6StringES7_b
 __ZN7WebCore14SecurityPolicy32removeOriginAccessWhitelistEntryERKNS_14SecurityOriginERKN3WTF6StringES7_b

Modified: trunk/Source/WebCore/WebCore.gypi (114889 => 114890)


--- trunk/Source/WebCore/WebCore.gypi	2012-04-23 12:37:50 UTC (rev 114889)
+++ trunk/Source/WebCore/WebCore.gypi	2012-04-23 12:53:24 UTC (rev 114890)
@@ -3130,6 +3130,7 @@
             'platform/PlatformTouchEvent.h',
             'platform/PlatformTouchPoint.h',
             'platform/PurgeableBuffer.h',
+            'platform/ReferrerPolicy.h'
             'platform/RunLoopTimer.h',
             'platform/RuntimeApplicationChecks.cpp',
             'platform/RuntimeApplicationChecks.h',

Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (114889 => 114890)


--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-04-23 12:37:50 UTC (rev 114889)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj	2012-04-23 12:53:24 UTC (rev 114890)
@@ -27682,6 +27682,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\platform\ReferrerPolicy.h"
+				>
+			</File>
+			<File
 				RelativePath="..\platform\RunLoop.cpp"
 				>
 			</File>

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (114889 => 114890)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-04-23 12:37:50 UTC (rev 114889)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2012-04-23 12:53:24 UTC (rev 114890)
@@ -3593,6 +3593,7 @@
 		97EF7DFE107E55B700D7C49C /* ScriptControllerBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97EF7DFD107E55B700D7C49C /* ScriptControllerBase.cpp */; };
 		97F8E665151D4A4B00D2D181 /* WorkerContextNotifications.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97F8E661151D4A3F00D2D181 /* WorkerContextNotifications.cpp */; };
 		97F8E666151D4A4E00D2D181 /* WorkerContextNotifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 97F8E662151D4A3F00D2D181 /* WorkerContextNotifications.h */; };
+		9831AE4A154225C900FE2644 /* ReferrerPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 9831AE49154225A200FE2644 /* ReferrerPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		984264F112D5280A000D88A4 /* LinkLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 984264EF12D5280A000D88A4 /* LinkLoaderClient.h */; };
 		985BB96D13A94058007A0B69 /* LinkRelAttribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 985BB96B13A94058007A0B69 /* LinkRelAttribute.cpp */; };
 		985BB96E13A94058007A0B69 /* LinkRelAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 985BB96C13A94058007A0B69 /* LinkRelAttribute.h */; };
@@ -10617,6 +10618,7 @@
 		97F8E661151D4A3F00D2D181 /* WorkerContextNotifications.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WorkerContextNotifications.cpp; path = notifications/WorkerContextNotifications.cpp; sourceTree = "<group>"; };
 		97F8E662151D4A3F00D2D181 /* WorkerContextNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WorkerContextNotifications.h; path = notifications/WorkerContextNotifications.h; sourceTree = "<group>"; };
 		97F8E663151D4A3F00D2D181 /* WorkerContextNotifications.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WorkerContextNotifications.idl; path = notifications/WorkerContextNotifications.idl; sourceTree = "<group>"; };
+		9831AE49154225A200FE2644 /* ReferrerPolicy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReferrerPolicy.h; sourceTree = "<group>"; };
 		984264EF12D5280A000D88A4 /* LinkLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkLoaderClient.h; sourceTree = "<group>"; };
 		985BB96B13A94058007A0B69 /* LinkRelAttribute.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LinkRelAttribute.cpp; sourceTree = "<group>"; };
 		985BB96C13A94058007A0B69 /* LinkRelAttribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LinkRelAttribute.h; sourceTree = "<group>"; };
@@ -20182,6 +20184,7 @@
 				1A2E6E560CC551E0004A2062 /* sql */,
 				B2C3D9EC0D006C1D00EF6F26 /* text */,
 				BCFB2F74097A2E1A00BA703D /* Arena.cpp */,
+				9831AE49154225A200FE2644 /* ReferrerPolicy.h */,
 				BCFB2F75097A2E1A00BA703D /* Arena.h */,
 				89D08D9C12228451001241DF /* AsyncFileSystem.cpp */,
 				89D08D9D12228451001241DF /* AsyncFileSystem.h */,
@@ -24800,6 +24803,7 @@
 				CECADFC7153778FF00E37068 /* DictationAlternative.h in Headers */,
 				CECADFC9153778FF00E37068 /* DictationCommand.h in Headers */,
 				CECADFCE1537791D00E37068 /* TextInsertionBaseCommand.h in Headers */,
+				9831AE4A154225C900FE2644 /* ReferrerPolicy.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: trunk/Source/WebCore/dom/Document.cpp (114889 => 114890)


--- trunk/Source/WebCore/dom/Document.cpp	2012-04-23 12:37:50 UTC (rev 114889)
+++ trunk/Source/WebCore/dom/Document.cpp	2012-04-23 12:53:24 UTC (rev 114890)
@@ -470,7 +470,7 @@
 #endif
     , m_loadEventDelayCount(0)
     , m_loadEventDelayTimer(this, &Document::loadEventDelayTimerFired)
-    , m_referrerPolicy(SecurityPolicy::ReferrerPolicyDefault)
+    , m_referrerPolicy(ReferrerPolicyDefault)
     , m_directionSetOnDocumentElement(false)
     , m_writingModeSetOnDocumentElement(false)
     , m_writeRecursionIsTooDeep(false)
@@ -2964,14 +2964,14 @@
 {
     ASSERT(!policy.isNull());
 
-    m_referrerPolicy = SecurityPolicy::ReferrerPolicyDefault;
+    m_referrerPolicy = ReferrerPolicyDefault;
 
     if (equalIgnoringCase(policy, "never"))
-        m_referrerPolicy = SecurityPolicy::ReferrerPolicyNever;
+        m_referrerPolicy = ReferrerPolicyNever;
     else if (equalIgnoringCase(policy, "always"))
-        m_referrerPolicy = SecurityPolicy::ReferrerPolicyAlways;
+        m_referrerPolicy = ReferrerPolicyAlways;
     else if (equalIgnoringCase(policy, "origin"))
-        m_referrerPolicy = SecurityPolicy::ReferrerPolicyOrigin;
+        m_referrerPolicy = ReferrerPolicyOrigin;
 }
 
 MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& request, const LayoutPoint& documentPoint, const PlatformMouseEvent& event)

Modified: trunk/Source/WebCore/dom/Document.h (114889 => 114890)


--- trunk/Source/WebCore/dom/Document.h	2012-04-23 12:37:50 UTC (rev 114889)
+++ trunk/Source/WebCore/dom/Document.h	2012-04-23 12:53:24 UTC (rev 114890)
@@ -42,8 +42,8 @@
 #include "PageVisibilityState.h"
 #include "PlatformScreen.h"
 #include "QualifiedName.h"
+#include "ReferrerPolicy.h"
 #include "ScriptExecutionContext.h"
-#include "SecurityPolicy.h"
 #include "StringWithDirection.h"
 #include "Timer.h"
 #include "TreeScope.h"
@@ -326,7 +326,7 @@
 
     ViewportArguments viewportArguments() const { return m_viewportArguments; }
 
-    SecurityPolicy::ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; }
+    ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; }
 
     DocumentType* doctype() const { return m_docType.get(); }
 
@@ -1464,7 +1464,7 @@
 
     ViewportArguments m_viewportArguments;
 
-    SecurityPolicy::ReferrerPolicy m_referrerPolicy;
+    ReferrerPolicy m_referrerPolicy;
 
     bool m_directionSetOnDocumentElement;
     bool m_writingModeSetOnDocumentElement;

Modified: trunk/Source/WebCore/page/SecurityPolicy.h (114889 => 114890)


--- trunk/Source/WebCore/page/SecurityPolicy.h	2012-04-23 12:37:50 UTC (rev 114889)
+++ trunk/Source/WebCore/page/SecurityPolicy.h	2012-04-23 12:53:24 UTC (rev 114890)
@@ -29,6 +29,7 @@
 #ifndef SecurityPolicy_h
 #define SecurityPolicy_h
 
+#include "ReferrerPolicy.h"
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -38,15 +39,6 @@
 
 class SecurityPolicy {
 public:
-    enum ReferrerPolicy {
-        ReferrerPolicyAlways,
-        ReferrerPolicyDefault,
-        ReferrerPolicyNever,
-        // Same as ReferrerPolicyAlways, except that only the origin of the
-        // referring URL is send.
-        ReferrerPolicyOrigin,
-    };
-
     // True if the referrer should be omitted according to the
     // ReferrerPolicyDefault. If you intend to send a referrer header, you
     // should use generateReferrerHeader instead.

Added: trunk/Source/WebCore/platform/ReferrerPolicy.h (0 => 114890)


--- trunk/Source/WebCore/platform/ReferrerPolicy.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/ReferrerPolicy.h	2012-04-23 12:53:24 UTC (rev 114890)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef ReferrerPolicy_h
+#define ReferrerPolicy_h
+
+namespace WebCore {
+
+enum ReferrerPolicy {
+    ReferrerPolicyAlways,
+    ReferrerPolicyDefault,
+    ReferrerPolicyNever,
+    // Same as ReferrerPolicyAlways, except that only the origin of the
+    // referring URL is send.
+    ReferrerPolicyOrigin,
+};
+
+}
+
+#endif // ReferrerPolicy_h

Modified: trunk/Source/WebKit/chromium/ChangeLog (114889 => 114890)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-04-23 12:37:50 UTC (rev 114889)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-04-23 12:53:24 UTC (rev 114890)
@@ -1,3 +1,17 @@
+2012-04-23  Gavin Peters  <gav...@chromium.org>
+
+        Move ReferrerPolicy out of SecurityPolicy class into its own header in platform.
+        https://bugs.webkit.org/show_bug.cgi?id=84516
+
+
+        Reviewed by Adam Barth.
+
+        No change in behaviour; same enum, different class.
+
+        * src/AssertMatchingEnums.cpp:
+        * src/WebSecurityPolicy.cpp:
+        (WebKit::WebSecurityPolicy::generateReferrerHeader):
+
 2012-04-22  Andreas Kling  <kl...@webkit.org>
 
         Optimize Element attribute storage for the common case (no Attr objects.)

Modified: trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp (114889 => 114890)


--- trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp	2012-04-23 12:37:50 UTC (rev 114889)
+++ trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp	2012-04-23 12:53:24 UTC (rev 114890)
@@ -61,7 +61,7 @@
 #include "PasteboardPrivate.h"
 #include "PeerConnection00.h"
 #include "PlatformCursor.h"
-#include "SecurityPolicy.h"
+#include "ReferrerPolicy.h"
 #include "Settings.h"
 #include "StorageInfo.h"
 #include "TextAffinity.h"
@@ -560,10 +560,10 @@
 COMPILE_ASSERT_MATCHING_ENUM(WebPeerConnection00HandlerClient::ICEStateClosed, PeerConnection00::ICE_CLOSED);
 #endif
 
-COMPILE_ASSERT_MATCHING_ENUM(WebReferrerPolicyAlways, SecurityPolicy::ReferrerPolicyAlways);
-COMPILE_ASSERT_MATCHING_ENUM(WebReferrerPolicyDefault, SecurityPolicy::ReferrerPolicyDefault);
-COMPILE_ASSERT_MATCHING_ENUM(WebReferrerPolicyNever, SecurityPolicy::ReferrerPolicyNever);
-COMPILE_ASSERT_MATCHING_ENUM(WebReferrerPolicyOrigin, SecurityPolicy::ReferrerPolicyOrigin);
+COMPILE_ASSERT_MATCHING_ENUM(WebReferrerPolicyAlways, ReferrerPolicyAlways);
+COMPILE_ASSERT_MATCHING_ENUM(WebReferrerPolicyDefault, ReferrerPolicyDefault);
+COMPILE_ASSERT_MATCHING_ENUM(WebReferrerPolicyNever, ReferrerPolicyNever);
+COMPILE_ASSERT_MATCHING_ENUM(WebReferrerPolicyOrigin, ReferrerPolicyOrigin);
 
 COMPILE_ASSERT_MATCHING_ENUM(WebContentSecurityPolicyTypeReportOnly, ContentSecurityPolicy::ReportOnly);
 COMPILE_ASSERT_MATCHING_ENUM(WebContentSecurityPolicyTypeEnforcePolicy, ContentSecurityPolicy::EnforcePolicy);

Modified: trunk/Source/WebKit/chromium/src/WebSecurityPolicy.cpp (114889 => 114890)


--- trunk/Source/WebKit/chromium/src/WebSecurityPolicy.cpp	2012-04-23 12:37:50 UTC (rev 114889)
+++ trunk/Source/WebKit/chromium/src/WebSecurityPolicy.cpp	2012-04-23 12:53:24 UTC (rev 114890)
@@ -107,7 +107,7 @@
 
 WebString WebSecurityPolicy::generateReferrerHeader(WebReferrerPolicy referrerPolicy, const WebURL& url, const WebString& referrer)
 {
-    return SecurityPolicy::generateReferrerHeader(static_cast<SecurityPolicy::ReferrerPolicy>(referrerPolicy), url, referrer);
+    return SecurityPolicy::generateReferrerHeader(static_cast<ReferrerPolicy>(referrerPolicy), url, referrer);
 }
 
 void WebSecurityPolicy::registerURLSchemeAsNotAllowingJavascriptURLs(const WebString& scheme)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to