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

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

Issue 722423004: Remove WindowFocusAllowedIndicator and associated code. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@window_focus
Patch Set: rebase Created 5 years, 8 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
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/page/WindowFocusAllowedIndicator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 17 matching lines...) Expand all
28 #include "config.h" 28 #include "config.h"
29 #include "core/dom/ExecutionContext.h" 29 #include "core/dom/ExecutionContext.h"
30 30
31 #include "core/dom/ExecutionContextTask.h" 31 #include "core/dom/ExecutionContextTask.h"
32 #include "core/events/ErrorEvent.h" 32 #include "core/events/ErrorEvent.h"
33 #include "core/events/EventTarget.h" 33 #include "core/events/EventTarget.h"
34 #include "core/fetch/MemoryCache.h" 34 #include "core/fetch/MemoryCache.h"
35 #include "core/html/PublicURLManager.h" 35 #include "core/html/PublicURLManager.h"
36 #include "core/inspector/InspectorInstrumentation.h" 36 #include "core/inspector/InspectorInstrumentation.h"
37 #include "core/inspector/ScriptCallStack.h" 37 #include "core/inspector/ScriptCallStack.h"
38 #include "core/page/WindowFocusAllowedIndicator.h"
39 #include "core/workers/WorkerGlobalScope.h" 38 #include "core/workers/WorkerGlobalScope.h"
40 #include "core/workers/WorkerThread.h" 39 #include "core/workers/WorkerThread.h"
41 #include "wtf/MainThread.h" 40 #include "wtf/MainThread.h"
42 41
43 namespace blink { 42 namespace blink {
44 43
45 class ExecutionContext::PendingException : public NoBaseWillBeGarbageCollectedFi nalized<ExecutionContext::PendingException> { 44 class ExecutionContext::PendingException : public NoBaseWillBeGarbageCollectedFi nalized<ExecutionContext::PendingException> {
46 WTF_MAKE_NONCOPYABLE(PendingException); 45 WTF_MAKE_NONCOPYABLE(PendingException);
47 public: 46 public:
48 PendingException(const String& errorMessage, int lineNumber, int columnNumbe r, int scriptId, const String& sourceURL, PassRefPtrWillBeRawPtr<ScriptCallStack > callStack) 47 PendingException(const String& errorMessage, int lineNumber, int columnNumbe r, int scriptId, const String& sourceURL, PassRefPtrWillBeRawPtr<ScriptCallStack > callStack)
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 238
240 void ExecutionContext::consumeWindowInteraction() 239 void ExecutionContext::consumeWindowInteraction()
241 { 240 {
242 if (m_windowInteractionTokens == 0) 241 if (m_windowInteractionTokens == 0)
243 return; 242 return;
244 --m_windowInteractionTokens; 243 --m_windowInteractionTokens;
245 } 244 }
246 245
247 bool ExecutionContext::isWindowInteractionAllowed() const 246 bool ExecutionContext::isWindowInteractionAllowed() const
248 { 247 {
249 // FIXME: WindowFocusAllowedIndicator::windowFocusAllowed() is temporary, 248 return m_windowInteractionTokens > 0;
250 // it will be removed as soon as WebScopedWindowFocusAllowedIndicator will
251 // be updated to not use WindowFocusAllowedIndicator.
252 return m_windowInteractionTokens > 0 || WindowFocusAllowedIndicator::windowF ocusAllowed();
253 } 249 }
254 250
255 void ExecutionContext::removeURLFromMemoryCache(const KURL& url) 251 void ExecutionContext::removeURLFromMemoryCache(const KURL& url)
256 { 252 {
257 memoryCache()->removeURLFromCache(url); 253 memoryCache()->removeURLFromCache(url);
258 } 254 }
259 255
260 DEFINE_TRACE(ExecutionContext) 256 DEFINE_TRACE(ExecutionContext)
261 { 257 {
262 #if ENABLE(OILPAN) 258 #if ENABLE(OILPAN)
263 visitor->trace(m_pendingExceptions); 259 visitor->trace(m_pendingExceptions);
264 visitor->trace(m_publicURLManager); 260 visitor->trace(m_publicURLManager);
265 HeapSupplementable<ExecutionContext>::trace(visitor); 261 HeapSupplementable<ExecutionContext>::trace(visitor);
266 #endif 262 #endif
267 ContextLifecycleNotifier::trace(visitor); 263 ContextLifecycleNotifier::trace(visitor);
268 } 264 }
269 265
270 } // namespace blink 266 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/core.gypi ('k') | Source/core/page/WindowFocusAllowedIndicator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698