Chromium Code Reviews| Index: third_party/WebKit/Source/core/loader/HttpEquiv.cpp |
| diff --git a/third_party/WebKit/Source/core/loader/HttpEquiv.cpp b/third_party/WebKit/Source/core/loader/HttpEquiv.cpp |
| index 26447d3b2f3e86bc72df7bac709ff79edf455f69..6cf60e70d802fcecc90d31a43070fed7aa6c38bc 100644 |
| --- a/third_party/WebKit/Source/core/loader/HttpEquiv.cpp |
| +++ b/third_party/WebKit/Source/core/loader/HttpEquiv.cpp |
| @@ -5,6 +5,7 @@ |
| #include "core/loader/HttpEquiv.h" |
| #include "core/dom/Document.h" |
| +#include "core/dom/ScriptableDocumentParser.h" |
| #include "core/dom/StyleEngine.h" |
| #include "core/fetch/ClientHintsPreferences.h" |
| #include "core/frame/UseCounter.h" |
| @@ -12,6 +13,7 @@ |
| #include "core/html/HTMLDocument.h" |
| #include "core/inspector/ConsoleMessage.h" |
| #include "core/loader/DocumentLoader.h" |
| +#include "core/origin_trials/OriginTrials.h" |
| #include "platform/network/HTTPParsers.h" |
| #include "platform/weborigin/KURL.h" |
| @@ -42,6 +44,10 @@ void HttpEquiv::process(Document& document, const AtomicString& equiv, const Ato |
| document.contentSecurityPolicy()->reportMetaOutsideHead(content); |
| } else if (equalIgnoringCase(equiv, "suborigin")) { |
| document.addConsoleMessage(ConsoleMessage::create(SecurityMessageSource, ErrorMessageLevel, "Error with Suborigin header: Suborigin header with value '" + content + "' was delivered via a <meta> element and not an HTTP header, which is disallowed. The Suborigin has been ignored.")); |
| + } else if (equalIgnoringCase(equiv, HTTPNames::Origin_Trial)) { |
|
iclelland
2016/03/31 15:00:00
I like using HTTPNames here -- do you have any ide
Marijn Kruisselbrink
2016/03/31 19:01:48
No idea, so maybe core/ owners will object to usin
iclelland
2016/04/01 15:19:09
Okay; we should be explicit and #include "platform
|
| + bool isScriptGenerated = document.hasFinishedParsing() || (document.scriptableDocumentParser() && document.scriptableDocumentParser()->isExecutingScript()); |
|
Marijn Kruisselbrink
2016/03/25 19:08:39
I'm not sure if this is entirely the right check t
iclelland
2016/03/31 15:00:00
You can see what I'd done in https://codereview.ch
Marijn Kruisselbrink
2016/03/31 19:01:48
Yeah, I wasn't sure what situations we actually wa
iclelland
2016/04/01 15:19:09
Let's keep this here, then -- I haven't been able
Marijn Kruisselbrink
2016/04/01 23:54:47
I started trying to specify what behavior we're ai
iclelland
2016/04/05 17:26:28
Out of a bunch of discussions, so a spec is probab
Marijn Kruisselbrink
2016/04/05 20:56:08
Hmmm, okay. At least it seems the code in this CL
|
| + if (!isScriptGenerated) |
| + OriginTrials::from(&document)->addToken(content); |
| } |
| } |