| 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
|
|
|