| 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 13 matching lines...) Expand all Loading... |
| 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 25 * | 25 * |
| 26 */ | 26 */ |
| 27 | 27 |
| 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/ContextLifecycleNotifier.h" | 31 #include "core/dom/ContextLifecycleNotifier.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/html/PublicURLManager.h" | |
| 35 #include "core/inspector/ScriptCallStack.h" | 34 #include "core/inspector/ScriptCallStack.h" |
| 36 #include "wtf/MainThread.h" | 35 #include "wtf/MainThread.h" |
| 37 | 36 |
| 38 namespace blink { | 37 namespace blink { |
| 39 | 38 |
| 40 class ExecutionContext::PendingException : public DummyBase<ExecutionContext::Pe
ndingException> { | 39 class ExecutionContext::PendingException : public DummyBase<ExecutionContext::Pe
ndingException> { |
| 41 WTF_MAKE_NONCOPYABLE(PendingException); | 40 WTF_MAKE_NONCOPYABLE(PendingException); |
| 42 public: | 41 public: |
| 43 PendingException(const String& errorMessage, int lineNumber, int columnNumbe
r, int scriptId, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack) | 42 PendingException(const String& errorMessage, int lineNumber, int columnNumbe
r, int scriptId, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack) |
| 44 : m_errorMessage(errorMessage) | 43 : m_errorMessage(errorMessage) |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 return timer->timeoutID(); | 174 return timer->timeoutID(); |
| 176 } | 175 } |
| 177 | 176 |
| 178 void ExecutionContext::removeTimeoutByID(int timeoutID) | 177 void ExecutionContext::removeTimeoutByID(int timeoutID) |
| 179 { | 178 { |
| 180 if (timeoutID <= 0) | 179 if (timeoutID <= 0) |
| 181 return; | 180 return; |
| 182 m_timeouts.remove(timeoutID); | 181 m_timeouts.remove(timeoutID); |
| 183 } | 182 } |
| 184 | 183 |
| 185 PublicURLManager& ExecutionContext::publicURLManager() | |
| 186 { | |
| 187 if (!m_publicURLManager) | |
| 188 m_publicURLManager = PublicURLManager::create(this); | |
| 189 return *m_publicURLManager; | |
| 190 } | |
| 191 | |
| 192 void ExecutionContext::didChangeTimerAlignmentInterval() | 184 void ExecutionContext::didChangeTimerAlignmentInterval() |
| 193 { | 185 { |
| 194 for (TimeoutMap::iterator iter = m_timeouts.begin(); iter != m_timeouts.end(
); ++iter) | 186 for (TimeoutMap::iterator iter = m_timeouts.begin(); iter != m_timeouts.end(
); ++iter) |
| 195 iter->value->didChangeAlignmentInterval(); | 187 iter->value->didChangeAlignmentInterval(); |
| 196 } | 188 } |
| 197 | 189 |
| 198 const KURL& ExecutionContext::url() const | 190 const KURL& ExecutionContext::url() const |
| 199 { | 191 { |
| 200 if (!m_client) { | 192 if (!m_client) { |
| 201 DEFINE_STATIC_LOCAL(KURL, emptyURL, ()); | 193 DEFINE_STATIC_LOCAL(KURL, emptyURL, ()); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 { | 230 { |
| 239 return static_cast<ContextLifecycleNotifier&>(LifecycleContext<ExecutionCont
ext>::lifecycleNotifier()); | 231 return static_cast<ContextLifecycleNotifier&>(LifecycleContext<ExecutionCont
ext>::lifecycleNotifier()); |
| 240 } | 232 } |
| 241 | 233 |
| 242 bool ExecutionContext::isIteratingOverObservers() const | 234 bool ExecutionContext::isIteratingOverObservers() const |
| 243 { | 235 { |
| 244 return m_lifecycleNotifier && m_lifecycleNotifier->isIteratingOverObservers(
); | 236 return m_lifecycleNotifier && m_lifecycleNotifier->isIteratingOverObservers(
); |
| 245 } | 237 } |
| 246 | 238 |
| 247 } // namespace blink | 239 } // namespace blink |
| OLD | NEW |