CTTE: WorkerGlobalScope is always owned by a WorkerThread.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Feb 2014 07:41:12 +0000 (07:41 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Feb 2014 07:41:12 +0000 (07:41 +0000)
commit0fc2b213c9b978db37507b3ec07e06326930651b
treed968c38468e595278adb78884cc640fd75a16441
parenta39e66cdb2884dc988cb85c6bdc020086ea25722
CTTE: WorkerGlobalScope is always owned by a WorkerThread.
<https://webkit.org/b/128834>

Codify this by storing the owner thread as a WorkerThread& and making
thread() return a reference.

This exposed a couple of unnecessary assertions.

Reviewed by Anders Carlsson.

* Modules/notifications/WorkerGlobalScopeNotifications.cpp:
(WebCore::WorkerGlobalScopeNotifications::webkitNotifications):
* Modules/websockets/ThreadableWebSocketChannel.cpp:
(WebCore::ThreadableWebSocketChannel::create):
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::Bridge::Bridge):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::waitForMethodCompletion):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::execute):
* bindings/js/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::createdMessagePort):
(WebCore::ScriptExecutionContext::destroyedMessagePort):
* inspector/WorkerDebuggerAgent.cpp:
(WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
(WebCore::WorkerDebuggerAgent::~WorkerDebuggerAgent):
* inspector/WorkerInspectorController.cpp:
* inspector/WorkerRuntimeAgent.cpp:
(WebCore::WorkerRuntimeAgent::pauseWorkerGlobalScope):
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
(WebCore::WorkerThreadableLoader::loadResourceSynchronously):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::removeRequestFromCache):
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create):
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
(WebCore::DedicatedWorkerGlobalScope::postMessage):
(WebCore::DedicatedWorkerGlobalScope::importScripts):
(WebCore::DedicatedWorkerGlobalScope::thread):
* workers/DedicatedWorkerGlobalScope.h:
* workers/DedicatedWorkerThread.cpp:
(WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
* workers/SharedWorkerGlobalScope.cpp:
(WebCore::SharedWorkerGlobalScope::create):
(WebCore::SharedWorkerGlobalScope::SharedWorkerGlobalScope):
(WebCore::SharedWorkerGlobalScope::thread):
* workers/SharedWorkerGlobalScope.h:
* workers/SharedWorkerThread.cpp:
(WebCore::SharedWorkerThread::createWorkerGlobalScope):
* workers/WorkerGlobalScope.cpp:
(WebCore::CloseWorkerGlobalScopeTask::performTask):
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
(WebCore::WorkerGlobalScope::~WorkerGlobalScope):
(WebCore::WorkerGlobalScope::postTask):
(WebCore::WorkerGlobalScope::logExceptionToConsole):
(WebCore::WorkerGlobalScope::addConsoleMessage):
(WebCore::WorkerGlobalScope::addMessage):
(WebCore::WorkerGlobalScope::isContextThread):
* workers/WorkerGlobalScope.h:
(WebCore::WorkerGlobalScope::thread):
* workers/WorkerMessagingProxy.cpp:
(WebCore::MessageWorkerGlobalScopeTask::performTask):
(WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
(WebCore::WorkerMessagingProxy::~WorkerMessagingProxy):
* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::runInMode):
(WebCore::WorkerRunLoop::runCleanupTasks):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164158 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.cpp
Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.cpp
Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp
Source/WebCore/bindings/js/ScheduledAction.cpp
Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/inspector/WorkerDebuggerAgent.cpp
Source/WebCore/inspector/WorkerInspectorController.cpp
Source/WebCore/inspector/WorkerRuntimeAgent.cpp
Source/WebCore/loader/WorkerThreadableLoader.cpp
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/workers/DedicatedWorkerGlobalScope.cpp
Source/WebCore/workers/DedicatedWorkerGlobalScope.h
Source/WebCore/workers/DedicatedWorkerThread.cpp
Source/WebCore/workers/SharedWorkerGlobalScope.cpp
Source/WebCore/workers/SharedWorkerGlobalScope.h
Source/WebCore/workers/SharedWorkerThread.cpp
Source/WebCore/workers/WorkerGlobalScope.cpp
Source/WebCore/workers/WorkerGlobalScope.h
Source/WebCore/workers/WorkerMessagingProxy.cpp
Source/WebCore/workers/WorkerRunLoop.cpp