OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef InProcessWorkerBase_h | 5 #ifndef InProcessWorkerBase_h |
6 #define InProcessWorkerBase_h | 6 #define InProcessWorkerBase_h |
7 | 7 |
8 #include "bindings/core/v8/ActiveScriptWrappable.h" | 8 #include "bindings/core/v8/ActiveScriptWrappable.h" |
9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
10 #include "core/dom/MessagePort.h" | 10 #include "core/dom/MessagePort.h" |
11 #include "core/dom/SuspendableObject.h" | 11 #include "core/dom/SuspendableObject.h" |
12 #include "core/events/EventListener.h" | 12 #include "core/events/EventListener.h" |
13 #include "core/events/EventTarget.h" | 13 #include "core/events/EventTarget.h" |
14 #include "core/workers/AbstractWorker.h" | 14 #include "core/workers/AbstractWorker.h" |
15 #include "wtf/Forward.h" | 15 #include "wtf/Forward.h" |
16 #include "wtf/PassRefPtr.h" | 16 #include "wtf/PassRefPtr.h" |
17 #include "wtf/RefPtr.h" | 17 #include "wtf/RefPtr.h" |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 | 20 |
21 class ExceptionState; | 21 class ExceptionState; |
22 class ExecutionContext; | 22 class ExecutionContext; |
23 class InProcessWorkerMessagingProxy; | 23 class InProcessWorkerMessagingProxy; |
24 class WorkerScriptLoader; | 24 class WorkerScriptLoader; |
25 | 25 |
26 // Base class for workers that operate in the same process as the document that | 26 // Base class for workers that operate in the same process as the document that |
27 // creates them. | 27 // creates them. |
28 class CORE_EXPORT InProcessWorkerBase : public AbstractWorker, | 28 class CORE_EXPORT InProcessWorkerBase |
29 public ActiveScriptWrappable { | 29 : public AbstractWorker, |
| 30 public ActiveScriptWrappable<InProcessWorkerBase> { |
30 public: | 31 public: |
31 ~InProcessWorkerBase() override; | 32 ~InProcessWorkerBase() override; |
32 | 33 |
33 void postMessage(ExecutionContext*, | 34 void postMessage(ExecutionContext*, |
34 PassRefPtr<SerializedScriptValue> message, | 35 PassRefPtr<SerializedScriptValue> message, |
35 const MessagePortArray&, | 36 const MessagePortArray&, |
36 ExceptionState&); | 37 ExceptionState&); |
37 static bool canTransferArrayBuffersAndImageBitmaps() { return true; } | 38 static bool canTransferArrayBuffersAndImageBitmaps() { return true; } |
38 void terminate(); | 39 void terminate(); |
39 | 40 |
(...skipping 25 matching lines...) Expand all Loading... |
65 | 66 |
66 RefPtr<WorkerScriptLoader> m_scriptLoader; | 67 RefPtr<WorkerScriptLoader> m_scriptLoader; |
67 | 68 |
68 // The proxy outlives the worker to perform thread shutdown. | 69 // The proxy outlives the worker to perform thread shutdown. |
69 InProcessWorkerMessagingProxy* m_contextProxy; | 70 InProcessWorkerMessagingProxy* m_contextProxy; |
70 }; | 71 }; |
71 | 72 |
72 } // namespace blink | 73 } // namespace blink |
73 | 74 |
74 #endif // InProcessWorkerBase_h | 75 #endif // InProcessWorkerBase_h |
OLD | NEW |