Title: [129315] trunk/Source/WebCore
Revision
129315
Author
[email protected]
Date
2012-09-23 10:37:15 -0700 (Sun, 23 Sep 2012)

Log Message

Measure the usage of the "X-WebKit-CSP" header in the hopes of dropping the prefix completely.
https://bugs.webkit.org/show_bug.cgi?id=97408

Patch by Mike West <[email protected]> on 2012-09-23
Reviewed by Adam Barth.

We plan on landing the unprefixed header in webkit.org/b/96765 once the
spec moves to CR. Though we plan to use it for experimentation in the
near future, we'll want to drop the prefixed header completely at some
point in the future. Starting to measure its usage now will give us a
good baseline when we start contemplating that decision.

No new functionality, so no new tests.

* page/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::didReceiveHeader):
* page/FeatureObserver.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (129314 => 129315)


--- trunk/Source/WebCore/ChangeLog	2012-09-23 06:56:53 UTC (rev 129314)
+++ trunk/Source/WebCore/ChangeLog	2012-09-23 17:37:15 UTC (rev 129315)
@@ -1,3 +1,22 @@
+2012-09-23  Mike West  <[email protected]>
+
+        Measure the usage of the "X-WebKit-CSP" header in the hopes of dropping the prefix completely.
+        https://bugs.webkit.org/show_bug.cgi?id=97408
+
+        Reviewed by Adam Barth.
+
+        We plan on landing the unprefixed header in webkit.org/b/96765 once the
+        spec moves to CR. Though we plan to use it for experimentation in the
+        near future, we'll want to drop the prefixed header completely at some
+        point in the future. Starting to measure its usage now will give us a
+        good baseline when we start contemplating that decision.
+
+        No new functionality, so no new tests.
+
+        * page/ContentSecurityPolicy.cpp:
+        (WebCore::ContentSecurityPolicy::didReceiveHeader):
+        * page/FeatureObserver.h:
+
 2012-09-22  Dominic Mazzoni  <[email protected]>
 
         AX: Layout tests would be easier to write if AccessibilityController could find an element by id

Modified: trunk/Source/WebCore/page/ContentSecurityPolicy.cpp (129314 => 129315)


--- trunk/Source/WebCore/page/ContentSecurityPolicy.cpp	2012-09-23 06:56:53 UTC (rev 129314)
+++ trunk/Source/WebCore/page/ContentSecurityPolicy.cpp	2012-09-23 17:37:15 UTC (rev 129315)
@@ -29,6 +29,7 @@
 #include "Console.h"
 #include "DOMStringList.h"
 #include "Document.h"
+#include "FeatureObserver.h"
 #include "FormData.h"
 #include "FormDataList.h"
 #include "Frame.h"
@@ -1285,6 +1286,11 @@
 
 void ContentSecurityPolicy::didReceiveHeader(const String& header, HeaderType type)
 {
+    if (m_scriptExecutionContext->isDocument()) {
+        Document* document = static_cast<Document*>(m_scriptExecutionContext);
+        FeatureObserver::observe(document->domWindow(), FeatureObserver::PrefixedContentSecurityPolicy);
+    }
+
     // RFC2616, section 4.2 specifies that headers appearing multiple times can
     // be combined with a comma. Walk the header string, and parse each comma
     // separated chunk as a separate header.

Modified: trunk/Source/WebCore/page/FeatureObserver.h (129314 => 129315)


--- trunk/Source/WebCore/page/FeatureObserver.h	2012-09-23 06:56:53 UTC (rev 129314)
+++ trunk/Source/WebCore/page/FeatureObserver.h	2012-09-23 17:37:15 UTC (rev 129315)
@@ -47,6 +47,7 @@
         SharedWorkerStart,
         LegacyWebAudioNoteOn,
         WebAudioStart,
+        PrefixedContentSecurityPolicy,
         // Add new features above this line.
         NumberOfFeatures, // This enum value must be last.
     };
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to