Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2033)

Unified Diff: Source/core/workers/WorkerThread.h

Issue 1158443008: compositor-worker: Share a thread and an isolate for compositor workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/workers/WorkerThread.h
diff --git a/Source/core/workers/WorkerThread.h b/Source/core/workers/WorkerThread.h
index 2405c86493da3a2d74d818d58207bc8e2333576c..62abd398b6676f9c6f5e97a5fc54db5e64fbaa35 100644
--- a/Source/core/workers/WorkerThread.h
+++ b/Source/core/workers/WorkerThread.h
@@ -32,6 +32,7 @@
#include "core/frame/csp/ContentSecurityPolicy.h"
#include "core/workers/WorkerGlobalScope.h"
#include "core/workers/WorkerLoaderProxy.h"
+#include "core/workers/WorkerV8Isolate.h"
#include "platform/WebThreadSupportingGC.h"
#include "platform/weborigin/SecurityOrigin.h"
#include "wtf/Forward.h"
@@ -69,11 +70,9 @@ public:
// some implementations can use an existing thread that is already being
// 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; }
+ v8::Isolate* 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)
@@ -122,11 +121,13 @@ protected:
virtual void postInitialize() { }
- virtual v8::Isolate* initializeIsolate();
- virtual void willDestroyIsolate();
- virtual void destroyIsolate();
+ virtual OwnPtr<WorkerV8Isolate>& workerIsolate() = 0;
kinuko 2015/05/29 17:45:18 Returning OwnPtr but not for the caller to take ow
sadrul 2015/05/29 18:26:32 With this change: . For managing the WebThread: W
virtual void terminateV8Execution();
+ virtual void didStartRunLoop();
kinuko 2015/05/29 17:45:18 nit: I think this can be public as far as didStart
sadrul 2015/05/29 18:26:32 Acknowledged. Will make this change.
sadrul 2015/06/01 05:24:11 Done.
+ virtual void initializeBackingThread();
+ virtual void shutdownBackingThread();
+
// This is protected virtual for testing.
virtual bool doIdleGc(double deadlineSeconds);
@@ -155,14 +156,11 @@ private:
RefPtrWillBePersistent<WorkerInspectorController> m_workerInspectorController;
Mutex m_workerInspectorControllerMutex;
- // This lock protects |m_workerGlobalScope|, |m_terminated|, |m_isolate| and |m_microtaskRunner|.
+ // This lock protects |m_workerGlobalScope|, and |m_terminated|.
Mutex m_threadStateMutex;
RefPtrWillBePersistent<WorkerGlobalScope> m_workerGlobalScope;
- v8::Isolate* m_isolate;
- OwnPtr<V8IsolateInterruptor> m_interruptor;
-
// Used to signal thread shutdown.
OwnPtr<WebWaitableEvent> m_shutdownEvent;

Powered by Google App Engine
This is Rietveld 408576698