| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 WorkerInspectorProxy_h | 5 #ifndef WorkerInspectorProxy_h |
| 6 #define WorkerInspectorProxy_h | 6 #define WorkerInspectorProxy_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "platform/heap/Handle.h" |
| 9 #include "public/platform/WebThread.h" | 10 #include "public/platform/WebThread.h" |
| 10 #include "wtf/Forward.h" | 11 #include "wtf/Forward.h" |
| 11 | 12 |
| 12 namespace blink { | 13 namespace blink { |
| 13 | 14 |
| 14 class ExecutionContext; | 15 class ExecutionContext; |
| 15 class KURL; | 16 class KURL; |
| 16 class WebTraceLocation; | 17 class WebTraceLocation; |
| 17 class WorkerGlobalScopeProxy; | 18 class WorkerGlobalScopeProxy; |
| 18 class WorkerThread; | 19 class WorkerThread; |
| 19 | 20 |
| 20 // A proxy for talking to the worker inspector on the worker thread. | 21 // A proxy for talking to the worker inspector on the worker thread. |
| 21 // All of these methods should be called on the main thread. | 22 // All of these methods should be called on the main thread. |
| 22 class CORE_EXPORT WorkerInspectorProxy final { | 23 class CORE_EXPORT WorkerInspectorProxy final : public NoBaseWillBeGarbageCollect
edFinalized<WorkerInspectorProxy> { |
| 23 WTF_MAKE_FAST_ALLOCATED(WorkerInspectorProxy); | 24 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(WorkerInspectorProxy); |
| 24 public: | 25 public: |
| 25 static PassOwnPtr<WorkerInspectorProxy> create(); | 26 static PassOwnPtrWillBeRawPtr<WorkerInspectorProxy> create(); |
| 26 | 27 |
| 27 ~WorkerInspectorProxy(); | 28 ~WorkerInspectorProxy(); |
| 29 DECLARE_TRACE(); |
| 28 | 30 |
| 29 class PageInspector { | 31 class PageInspector : public NoBaseWillBeGarbageCollectedFinalized<PageInspe
ctor> { |
| 30 public: | 32 public: |
| 31 virtual ~PageInspector() { } | 33 virtual ~PageInspector() { } |
| 32 virtual void dispatchMessageFromWorker(const String&) = 0; | 34 virtual void dispatchMessageFromWorker(const String&) = 0; |
| 33 virtual void workerConsoleAgentEnabled(WorkerGlobalScopeProxy*) = 0; | 35 virtual void workerConsoleAgentEnabled(WorkerGlobalScopeProxy*) = 0; |
| 36 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 34 }; | 37 }; |
| 35 | 38 |
| 36 void workerThreadCreated(ExecutionContext*, WorkerThread*, const KURL&); | 39 void workerThreadCreated(ExecutionContext*, WorkerThread*, const KURL&); |
| 37 void workerThreadTerminated(); | 40 void workerThreadTerminated(); |
| 38 | 41 |
| 39 void connectToInspector(PageInspector*); | 42 void connectToInspector(PageInspector*); |
| 40 void disconnectFromInspector(); | 43 void disconnectFromInspector(); |
| 41 void sendMessageToInspector(const String&); | 44 void sendMessageToInspector(const String&); |
| 42 void writeTimelineStartedEvent(const String& sessionId, const String& worker
Id); | 45 void writeTimelineStartedEvent(const String& sessionId, const String& worker
Id); |
| 43 | 46 |
| 44 PageInspector* pageInspector() const { return m_pageInspector; } | 47 PageInspector* pageInspector() const { return m_pageInspector; } |
| 45 | 48 |
| 46 void setWorkerGlobalScopeProxy(WorkerGlobalScopeProxy* proxy) { m_workerGlob
alScopeProxy = proxy; } | 49 void setWorkerGlobalScopeProxy(WorkerGlobalScopeProxy* proxy) { m_workerGlob
alScopeProxy = proxy; } |
| 47 WorkerGlobalScopeProxy* workerGlobalScopeProxy() const { return m_workerGlob
alScopeProxy; } | 50 WorkerGlobalScopeProxy* workerGlobalScopeProxy() const { return m_workerGlob
alScopeProxy; } |
| 48 | 51 |
| 49 private: | 52 private: |
| 50 WorkerInspectorProxy(); | 53 WorkerInspectorProxy(); |
| 51 | 54 |
| 52 void addDebuggerTaskForWorker(const WebTraceLocation&, PassOwnPtr<WebThread:
:Task>); | 55 void addDebuggerTaskForWorker(const WebTraceLocation&, PassOwnPtr<WebThread:
:Task>); |
| 53 | 56 |
| 54 WorkerThread* m_workerThread; | 57 WorkerThread* m_workerThread; |
| 55 ExecutionContext* m_executionContext; | 58 RawPtrWillBeMember<ExecutionContext> m_executionContext; |
| 56 WorkerInspectorProxy::PageInspector* m_pageInspector; | 59 RawPtrWillBeMember<WorkerInspectorProxy::PageInspector> m_pageInspector; |
| 57 WorkerGlobalScopeProxy* m_workerGlobalScopeProxy; | 60 WorkerGlobalScopeProxy* m_workerGlobalScopeProxy; |
| 58 }; | 61 }; |
| 59 | 62 |
| 60 } // namespace blink | 63 } // namespace blink |
| 61 | 64 |
| 62 #endif // WorkerInspectorProxy_h | 65 #endif // WorkerInspectorProxy_h |
| OLD | NEW |