OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 ThreadedMessagingProxyBase_h | 5 #ifndef ThreadedMessagingProxyBase_h |
6 #define ThreadedMessagingProxyBase_h | 6 #define ThreadedMessagingProxyBase_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/frame/UseCounter.h" | 9 #include "core/frame/UseCounter.h" |
10 #include "core/inspector/ConsoleTypes.h" | 10 #include "core/inspector/ConsoleTypes.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 PassRefPtr<WorkerLoaderProxy> LoaderProxy() { return loader_proxy_; } | 74 PassRefPtr<WorkerLoaderProxy> LoaderProxy() { return loader_proxy_; } |
75 WorkerInspectorProxy* GetWorkerInspectorProxy() const { | 75 WorkerInspectorProxy* GetWorkerInspectorProxy() const { |
76 return worker_inspector_proxy_.Get(); | 76 return worker_inspector_proxy_.Get(); |
77 } | 77 } |
78 | 78 |
79 // Returns true if this is called on the parent context thread. | 79 // Returns true if this is called on the parent context thread. |
80 bool IsParentContextThread() const; | 80 bool IsParentContextThread() const; |
81 | 81 |
82 // WorkerLoaderProxyProvider | 82 // WorkerLoaderProxyProvider |
83 // These methods are called on different threads to schedule loading | |
84 // requests and to send callbacks back to WorkerGlobalScope. | |
85 void PostTaskToLoader(const WebTraceLocation&, | |
86 std::unique_ptr<WTF::CrossThreadClosure>) override; | |
87 void PostTaskToWorkerGlobalScope( | |
88 const WebTraceLocation&, | |
89 std::unique_ptr<WTF::CrossThreadClosure>) override; | |
90 ThreadableLoadingContext* GetThreadableLoadingContext() override; | 83 ThreadableLoadingContext* GetThreadableLoadingContext() override; |
91 | 84 |
92 private: | 85 private: |
93 friend class InProcessWorkerMessagingProxyForTest; | 86 friend class InProcessWorkerMessagingProxyForTest; |
94 friend class ThreadedWorkletMessagingProxyForTest; | 87 friend class ThreadedWorkletMessagingProxyForTest; |
95 | 88 |
96 void ParentObjectDestroyedInternal(); | 89 void ParentObjectDestroyedInternal(); |
97 | 90 |
98 Persistent<ExecutionContext> execution_context_; | 91 Persistent<ExecutionContext> execution_context_; |
99 Persistent<ThreadableLoadingContext> loading_context_; | 92 Persistent<ThreadableLoadingContext> loading_context_; |
100 Persistent<WorkerInspectorProxy> worker_inspector_proxy_; | 93 Persistent<WorkerInspectorProxy> worker_inspector_proxy_; |
101 // Accessed cross-thread when worker thread posts tasks to the parent. | 94 // Accessed cross-thread when worker thread posts tasks to the parent. |
102 CrossThreadPersistent<ParentFrameTaskRunners> parent_frame_task_runners_; | 95 CrossThreadPersistent<ParentFrameTaskRunners> parent_frame_task_runners_; |
103 | 96 |
104 std::unique_ptr<WorkerThread> worker_thread_; | 97 std::unique_ptr<WorkerThread> worker_thread_; |
105 | 98 |
106 RefPtr<WorkerLoaderProxy> loader_proxy_; | 99 RefPtr<WorkerLoaderProxy> loader_proxy_; |
107 | 100 |
108 bool may_be_destroyed_; | 101 bool may_be_destroyed_; |
109 bool asked_to_terminate_; | 102 bool asked_to_terminate_; |
110 }; | 103 }; |
111 | 104 |
112 } // namespace blink | 105 } // namespace blink |
113 | 106 |
114 #endif // ThreadedMessagingProxyBase_h | 107 #endif // ThreadedMessagingProxyBase_h |
OLD | NEW |