| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_PROTOCOL_TARGET_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TARGET_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TARGET_HANDLER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TARGET_HANDLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 void SetRenderFrameHost(RenderFrameHostImpl* render_frame_host); | 30 void SetRenderFrameHost(RenderFrameHostImpl* render_frame_host); |
| 31 void SetClient(std::unique_ptr<Client> client); | 31 void SetClient(std::unique_ptr<Client> client); |
| 32 void Detached(); | 32 void Detached(); |
| 33 | 33 |
| 34 void UpdateServiceWorkers(); | 34 void UpdateServiceWorkers(); |
| 35 void UpdateFrames(); | 35 void UpdateFrames(); |
| 36 | 36 |
| 37 // Domain implementation. | 37 // Domain implementation. |
| 38 Response Enable(); | 38 Response Enable(); |
| 39 Response Disable(); | 39 Response Disable(); |
| 40 Response SetWaitForDebuggerOnStart(bool value); | 40 Response SetAutoAttach(bool auto_attach, bool wait_for_debugger_on_start); |
| 41 Response SetAttachToFrames(bool value); | 41 Response SetAttachToFrames(bool value); |
| 42 Response SendMessageToTarget(const std::string& target_id, | 42 Response SendMessageToTarget(const std::string& target_id, |
| 43 const std::string& message); | 43 const std::string& message); |
| 44 Response GetTargetInfo(const std::string& target_id, | 44 Response GetTargetInfo(const std::string& target_id, |
| 45 scoped_refptr<TargetInfo>* target_info); | 45 scoped_refptr<TargetInfo>* target_info); |
| 46 Response ActivateTarget(const std::string& target_id); | 46 Response ActivateTarget(const std::string& target_id); |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 using HostsMap = std::map<std::string, scoped_refptr<DevToolsAgentHost>>; | 49 using HostsMap = std::map<std::string, scoped_refptr<DevToolsAgentHost>>; |
| 50 | 50 |
| 51 void UpdateServiceWorkers(bool waiting_for_debugger); | 51 void UpdateServiceWorkers(bool waiting_for_debugger); |
| 52 void ReattachTargetsOfType(const HostsMap& new_hosts, | 52 void ReattachTargetsOfType(const HostsMap& new_hosts, |
| 53 const std::string& type, | 53 const std::string& type, |
| 54 bool waiting_for_debugger); | 54 bool waiting_for_debugger); |
| 55 void TargetCreatedInternal(DevToolsAgentHost* host); |
| 56 void TargetRemovedInternal(DevToolsAgentHost* host); |
| 55 void AttachToTargetInternal(DevToolsAgentHost* host, | 57 void AttachToTargetInternal(DevToolsAgentHost* host, |
| 56 bool waiting_for_debugger); | 58 bool waiting_for_debugger); |
| 57 void DetachFromTargetInternal(DevToolsAgentHost* host); | 59 void DetachFromTargetInternal(DevToolsAgentHost* host); |
| 58 | 60 |
| 59 // ServiceWorkerDevToolsManager::Observer implementation. | 61 // ServiceWorkerDevToolsManager::Observer implementation. |
| 60 void WorkerCreated(ServiceWorkerDevToolsAgentHost* host) override; | 62 void WorkerCreated(ServiceWorkerDevToolsAgentHost* host) override; |
| 61 void WorkerReadyForInspection(ServiceWorkerDevToolsAgentHost* host) override; | 63 void WorkerReadyForInspection(ServiceWorkerDevToolsAgentHost* host) override; |
| 62 void WorkerVersionInstalled(ServiceWorkerDevToolsAgentHost* host) override; | 64 void WorkerVersionInstalled(ServiceWorkerDevToolsAgentHost* host) override; |
| 63 void WorkerVersionDoomed(ServiceWorkerDevToolsAgentHost* host) override; | 65 void WorkerVersionDoomed(ServiceWorkerDevToolsAgentHost* host) override; |
| 64 void WorkerDestroyed(ServiceWorkerDevToolsAgentHost* host) override; | 66 void WorkerDestroyed(ServiceWorkerDevToolsAgentHost* host) override; |
| 65 | 67 |
| 66 // DevToolsAgentHostClient implementation. | 68 // DevToolsAgentHostClient implementation. |
| 67 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, | 69 void DispatchProtocolMessage(DevToolsAgentHost* agent_host, |
| 68 const std::string& message) override; | 70 const std::string& message) override; |
| 69 void AgentHostClosed(DevToolsAgentHost* agent_host, | 71 void AgentHostClosed(DevToolsAgentHost* agent_host, |
| 70 bool replaced_with_another_client) override; | 72 bool replaced_with_another_client) override; |
| 71 | 73 |
| 72 std::unique_ptr<Client> client_; | 74 std::unique_ptr<Client> client_; |
| 73 bool enabled_; | 75 bool enabled_; |
| 76 bool auto_attach_; |
| 74 bool wait_for_debugger_on_start_; | 77 bool wait_for_debugger_on_start_; |
| 75 bool attach_to_frames_; | 78 bool attach_to_frames_; |
| 76 RenderFrameHostImpl* render_frame_host_; | 79 RenderFrameHostImpl* render_frame_host_; |
| 77 HostsMap attached_hosts_; | 80 HostsMap attached_hosts_; |
| 78 std::set<GURL> frame_urls_; | 81 std::set<GURL> frame_urls_; |
| 79 | 82 |
| 80 DISALLOW_COPY_AND_ASSIGN(TargetHandler); | 83 DISALLOW_COPY_AND_ASSIGN(TargetHandler); |
| 81 }; | 84 }; |
| 82 | 85 |
| 83 } // namespace target | 86 } // namespace target |
| 84 } // namespace devtools | 87 } // namespace devtools |
| 85 } // namespace content | 88 } // namespace content |
| 86 | 89 |
| 87 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TARGET_HANDLER_H_ | 90 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TARGET_HANDLER_H_ |
| OLD | NEW |