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

Side by Side Diff: Source/core/dom/ExecutionContext.cpp

Issue 1117203002: Enforce referrer policies for workers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2012 Google Inc. All Rights Reserved. 3 * Copyright (C) 2012 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 }; 66 };
67 67
68 ExecutionContext::ExecutionContext() 68 ExecutionContext::ExecutionContext()
69 : m_circularSequentialID(0) 69 : m_circularSequentialID(0)
70 , m_inDispatchErrorEvent(false) 70 , m_inDispatchErrorEvent(false)
71 , m_activeDOMObjectsAreSuspended(false) 71 , m_activeDOMObjectsAreSuspended(false)
72 , m_activeDOMObjectsAreStopped(false) 72 , m_activeDOMObjectsAreStopped(false)
73 , m_strictMixedContentCheckingEnforced(false) 73 , m_strictMixedContentCheckingEnforced(false)
74 , m_windowInteractionTokens(0) 74 , m_windowInteractionTokens(0)
75 , m_isRunSuspendableTasksScheduled(false) 75 , m_isRunSuspendableTasksScheduled(false)
76 , m_referrerPolicy(ReferrerPolicyDefault)
76 { 77 {
77 } 78 }
78 79
79 ExecutionContext::~ExecutionContext() 80 ExecutionContext::~ExecutionContext()
80 { 81 {
81 } 82 }
82 83
83 void ExecutionContext::suspendActiveDOMObjects() 84 void ExecutionContext::suspendActiveDOMObjects()
84 { 85 {
85 ASSERT(!m_activeDOMObjectsAreSuspended); 86 ASSERT(!m_activeDOMObjectsAreSuspended);
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 if (m_windowInteractionTokens == 0) 242 if (m_windowInteractionTokens == 0)
242 return; 243 return;
243 --m_windowInteractionTokens; 244 --m_windowInteractionTokens;
244 } 245 }
245 246
246 bool ExecutionContext::isWindowInteractionAllowed() const 247 bool ExecutionContext::isWindowInteractionAllowed() const
247 { 248 {
248 return m_windowInteractionTokens > 0; 249 return m_windowInteractionTokens > 0;
249 } 250 }
250 251
252 void ExecutionContext::setReferrerPolicy(ReferrerPolicy referrerPolicy)
253 {
254 // 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?
255 m_referrerPolicy = referrerPolicy;
256 }
257
251 void ExecutionContext::removeURLFromMemoryCache(const KURL& url) 258 void ExecutionContext::removeURLFromMemoryCache(const KURL& url)
252 { 259 {
253 memoryCache()->removeURLFromCache(url); 260 memoryCache()->removeURLFromCache(url);
254 } 261 }
255 262
256 DEFINE_TRACE(ExecutionContext) 263 DEFINE_TRACE(ExecutionContext)
257 { 264 {
258 #if ENABLE(OILPAN) 265 #if ENABLE(OILPAN)
259 visitor->trace(m_pendingExceptions); 266 visitor->trace(m_pendingExceptions);
260 visitor->trace(m_publicURLManager); 267 visitor->trace(m_publicURLManager);
261 HeapSupplementable<ExecutionContext>::trace(visitor); 268 HeapSupplementable<ExecutionContext>::trace(visitor);
262 #endif 269 #endif
263 ContextLifecycleNotifier::trace(visitor); 270 ContextLifecycleNotifier::trace(visitor);
264 } 271 }
265 272
266 } // namespace blink 273 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698