| 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 CONTENT_BROWSER_DEVTOOLS_WORKER_DEVTOOLS_AGENT_HOST_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_WORKER_DEVTOOLS_AGENT_HOST_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_WORKER_DEVTOOLS_AGENT_HOST_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_WORKER_DEVTOOLS_AGENT_HOST_H_ |
| 7 | 7 |
| 8 #include "content/browser/devtools/ipc_devtools_agent_host.h" | 8 #include "content/browser/devtools/ipc_devtools_agent_host.h" |
| 9 #include "ipc/ipc_listener.h" | 9 #include "ipc/ipc_listener.h" |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 // IPCDevToolsAgentHost implementation. | 25 // IPCDevToolsAgentHost implementation. |
| 26 void SendMessageToAgent(IPC::Message* message) override; | 26 void SendMessageToAgent(IPC::Message* message) override; |
| 27 void Attach() override; | 27 void Attach() override; |
| 28 void OnClientAttached() override; | 28 void OnClientAttached() override; |
| 29 void OnClientDetached() override; | 29 void OnClientDetached() override; |
| 30 | 30 |
| 31 // IPC::Listener implementation. | 31 // IPC::Listener implementation. |
| 32 bool OnMessageReceived(const IPC::Message& msg) override; | 32 bool OnMessageReceived(const IPC::Message& msg) override; |
| 33 | 33 |
| 34 void PauseForDebugOnStart(); |
| 35 bool IsPausedForDebugOnStart(); |
| 36 |
| 34 void WorkerReadyForInspection(); | 37 void WorkerReadyForInspection(); |
| 35 void WorkerRestarted(WorkerId worker_id); | 38 void WorkerRestarted(WorkerId worker_id); |
| 36 void WorkerDestroyed(); | 39 void WorkerDestroyed(); |
| 37 bool IsTerminated(); | 40 bool IsTerminated(); |
| 38 | 41 |
| 39 protected: | 42 protected: |
| 40 WorkerDevToolsAgentHost(WorkerId worker_id); | 43 WorkerDevToolsAgentHost(WorkerId worker_id); |
| 41 ~WorkerDevToolsAgentHost() override; | 44 ~WorkerDevToolsAgentHost() override; |
| 42 | 45 |
| 43 enum WorkerState { | 46 enum WorkerState { |
| 44 WORKER_UNINSPECTED, | 47 WORKER_UNINSPECTED, |
| 45 WORKER_INSPECTED, | 48 WORKER_INSPECTED, |
| 46 WORKER_TERMINATED, | 49 WORKER_TERMINATED, |
| 47 WORKER_PAUSED_FOR_DEBUG_ON_START, | 50 WORKER_PAUSED_FOR_DEBUG_ON_START, |
| 48 WORKER_PAUSED_FOR_REATTACH, | 51 WORKER_PAUSED_FOR_REATTACH, |
| 49 }; | 52 }; |
| 50 | 53 |
| 51 void AttachToWorker(); | 54 void AttachToWorker(); |
| 52 void DetachFromWorker(); | 55 void DetachFromWorker(); |
| 53 void WorkerCreated(); | 56 void WorkerCreated(); |
| 54 void OnDispatchOnInspectorFrontend(const DevToolsMessageChunk& message); | 57 void OnDispatchOnInspectorFrontend(const DevToolsMessageChunk& message); |
| 55 | 58 |
| 56 void set_state(WorkerState state) { state_ = state; } | |
| 57 const WorkerId& worker_id() const { return worker_id_; } | 59 const WorkerId& worker_id() const { return worker_id_; } |
| 58 | 60 |
| 59 private: | 61 private: |
| 60 friend class SharedWorkerDevToolsManagerTest; | 62 friend class SharedWorkerDevToolsManagerTest; |
| 61 | 63 |
| 62 WorkerState state_; | 64 WorkerState state_; |
| 63 WorkerId worker_id_; | 65 WorkerId worker_id_; |
| 64 DISALLOW_COPY_AND_ASSIGN(WorkerDevToolsAgentHost); | 66 DISALLOW_COPY_AND_ASSIGN(WorkerDevToolsAgentHost); |
| 65 }; | 67 }; |
| 66 | 68 |
| 67 } // namespace content | 69 } // namespace content |
| 68 | 70 |
| 69 #endif // CONTENT_BROWSER_DEVTOOLS_WORKER_DEVTOOLS_AGENT_HOST_H_ | 71 #endif // CONTENT_BROWSER_DEVTOOLS_WORKER_DEVTOOLS_AGENT_HOST_H_ |
| OLD | NEW |