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

Unified Diff: third_party/WebKit/Source/core/dom/StyleEngineContext.cpp

Issue 2203993002: Add a Physical Web omnibox autocomplete provider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: oops, wrong CL Created 4 years, 3 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/dom/StyleEngineContext.cpp
diff --git a/third_party/WebKit/Source/platform/network/ContentSecurityPolicyResponseHeaders.cpp b/third_party/WebKit/Source/core/dom/StyleEngineContext.cpp
similarity index 66%
copy from third_party/WebKit/Source/platform/network/ContentSecurityPolicyResponseHeaders.cpp
copy to third_party/WebKit/Source/core/dom/StyleEngineContext.cpp
index 9a7ebe08c7e5ef401b68fd03ceb4d9f94b5972d0..a345d267c4d1d5a6b38570705d3bfd17b3d54d2e 100644
--- a/third_party/WebKit/Source/platform/network/ContentSecurityPolicyResponseHeaders.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleEngineContext.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013 Google, Inc. All rights reserved.
+ * Copyright (C) 2016 Google, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -23,17 +23,26 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "platform/network/ContentSecurityPolicyResponseHeaders.h"
+#include "core/dom/StyleEngineContext.h"
-#include "platform/HTTPNames.h"
-#include "platform/network/ResourceResponse.h"
+#include "core/frame/UseCounter.h"
namespace blink {
-ContentSecurityPolicyResponseHeaders::ContentSecurityPolicyResponseHeaders(const ResourceResponse& response)
- : m_contentSecurityPolicy(response.httpHeaderField(HTTPNames::Content_Security_Policy))
- , m_contentSecurityPolicyReportOnly(response.httpHeaderField(HTTPNames::Content_Security_Policy_Report_Only))
+StyleEngineContext::StyleEngineContext()
+ : m_addedPendingSheetBeforeBody(false)
{
}
+void StyleEngineContext::addingPendingSheet(const Document& document)
+{
+ // If the sheet was ever added before the body then all references to it are
+ // treated as before-body.
+ if (!m_addedPendingSheetBeforeBody) {
+ m_addedPendingSheetBeforeBody = !document.body();
+ if (!m_addedPendingSheetBeforeBody)
+ UseCounter::count(document, UseCounter::PendingStylesheetAddedAfterBodyStarted);
+ }
}
+
+} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngineContext.h ('k') | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698