| 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 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 #include "core/dom/ContextLifecycleNotifier.h" | 31 #include "core/dom/ContextLifecycleNotifier.h" |
| 32 #include "core/dom/ErrorEvent.h" | 32 #include "core/dom/ErrorEvent.h" |
| 33 #include "core/dom/EventTarget.h" | 33 #include "core/dom/EventTarget.h" |
| 34 #include "core/dom/MessagePort.h" | 34 #include "core/dom/MessagePort.h" |
| 35 #include "core/dom/WebCoreMemoryInstrumentation.h" | 35 #include "core/dom/WebCoreMemoryInstrumentation.h" |
| 36 #include "core/html/PublicURLManager.h" | 36 #include "core/html/PublicURLManager.h" |
| 37 #include "core/inspector/ScriptCallStack.h" | 37 #include "core/inspector/ScriptCallStack.h" |
| 38 #include "core/loader/cache/CachedScript.h" | 38 #include "core/loader/cache/CachedScript.h" |
| 39 #include "core/page/DOMTimer.h" | 39 #include "core/page/DOMTimer.h" |
| 40 #include "core/workers/WorkerContext.h" | 40 #include "core/workers/WorkerGlobalScope.h" |
| 41 #include "core/workers/WorkerThread.h" | 41 #include "core/workers/WorkerThread.h" |
| 42 #include "modules/webdatabase/DatabaseContext.h" | 42 #include "modules/webdatabase/DatabaseContext.h" |
| 43 #include "wtf/MainThread.h" | 43 #include "wtf/MainThread.h" |
| 44 #include "wtf/MemoryInstrumentationHashMap.h" | 44 #include "wtf/MemoryInstrumentationHashMap.h" |
| 45 #include "wtf/MemoryInstrumentationHashSet.h" | 45 #include "wtf/MemoryInstrumentationHashSet.h" |
| 46 #include "wtf/MemoryInstrumentationVector.h" | 46 #include "wtf/MemoryInstrumentationVector.h" |
| 47 | 47 |
| 48 namespace WTF { | 48 namespace WTF { |
| 49 | 49 |
| 50 template<> struct SequenceMemoryInstrumentationTraits<WebCore::ContextLifecycleO
bserver*> { | 50 template<> struct SequenceMemoryInstrumentationTraits<WebCore::ContextLifecycleO
bserver*> { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // as a result is that dispatchMessages() will be called needlessly. | 126 // as a result is that dispatchMessages() will be called needlessly. |
| 127 if (m_messagePorts.contains(port) && port->started()) | 127 if (m_messagePorts.contains(port) && port->started()) |
| 128 port->dispatchMessages(); | 128 port->dispatchMessages(); |
| 129 } | 129 } |
| 130 } | 130 } |
| 131 | 131 |
| 132 void ScriptExecutionContext::createdMessagePort(MessagePort* port) | 132 void ScriptExecutionContext::createdMessagePort(MessagePort* port) |
| 133 { | 133 { |
| 134 ASSERT(port); | 134 ASSERT(port); |
| 135 ASSERT((isDocument() && isMainThread()) | 135 ASSERT((isDocument() && isMainThread()) |
| 136 || (isWorkerContext() && static_cast<WorkerContext*>(this)->thread()->is
CurrentThread())); | 136 || (isWorkerGlobalScope() && static_cast<WorkerGlobalScope*>(this)->thre
ad()->isCurrentThread())); |
| 137 | 137 |
| 138 m_messagePorts.add(port); | 138 m_messagePorts.add(port); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void ScriptExecutionContext::destroyedMessagePort(MessagePort* port) | 141 void ScriptExecutionContext::destroyedMessagePort(MessagePort* port) |
| 142 { | 142 { |
| 143 ASSERT(port); | 143 ASSERT(port); |
| 144 ASSERT((isDocument() && isMainThread()) | 144 ASSERT((isDocument() && isMainThread()) |
| 145 || (isWorkerContext() && static_cast<WorkerContext*>(this)->thread()->is
CurrentThread())); | 145 || (isWorkerGlobalScope() && static_cast<WorkerGlobalScope*>(this)->thre
ad()->isCurrentThread())); |
| 146 | 146 |
| 147 m_messagePorts.remove(port); | 147 m_messagePorts.remove(port); |
| 148 } | 148 } |
| 149 | 149 |
| 150 bool ScriptExecutionContext::canSuspendActiveDOMObjects() | 150 bool ScriptExecutionContext::canSuspendActiveDOMObjects() |
| 151 { | 151 { |
| 152 return lifecycleNotifier()->canSuspendActiveDOMObjects(); | 152 return lifecycleNotifier()->canSuspendActiveDOMObjects(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 bool ScriptExecutionContext::hasPendingActivity() | 155 bool ScriptExecutionContext::hasPendingActivity() |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 ScriptExecutionContext::Task::~Task() | 325 ScriptExecutionContext::Task::~Task() |
| 326 { | 326 { |
| 327 } | 327 } |
| 328 | 328 |
| 329 void ScriptExecutionContext::setDatabaseContext(DatabaseContext* databaseContext
) | 329 void ScriptExecutionContext::setDatabaseContext(DatabaseContext* databaseContext
) |
| 330 { | 330 { |
| 331 m_databaseContext = databaseContext; | 331 m_databaseContext = databaseContext; |
| 332 } | 332 } |
| 333 | 333 |
| 334 } // namespace WebCore | 334 } // namespace WebCore |
| OLD | NEW |