Chromium Code Reviews| Index: Source/core/dom/ExecutionContext.cpp |
| diff --git a/Source/core/dom/ExecutionContext.cpp b/Source/core/dom/ExecutionContext.cpp |
| index a559d1c459d0b23cf46a16752ff19ece544d013a..7e21b2bdb2f83d199f61ddf330202f6e21130f65 100644 |
| --- a/Source/core/dom/ExecutionContext.cpp |
| +++ b/Source/core/dom/ExecutionContext.cpp |
| @@ -32,6 +32,7 @@ |
| #include "core/events/ErrorEvent.h" |
| #include "core/events/EventTarget.h" |
| #include "core/fetch/MemoryCache.h" |
| +#include "core/frame/UseCounter.h" |
| #include "core/html/PublicURLManager.h" |
| #include "core/inspector/InspectorInstrumentation.h" |
| #include "core/inspector/ScriptCallStack.h" |
| @@ -73,6 +74,7 @@ ExecutionContext::ExecutionContext() |
| , m_strictMixedContentCheckingEnforced(false) |
| , m_windowInteractionTokens(0) |
| , m_isRunSuspendableTasksScheduled(false) |
| + , m_referrerPolicy(ReferrerPolicyDefault) |
| { |
| } |
| @@ -248,6 +250,16 @@ bool ExecutionContext::isWindowInteractionAllowed() const |
| return m_windowInteractionTokens > 0; |
| } |
| +void ExecutionContext::setReferrerPolicy(ReferrerPolicy referrerPolicy) |
| +{ |
| + // FIXME: Can we adopt the CSP referrer policy merge algorithm? Or does the web rely on being able to modify the referrer policy in-flight? |
| + UseCounter::count(this, UseCounter::SetReferrerPolicy); |
| + if (m_referrerPolicy != ReferrerPolicyDefault) |
|
jochen (gone - plz use gerrit)
2015/05/04 07:20:31
i notice this is just copy/paste, but shouldn't th
Mike West
2015/05/04 14:17:20
I don't think so. If the referrer policy is the de
jochen (gone - plz use gerrit)
2015/05/04 14:36:12
ah, right
|
| + UseCounter::count(this, UseCounter::ResetReferrerPolicy); |
| + |
| + m_referrerPolicy = referrerPolicy; |
| +} |
| + |
| void ExecutionContext::removeURLFromMemoryCache(const KURL& url) |
| { |
| memoryCache()->removeURLFromCache(url); |