| 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 "wtf/Forward.h" | 9 #include "wtf/Forward.h" | 
| 10 | 10 | 
| 11 namespace blink { | 11 namespace blink { | 
| 12 | 12 | 
| 13 class ExecutionContext; | 13 class ExecutionContext; | 
| 14 class KURL; | 14 class KURL; | 
| 15 class WorkerGlobalScopeProxy; | 15 class WorkerGlobalScopeProxy; | 
| 16 class WorkerThread; | 16 class WorkerScript; | 
| 17 | 17 | 
| 18 // A proxy for talking to the worker inspector on the worker thread. | 18 // A proxy for talking to the worker inspector on the worker thread. | 
| 19 // All of these methods should be called on the main thread. | 19 // All of these methods should be called on the main thread. | 
| 20 class CORE_EXPORT WorkerInspectorProxy final { | 20 class CORE_EXPORT WorkerInspectorProxy final { | 
| 21 public: | 21 public: | 
| 22     static PassOwnPtr<WorkerInspectorProxy> create(); | 22     static PassOwnPtr<WorkerInspectorProxy> create(); | 
| 23 | 23 | 
| 24     ~WorkerInspectorProxy(); | 24     ~WorkerInspectorProxy(); | 
| 25 | 25 | 
| 26     class PageInspector { | 26     class PageInspector { | 
| 27     public: | 27     public: | 
| 28         virtual ~PageInspector() { } | 28         virtual ~PageInspector() { } | 
| 29         virtual void dispatchMessageFromWorker(const String&) = 0; | 29         virtual void dispatchMessageFromWorker(const String&) = 0; | 
| 30         virtual void workerConsoleAgentEnabled(WorkerGlobalScopeProxy*) = 0; | 30         virtual void workerConsoleAgentEnabled(WorkerGlobalScopeProxy*) = 0; | 
| 31     }; | 31     }; | 
| 32 | 32 | 
| 33     void workerThreadCreated(ExecutionContext*, WorkerThread*, const KURL&); | 33     void workerScriptCreated(ExecutionContext*, WorkerScript*, const KURL&); | 
| 34     void workerThreadTerminated(); | 34     void workerScriptTerminated(); | 
| 35 | 35 | 
| 36     void connectToInspector(PageInspector*); | 36     void connectToInspector(PageInspector*); | 
| 37     void disconnectFromInspector(); | 37     void disconnectFromInspector(); | 
| 38     void sendMessageToInspector(const String&); | 38     void sendMessageToInspector(const String&); | 
| 39     void writeTimelineStartedEvent(const String& sessionId, const String& worker
    Id); | 39     void writeTimelineStartedEvent(const String& sessionId, const String& worker
    Id); | 
| 40 | 40 | 
| 41     PageInspector* pageInspector() const { return m_pageInspector; } | 41     PageInspector* pageInspector() const { return m_pageInspector; } | 
| 42 | 42 | 
| 43     void setWorkerGlobalScopeProxy(WorkerGlobalScopeProxy* proxy) { m_workerGlob
    alScopeProxy = proxy; } | 43     void setWorkerGlobalScopeProxy(WorkerGlobalScopeProxy* proxy) { m_workerGlob
    alScopeProxy = proxy; } | 
| 44     WorkerGlobalScopeProxy* workerGlobalScopeProxy() const { return m_workerGlob
    alScopeProxy; } | 44     WorkerGlobalScopeProxy* workerGlobalScopeProxy() const { return m_workerGlob
    alScopeProxy; } | 
| 45 | 45 | 
| 46 private: | 46 private: | 
| 47     WorkerInspectorProxy(); | 47     WorkerInspectorProxy(); | 
| 48 | 48 | 
| 49     WorkerThread* m_workerThread; | 49     WorkerScript* m_workerScript; | 
| 50     ExecutionContext* m_executionContext; | 50     ExecutionContext* m_executionContext; | 
| 51     WorkerInspectorProxy::PageInspector* m_pageInspector; | 51     WorkerInspectorProxy::PageInspector* m_pageInspector; | 
| 52     WorkerGlobalScopeProxy* m_workerGlobalScopeProxy; | 52     WorkerGlobalScopeProxy* m_workerGlobalScopeProxy; | 
| 53 }; | 53 }; | 
| 54 | 54 | 
| 55 } // namespace blink | 55 } // namespace blink | 
| 56 | 56 | 
| 57 #endif // WorkerInspectorProxy_h | 57 #endif // WorkerInspectorProxy_h | 
| OLD | NEW | 
|---|