| 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 18 matching lines...) Expand all Loading... |
| 29 #include "core/dom/ExecutionContext.h" | 29 #include "core/dom/ExecutionContext.h" |
| 30 | 30 |
| 31 #include "core/dom/AddConsoleMessageTask.h" | 31 #include "core/dom/AddConsoleMessageTask.h" |
| 32 #include "core/dom/ContextLifecycleNotifier.h" | 32 #include "core/dom/ContextLifecycleNotifier.h" |
| 33 #include "core/dom/ExecutionContextTask.h" | 33 #include "core/dom/ExecutionContextTask.h" |
| 34 #include "core/events/ErrorEvent.h" | 34 #include "core/events/ErrorEvent.h" |
| 35 #include "core/events/EventTarget.h" | 35 #include "core/events/EventTarget.h" |
| 36 #include "core/html/PublicURLManager.h" | 36 #include "core/html/PublicURLManager.h" |
| 37 #include "core/inspector/InspectorInstrumentation.h" | 37 #include "core/inspector/InspectorInstrumentation.h" |
| 38 #include "core/inspector/ScriptCallStack.h" | 38 #include "core/inspector/ScriptCallStack.h" |
| 39 #include "core/page/WindowFocusAllowedIndicator.h" |
| 39 #include "core/workers/WorkerGlobalScope.h" | 40 #include "core/workers/WorkerGlobalScope.h" |
| 40 #include "core/workers/WorkerThread.h" | 41 #include "core/workers/WorkerThread.h" |
| 41 #include "wtf/MainThread.h" | 42 #include "wtf/MainThread.h" |
| 42 | 43 |
| 43 namespace blink { | 44 namespace blink { |
| 44 | 45 |
| 45 class ExecutionContext::PendingException : public NoBaseWillBeGarbageCollectedFi
nalized<ExecutionContext::PendingException> { | 46 class ExecutionContext::PendingException : public NoBaseWillBeGarbageCollectedFi
nalized<ExecutionContext::PendingException> { |
| 46 WTF_MAKE_NONCOPYABLE(PendingException); | 47 WTF_MAKE_NONCOPYABLE(PendingException); |
| 47 public: | 48 public: |
| 48 PendingException(const String& errorMessage, int lineNumber, int columnNumbe
r, int scriptId, const String& sourceURL, PassRefPtrWillBeRawPtr<ScriptCallStack
> callStack) | 49 PendingException(const String& errorMessage, int lineNumber, int columnNumbe
r, int scriptId, const String& sourceURL, PassRefPtrWillBeRawPtr<ScriptCallStack
> callStack) |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 | 280 |
| 280 void ExecutionContext::consumeWindowFocus() | 281 void ExecutionContext::consumeWindowFocus() |
| 281 { | 282 { |
| 282 if (m_windowFocusTokens == 0) | 283 if (m_windowFocusTokens == 0) |
| 283 return; | 284 return; |
| 284 --m_windowFocusTokens; | 285 --m_windowFocusTokens; |
| 285 } | 286 } |
| 286 | 287 |
| 287 bool ExecutionContext::isWindowFocusAllowed() const | 288 bool ExecutionContext::isWindowFocusAllowed() const |
| 288 { | 289 { |
| 289 return m_windowFocusTokens > 0; | 290 // FIXME: WindowFocusAllowedIndicator::windowFocusAllowed() is temporary, |
| 291 // it will be removed as soon as WebScopedWindowFocusAllowedIndicator will |
| 292 // be updated to not use WindowFocusAllowedIndicator. |
| 293 return m_windowFocusTokens > 0 || WindowFocusAllowedIndicator::windowFocusAl
lowed(); |
| 290 } | 294 } |
| 291 | 295 |
| 292 void ExecutionContext::trace(Visitor* visitor) | 296 void ExecutionContext::trace(Visitor* visitor) |
| 293 { | 297 { |
| 294 #if ENABLE(OILPAN) | 298 #if ENABLE(OILPAN) |
| 295 visitor->trace(m_pendingExceptions); | 299 visitor->trace(m_pendingExceptions); |
| 296 visitor->trace(m_publicURLManager); | 300 visitor->trace(m_publicURLManager); |
| 297 visitor->trace(m_timeouts); | 301 visitor->trace(m_timeouts); |
| 298 HeapSupplementable<ExecutionContext>::trace(visitor); | 302 HeapSupplementable<ExecutionContext>::trace(visitor); |
| 299 #endif | 303 #endif |
| 300 LifecycleContext<ExecutionContext>::trace(visitor); | 304 LifecycleContext<ExecutionContext>::trace(visitor); |
| 301 } | 305 } |
| 302 | 306 |
| 303 } // namespace blink | 307 } // namespace blink |
| OLD | NEW |