| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |