Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(612)

Unified Diff: third_party/WebKit/Source/core/loader/HttpEquiv.cpp

Issue 1833063002: Store the list of trial tokens in OriginTrialContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
}

Powered by Google App Engine
This is Rietveld 408576698