| 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 "base/containers/flat_map.h" |
| 8 #include "base/macros.h" | 9 #include "base/macros.h" |
| 9 #include "content/browser/devtools/devtools_agent_host_impl.h" | 10 #include "content/browser/devtools/devtools_agent_host_impl.h" |
| 10 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 11 #include "ipc/ipc_listener.h" | 12 #include "ipc/ipc_listener.h" |
| 12 | 13 |
| 13 namespace content { | 14 namespace content { |
| 14 | 15 |
| 15 class BrowserContext; | 16 class BrowserContext; |
| 16 | 17 |
| 17 class CONTENT_EXPORT WorkerDevToolsAgentHost : public DevToolsAgentHostImpl, | 18 class CONTENT_EXPORT WorkerDevToolsAgentHost : public DevToolsAgentHostImpl, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 virtual void OnAttachedStateChanged(bool attached); | 58 virtual void OnAttachedStateChanged(bool attached); |
| 58 const WorkerId& worker_id() const { return worker_id_; } | 59 const WorkerId& worker_id() const { return worker_id_; } |
| 59 | 60 |
| 60 private: | 61 private: |
| 61 friend class SharedWorkerDevToolsManagerTest; | 62 friend class SharedWorkerDevToolsManagerTest; |
| 62 | 63 |
| 63 void AttachToWorker(); | 64 void AttachToWorker(); |
| 64 void DetachFromWorker(); | 65 void DetachFromWorker(); |
| 65 void WorkerCreated(); | 66 void WorkerCreated(); |
| 66 void OnDispatchOnInspectorFrontend(const DevToolsMessageChunk& message); | 67 void OnDispatchOnInspectorFrontend(const DevToolsMessageChunk& message); |
| 68 void SendChunkedMessage(int session_id, const std::string& message); |
| 67 | 69 |
| 68 DevToolsMessageChunkProcessor chunk_processor_; | 70 base::flat_map<int, std::unique_ptr<DevToolsMessageChunkProcessor>> |
| 71 chunk_processors_; |
| 69 WorkerState state_; | 72 WorkerState state_; |
| 70 WorkerId worker_id_; | 73 WorkerId worker_id_; |
| 71 DISALLOW_COPY_AND_ASSIGN(WorkerDevToolsAgentHost); | 74 DISALLOW_COPY_AND_ASSIGN(WorkerDevToolsAgentHost); |
| 72 }; | 75 }; |
| 73 | 76 |
| 74 } // namespace content | 77 } // namespace content |
| 75 | 78 |
| 76 #endif // CONTENT_BROWSER_DEVTOOLS_WORKER_DEVTOOLS_AGENT_HOST_H_ | 79 #endif // CONTENT_BROWSER_DEVTOOLS_WORKER_DEVTOOLS_AGENT_HOST_H_ |
| OLD | NEW |