Commit 1f953f12 authored by haraken@chromium.org's avatar haraken@chromium.org

Rename workerGlobalScopeDestroyed to workerThreadTerminated

This is a follow-up fix for https://codereview.chromium.org/462423003/.
It's inconsistent that workerGlobalScopeDestroyed is called while
workerGlobalScopeStarted is not called. In fact, workerGlobalScopeDestroyed
is a signal to let the WorkerMessagingProxy know that the worker thread
is terminated, it should be renamed to workerThreadTerminated.

BUG=403179

Review URL: https://codereview.chromium.org/468883002

git-svn-id: svn://svn.chromium.org/blink/trunk@180254 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 586716e3
......@@ -223,7 +223,7 @@ void WorkerMessagingProxy::workerObjectDestroyedInternal(ExecutionContext*, Work
if (proxy->m_workerThread)
proxy->terminateWorkerGlobalScope();
else
proxy->workerGlobalScopeDestroyed();
proxy->workerThreadTerminated();
}
static void connectToWorkerGlobalScopeInspectorTask(ExecutionContext* context, bool)
......@@ -282,7 +282,7 @@ void WorkerMessagingProxy::writeTimelineStartedEvent(const String& sessionId)
m_queuedEarlyTasks.append(task.release());
}
void WorkerMessagingProxy::workerGlobalScopeDestroyed()
void WorkerMessagingProxy::workerThreadTerminated()
{
// This method is always the last to be performed, so the proxy is not needed for communication
// in either side any more. However, the Worker object may still exist, and it assumes that the proxy exists, too.
......
......@@ -71,7 +71,7 @@ public:
void confirmMessageFromWorkerObject(bool hasPendingActivity);
void reportPendingActivity(bool hasPendingActivity);
void workerGlobalScopeClosed();
void workerGlobalScopeDestroyed();
void workerThreadTerminated();
// Implementation of WorkerLoaderProxy.
// These methods are called on different threads to schedule loading
......
......@@ -93,10 +93,10 @@ void WorkerObjectProxy::workerGlobalScopeClosed()
m_executionContext->postTask(createCrossThreadTask(&WorkerMessagingProxy::terminateWorkerGlobalScope, m_messagingProxy));
}
void WorkerObjectProxy::workerGlobalScopeDestroyed()
void WorkerObjectProxy::workerThreadTerminated()
{
// This will terminate the MessagingProxy.
m_executionContext->postTask(createCrossThreadTask(&WorkerMessagingProxy::workerGlobalScopeDestroyed, m_messagingProxy));
m_executionContext->postTask(createCrossThreadTask(&WorkerMessagingProxy::workerThreadTerminated, m_messagingProxy));
}
WorkerObjectProxy::WorkerObjectProxy(ExecutionContext* executionContext, WorkerMessagingProxy* messagingProxy)
......
......@@ -66,7 +66,7 @@ public:
virtual void updateInspectorStateCookie(const String&) OVERRIDE;
virtual void workerGlobalScopeStarted(WorkerGlobalScope*) OVERRIDE { }
virtual void workerGlobalScopeClosed() OVERRIDE;
virtual void workerGlobalScopeDestroyed() OVERRIDE;
virtual void workerThreadTerminated() OVERRIDE;
virtual void willDestroyWorkerGlobalScope() OVERRIDE { }
private:
......
......@@ -59,7 +59,7 @@ public:
// Invoked when the thread is stopped and WorkerGlobalScope is being
// destructed. (This is be the last method that is called on this
// interface)
virtual void workerGlobalScopeDestroyed() = 0;
virtual void workerThreadTerminated() = 0;
// Invoked when the thread is about to be stopped and WorkerGlobalScope
// is to be destructed. (When this is called it is guaranteed that
......
......@@ -248,7 +248,7 @@ void WorkerThread::initialize()
if (m_terminated) {
// Notify the proxy that the WorkerGlobalScope has been disposed of.
// This can free this thread object, hence it must not be touched afterwards.
m_workerReportingProxy.workerGlobalScopeDestroyed();
m_workerReportingProxy.workerThreadTerminated();
return;
}
......@@ -318,7 +318,7 @@ void WorkerThread::cleanup()
// Notify the proxy that the WorkerGlobalScope has been disposed of.
// This can free this thread object, hence it must not be touched afterwards.
workerReportingProxy().workerGlobalScopeDestroyed();
workerReportingProxy().workerThreadTerminated();
// Clean up PlatformThreadData before WTF::WTFThreadData goes away!
PlatformThreadData::current().destroy();
......
......@@ -151,7 +151,7 @@ void ServiceWorkerGlobalScopeProxy::willDestroyWorkerGlobalScope()
m_client.willDestroyWorkerContext();
}
void ServiceWorkerGlobalScopeProxy::workerGlobalScopeDestroyed()
void ServiceWorkerGlobalScopeProxy::workerThreadTerminated()
{
m_client.workerContextDestroyed();
}
......
......@@ -56,7 +56,7 @@ class WebServiceWorkerRequest;
// e.g. onfetch.
//
// An instance of this class is supposed to outlive until
// workerGlobalScopeDestroyed() is called by its corresponding
// workerThreadTerminated() is called by its corresponding
// WorkerGlobalScope.
class ServiceWorkerGlobalScopeProxy FINAL
: public WebServiceWorkerContextProxy
......@@ -82,7 +82,7 @@ public:
virtual void workerGlobalScopeStarted(blink::WorkerGlobalScope*) OVERRIDE;
virtual void workerGlobalScopeClosed() OVERRIDE;
virtual void willDestroyWorkerGlobalScope() OVERRIDE;
virtual void workerGlobalScopeDestroyed() OVERRIDE;
virtual void workerThreadTerminated() OVERRIDE;
private:
ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerImpl&, blink::ExecutionContext&, WebServiceWorkerContextClient&);
......
......@@ -282,12 +282,12 @@ void WebSharedWorkerImpl::workerGlobalScopeStarted(WorkerGlobalScope*)
{
}
void WebSharedWorkerImpl::workerGlobalScopeDestroyed()
void WebSharedWorkerImpl::workerThreadTerminated()
{
callOnMainThread(bind(&WebSharedWorkerImpl::workerGlobalScopeDestroyedOnMainThread, this));
callOnMainThread(bind(&WebSharedWorkerImpl::workerThreadTerminatedOnMainThread, this));
}
void WebSharedWorkerImpl::workerGlobalScopeDestroyedOnMainThread()
void WebSharedWorkerImpl::workerThreadTerminatedOnMainThread()
{
if (client())
client()->workerContextDestroyed();
......
......@@ -79,7 +79,7 @@ public:
virtual void updateInspectorStateCookie(const WTF::String&) OVERRIDE;
virtual void workerGlobalScopeStarted(WorkerGlobalScope*) OVERRIDE;
virtual void workerGlobalScopeClosed() OVERRIDE;
virtual void workerGlobalScopeDestroyed() OVERRIDE;
virtual void workerThreadTerminated() OVERRIDE;
virtual void willDestroyWorkerGlobalScope() OVERRIDE { }
// WorkerLoaderProxy methods:
......@@ -125,7 +125,7 @@ private:
static void connectTask(ExecutionContext*, PassOwnPtr<WebMessagePortChannel>);
// Tasks that are run on the main thread.
void workerGlobalScopeClosedOnMainThread();
void workerGlobalScopeDestroyedOnMainThread();
void workerThreadTerminatedOnMainThread();
// 'shadow page' - created to proxy loading requests from the worker.
RefPtrWillBePersistent<ExecutionContext> m_loadingDocument;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment