| 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 HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_CLIENT_IMPL_H_ | 5 #ifndef HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_CLIENT_IMPL_H_ |
| 6 #define HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_CLIENT_IMPL_H_ | 6 #define HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include <unordered_map> | 8 #include <unordered_map> |
| 9 | 9 |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 memory::Domain* GetMemory() override; | 86 memory::Domain* GetMemory() override; |
| 87 network::Domain* GetNetwork() override; | 87 network::Domain* GetNetwork() override; |
| 88 page::Domain* GetPage() override; | 88 page::Domain* GetPage() override; |
| 89 profiler::Domain* GetProfiler() override; | 89 profiler::Domain* GetProfiler() override; |
| 90 rendering::Domain* GetRendering() override; | 90 rendering::Domain* GetRendering() override; |
| 91 runtime::Domain* GetRuntime() override; | 91 runtime::Domain* GetRuntime() override; |
| 92 security::Domain* GetSecurity() override; | 92 security::Domain* GetSecurity() override; |
| 93 service_worker::Domain* GetServiceWorker() override; | 93 service_worker::Domain* GetServiceWorker() override; |
| 94 target::Domain* GetTarget() override; | 94 target::Domain* GetTarget() override; |
| 95 tracing::Domain* GetTracing() override; | 95 tracing::Domain* GetTracing() override; |
| 96 void SetRawProtocolListener( |
| 97 RawProtocolListener* raw_protocol_listener) override; |
| 98 void SendRawDevtoolsMessage(const std::string& json_message) override; |
| 96 | 99 |
| 97 // content::DevToolstAgentHostClient implementation: | 100 // content::DevToolstAgentHostClient implementation: |
| 98 void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host, | 101 void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host, |
| 99 const std::string& json_message) override; | 102 const std::string& json_message) override; |
| 100 void AgentHostClosed(content::DevToolsAgentHost* agent_host, | 103 void AgentHostClosed(content::DevToolsAgentHost* agent_host, |
| 101 bool replaced_with_another_client) override; | 104 bool replaced_with_another_client) override; |
| 102 | 105 |
| 103 // internal::MessageDispatcher implementation: | 106 // internal::MessageDispatcher implementation: |
| 104 void SendMessage(const char* method, | 107 void SendMessage(const char* method, |
| 105 std::unique_ptr<base::Value> params, | 108 std::unique_ptr<base::Value> params, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 147 |
| 145 using EventHandler = base::Callback<void(const base::Value&)>; | 148 using EventHandler = base::Callback<void(const base::Value&)>; |
| 146 using EventHandlerMap = std::unordered_map<std::string, EventHandler>; | 149 using EventHandlerMap = std::unordered_map<std::string, EventHandler>; |
| 147 | 150 |
| 148 bool DispatchEvent(std::unique_ptr<base::Value> owning_message, | 151 bool DispatchEvent(std::unique_ptr<base::Value> owning_message, |
| 149 const base::DictionaryValue& message_dict); | 152 const base::DictionaryValue& message_dict); |
| 150 void DispatchEventTask(std::unique_ptr<base::Value> owning_message, | 153 void DispatchEventTask(std::unique_ptr<base::Value> owning_message, |
| 151 const EventHandler* event_handler, | 154 const EventHandler* event_handler, |
| 152 const base::DictionaryValue* result_dict); | 155 const base::DictionaryValue* result_dict); |
| 153 | 156 |
| 154 content::DevToolsAgentHost* agent_host_; // Not owned. | 157 content::DevToolsAgentHost* agent_host_; // Not owned. |
| 158 RawProtocolListener* raw_protocol_listener_; // Not owned. |
| 155 int next_message_id_; | 159 int next_message_id_; |
| 156 std::unordered_map<int, Callback> pending_messages_; | 160 std::unordered_map<int, Callback> pending_messages_; |
| 157 | 161 |
| 158 EventHandlerMap event_handlers_; | 162 EventHandlerMap event_handlers_; |
| 159 | 163 |
| 160 bool renderer_crashed_; | 164 bool renderer_crashed_; |
| 161 | 165 |
| 162 accessibility::ExperimentalDomain accessibility_domain_; | 166 accessibility::ExperimentalDomain accessibility_domain_; |
| 163 animation::ExperimentalDomain animation_domain_; | 167 animation::ExperimentalDomain animation_domain_; |
| 164 application_cache::ExperimentalDomain application_cache_domain_; | 168 application_cache::ExperimentalDomain application_cache_domain_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 191 tracing::ExperimentalDomain tracing_domain_; | 195 tracing::ExperimentalDomain tracing_domain_; |
| 192 scoped_refptr<base::SingleThreadTaskRunner> browser_main_thread_; | 196 scoped_refptr<base::SingleThreadTaskRunner> browser_main_thread_; |
| 193 base::WeakPtrFactory<HeadlessDevToolsClientImpl> weak_ptr_factory_; | 197 base::WeakPtrFactory<HeadlessDevToolsClientImpl> weak_ptr_factory_; |
| 194 | 198 |
| 195 DISALLOW_COPY_AND_ASSIGN(HeadlessDevToolsClientImpl); | 199 DISALLOW_COPY_AND_ASSIGN(HeadlessDevToolsClientImpl); |
| 196 }; | 200 }; |
| 197 | 201 |
| 198 } // namespace headless | 202 } // namespace headless |
| 199 | 203 |
| 200 #endif // HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_CLIENT_IMPL_H_ | 204 #endif // HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_CLIENT_IMPL_H_ |
| OLD | NEW |