Chromium Code Reviews| Index: Source/core/workers/WorkerThread.h |
| diff --git a/Source/core/workers/WorkerThread.h b/Source/core/workers/WorkerThread.h |
| index fa0f296e5ac51c0c55210f5d51d5e346f7e95be6..963cea30d9a9835a436cbba829dd7c5de1ff7126 100644 |
| --- a/Source/core/workers/WorkerThread.h |
| +++ b/Source/core/workers/WorkerThread.h |
| @@ -61,8 +61,8 @@ public: |
| virtual ~WorkerThread(); |
| // Called on the main thread. |
| - virtual void start(PassOwnPtr<WorkerThreadStartupData>); |
| - virtual void stop(); |
| + void start(PassOwnPtr<WorkerThreadStartupData>); |
| + void terminate(); |
| // Returns the thread this worker runs on. Some implementations can create |
| // a new thread on the first call (e.g. shared, dedicated workers), whereas |
| @@ -70,20 +70,18 @@ public: |
| // used by other workers (e.g. compositor workers). |
| virtual WebThreadSupportingGC& backingThread() = 0; |
| - virtual void didStartRunLoop(); |
| virtual void didStopRunLoop(); |
| v8::Isolate* isolate() const { return m_isolate; } |
| // Can be used to wait for this worker thread to shut down. |
| - // (This is signalled on the main thread, so it's assumed to be waited on the worker context thread) |
| + // (This is signaled on the main thread, so it's assumed to be waited on |
| + // the worker context thread) |
| WebWaitableEvent* shutdownEvent() { return m_shutdownEvent.get(); } |
| - WebWaitableEvent* terminationEvent() { return m_terminationEvent.get(); } |
| - |
| - // Called in shutdown sequence. Internally calls stop() (or stopInternal) |
| - // and wait (by *blocking* the calling thread) until the worker(s) is/are |
| - // shut down. |
| + // Called in shutdown sequence. Internally calls terminate() (or |
| + // terminateInternal) and wait (by *blocking* the calling thread) until the |
| + // worker(s) is/are shut down. |
| void terminateAndWait(); |
| static void terminateAndWaitForAllWorkers(); |
| @@ -109,8 +107,7 @@ public: |
| WorkerGlobalScope* workerGlobalScope() const { return m_workerGlobalScope.get(); } |
| - // Returns true once stop() (or one of the terminate* methods which |
| - // internally calls stop) is called. |
| + // Returns true once one of the terminate* methods is called. |
| bool terminated(); |
| // Number of active worker threads. |
| @@ -141,7 +138,8 @@ private: |
| friend class WorkerMicrotaskRunner; |
| // Called on the main thread. |
| - void stopInternal(); |
| + virtual void didStartRunLoop(); |
|
kinuko
2015/06/11 08:42:33
nit: It's subjective but I think I'd like to keep
Takashi Toyoshima
2015/06/11 11:25:59
Sounds reasonable. If we could stop calling didSto
|
| + void terminateInternal(); |
| // Called on the worker thread. |
| void initialize(PassOwnPtr<WorkerThreadStartupData>); |