OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ThreadedWorkletObjectProxy_h | |
6 #define ThreadedWorkletObjectProxy_h | |
7 | |
8 #include "bindings/core/v8/SourceLocation.h" | |
9 #include "core/CoreExport.h" | |
10 #include "core/dom/MessagePort.h" | |
11 #include "core/workers/WorkerReportingProxy.h" | |
12 #include "platform/Timer.h" | |
13 #include "platform/heap/Handle.h" | |
14 #include "wtf/PassRefPtr.h" | |
majidvp
2016/09/14 20:06:31
nit: Timer.h, Handle.h and PassRefPtr.h are unused
ikilpatrick
2016/09/14 21:54:51
Done.
| |
15 | |
16 namespace blink { | |
17 | |
18 class ConsoleMessage; | |
19 class ExecutionContext; | |
20 class ExecutionContextTask; | |
21 class ThreadedWorkletMessagingProxy; | |
22 class WorkerOrWorkletGlobalScope; | |
majidvp
2016/09/14 20:06:31
nit: unused.
ikilpatrick
2016/09/14 21:54:51
Done.
| |
23 | |
24 // A proxy to talk to the parent worklet object. This object is created on the | |
25 // main thread, passed on to the worklet thread, and used just to proxy | |
26 // messages to the ThreadedWorkletMessagingProxy on the main thread. | |
27 class CORE_EXPORT ThreadedWorkletObjectProxy : public WorkerReportingProxy { | |
28 USING_FAST_MALLOC(ThreadedWorkletObjectProxy); | |
29 WTF_MAKE_NONCOPYABLE(ThreadedWorkletObjectProxy); | |
30 | |
31 public: | |
32 static std::unique_ptr<ThreadedWorkletObjectProxy> create(ThreadedWorkletMes sagingProxy*); | |
33 ~ThreadedWorkletObjectProxy() override {} | |
34 | |
35 void postTaskToMainExecutionContext(std::unique_ptr<ExecutionContextTask>); | |
36 void reportPendingActivity(bool hasPendingActivity); | |
37 | |
38 // WorkerReportingProxy overrides. | |
39 void reportException(const String& errorMessage, std::unique_ptr<SourceLocat ion>, int exceptionId) override {} | |
40 void reportConsoleMessage(MessageSource, MessageLevel, const String& message , SourceLocation*) override; | |
41 void postMessageToPageInspector(const String&) override; | |
42 void didEvaluateWorkerScript(bool success) override {} | |
43 void didCloseWorkerGlobalScope() override; | |
44 void willDestroyWorkerGlobalScope() override {} | |
45 void didTerminateWorkerThread() override; | |
46 | |
47 protected: | |
48 ThreadedWorkletObjectProxy(ThreadedWorkletMessagingProxy*); | |
49 | |
50 private: | |
51 ExecutionContext* getExecutionContext() const; | |
52 | |
53 // This object always outlives this proxy. | |
54 ThreadedWorkletMessagingProxy* m_messagingProxy; | |
55 }; | |
56 | |
57 } // namespace blink | |
58 | |
59 #endif // ThreadedWorkletObjectProxy_h | |
OLD | NEW |