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

Unified Diff: Source/core/workers/WorkerIsolateWrapper.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/WorkerIsolateWrapper.h
diff --git a/Source/core/workers/WorkerIsolateWrapper.h b/Source/core/workers/WorkerIsolateWrapper.h
new file mode 100644
index 0000000000000000000000000000000000000000..f3d2f22e1f71c32ceffc7d38d12aeb73dbcc72d8
--- /dev/null
+++ b/Source/core/workers/WorkerIsolateWrapper.h
@@ -0,0 +1,36 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WorkerIsolateWrapper_h
+#define WorkerIsolateWrapper_h
haraken 2015/06/02 02:14:49 "Wrapper" is a bit confusing with V8 wrappers (for
haraken 2015/06/02 02:14:49 This should be in Source/bindings/core/v8/, since
+
+#include "core/CoreExport.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/PassOwnPtr.h"
+#include <v8.h>
+
+namespace blink {
+
+// A common interface for a worker to manage the v8::Isolate used for the worker. Each
+// WorkerThread creates and owns an instance of WorkerIsolateWrapper. It is created and
+// destroyed in the worker thread. A WorkerIsolateWrapper instance may create and own its
+// own v8::Isolate (the default implementation). But it is also possible for the
+// implementation to share the v8::Isolate with other WorkerIsolateWrapper instances in
+// the same thread.
+class CORE_EXPORT WorkerIsolateWrapper {
+public:
+ static PassOwnPtr<WorkerIsolateWrapper> createDefault();
+ virtual ~WorkerIsolateWrapper() { }
+
+ virtual v8::Isolate* isolate() const = 0;
+ virtual void willDestroy() = 0;
haraken 2015/06/02 02:14:49 Nit: willBeDestroyed()?
sadrul 2015/06/02 02:48:28 Done.
+ virtual void terminateExecution() = 0;
+
+protected:
+ WorkerIsolateWrapper() { }
+};
+
+} // namespace blink
+
+#endif // WorkerIsolateWrapper_h

Powered by Google App Engine
This is Rietveld 408576698