OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WorkerIsolateWrapper_h |
| 6 #define WorkerIsolateWrapper_h |
| 7 |
| 8 #include "core/CoreExport.h" |
| 9 #include "wtf/OwnPtr.h" |
| 10 #include "wtf/PassOwnPtr.h" |
| 11 #include <v8.h> |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 // A common interface for a worker to manage the v8::Isolate used for the worker
. Each |
| 16 // WorkerThread creates and owns an instance of WorkerIsolateWrapper. It is crea
ted and |
| 17 // destroyed in the worker thread. A WorkerIsolateWrapper instance may create an
d own its |
| 18 // own v8::Isolate (the default implementation). But it is also possible for the |
| 19 // implementation to share the v8::Isolate with other WorkerIsolateWrapper insta
nces in |
| 20 // the same thread. |
| 21 class CORE_EXPORT WorkerIsolateWrapper { |
| 22 public: |
| 23 static PassOwnPtr<WorkerIsolateWrapper> createDefault(); |
| 24 virtual ~WorkerIsolateWrapper() { } |
| 25 |
| 26 virtual v8::Isolate* isolate() const = 0; |
| 27 virtual void willDestroy() = 0; |
| 28 virtual void terminateExecution() = 0; |
| 29 |
| 30 protected: |
| 31 WorkerIsolateWrapper() { } |
| 32 }; |
| 33 |
| 34 } // namespace blink |
| 35 |
| 36 #endif // WorkerIsolateWrapper_h |
OLD | NEW |