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) |
+ UseCounter::count(this, UseCounter::ResetReferrerPolicy); |
+ |
+ m_referrerPolicy = referrerPolicy; |
+} |
+ |
void ExecutionContext::removeURLFromMemoryCache(const KURL& url) |
{ |
memoryCache()->removeURLFromCache(url); |