| 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 int GetNextRawDevToolsMessageId() override; |
| 99 void SendRawDevToolsMessage(const std::string& json_message) override; |
| 100 void SendRawDevToolsMessage(const base::DictionaryValue& message) override; |
| 96 | 101 |
| 97 // content::DevToolstAgentHostClient implementation: | 102 // content::DevToolstAgentHostClient implementation: |
| 98 void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host, | 103 void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host, |
| 99 const std::string& json_message) override; | 104 const std::string& json_message) override; |
| 100 void AgentHostClosed(content::DevToolsAgentHost* agent_host, | 105 void AgentHostClosed(content::DevToolsAgentHost* agent_host, |
| 101 bool replaced_with_another_client) override; | 106 bool replaced_with_another_client) override; |
| 102 | 107 |
| 103 // internal::MessageDispatcher implementation: | 108 // internal::MessageDispatcher implementation: |
| 104 void SendMessage(const char* method, | 109 void SendMessage(const char* method, |
| 105 std::unique_ptr<base::Value> params, | 110 std::unique_ptr<base::Value> params, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 149 |
| 145 using EventHandler = base::Callback<void(const base::Value&)>; | 150 using EventHandler = base::Callback<void(const base::Value&)>; |
| 146 using EventHandlerMap = std::unordered_map<std::string, EventHandler>; | 151 using EventHandlerMap = std::unordered_map<std::string, EventHandler>; |
| 147 | 152 |
| 148 bool DispatchEvent(std::unique_ptr<base::Value> owning_message, | 153 bool DispatchEvent(std::unique_ptr<base::Value> owning_message, |
| 149 const base::DictionaryValue& message_dict); | 154 const base::DictionaryValue& message_dict); |
| 150 void DispatchEventTask(std::unique_ptr<base::Value> owning_message, | 155 void DispatchEventTask(std::unique_ptr<base::Value> owning_message, |
| 151 const EventHandler* event_handler, | 156 const EventHandler* event_handler, |
| 152 const base::DictionaryValue* result_dict); | 157 const base::DictionaryValue* result_dict); |
| 153 | 158 |
| 154 content::DevToolsAgentHost* agent_host_; // Not owned. | 159 content::DevToolsAgentHost* agent_host_; // Not owned. |
| 160 RawProtocolListener* raw_protocol_listener_; // Not owned. |
| 155 int next_message_id_; | 161 int next_message_id_; |
| 162 int next_raw_message_id_; |
| 156 std::unordered_map<int, Callback> pending_messages_; | 163 std::unordered_map<int, Callback> pending_messages_; |
| 157 | 164 |
| 158 EventHandlerMap event_handlers_; | 165 EventHandlerMap event_handlers_; |
| 159 | 166 |
| 160 bool renderer_crashed_; | 167 bool renderer_crashed_; |
| 161 | 168 |
| 162 accessibility::ExperimentalDomain accessibility_domain_; | 169 accessibility::ExperimentalDomain accessibility_domain_; |
| 163 animation::ExperimentalDomain animation_domain_; | 170 animation::ExperimentalDomain animation_domain_; |
| 164 application_cache::ExperimentalDomain application_cache_domain_; | 171 application_cache::ExperimentalDomain application_cache_domain_; |
| 165 cache_storage::ExperimentalDomain cache_storage_domain_; | 172 cache_storage::ExperimentalDomain cache_storage_domain_; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 191 tracing::ExperimentalDomain tracing_domain_; | 198 tracing::ExperimentalDomain tracing_domain_; |
| 192 scoped_refptr<base::SingleThreadTaskRunner> browser_main_thread_; | 199 scoped_refptr<base::SingleThreadTaskRunner> browser_main_thread_; |
| 193 base::WeakPtrFactory<HeadlessDevToolsClientImpl> weak_ptr_factory_; | 200 base::WeakPtrFactory<HeadlessDevToolsClientImpl> weak_ptr_factory_; |
| 194 | 201 |
| 195 DISALLOW_COPY_AND_ASSIGN(HeadlessDevToolsClientImpl); | 202 DISALLOW_COPY_AND_ASSIGN(HeadlessDevToolsClientImpl); |
| 196 }; | 203 }; |
| 197 | 204 |
| 198 } // namespace headless | 205 } // namespace headless |
| 199 | 206 |
| 200 #endif // HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_CLIENT_IMPL_H_ | 207 #endif // HEADLESS_LIB_BROWSER_HEADLESS_DEVTOOLS_CLIENT_IMPL_H_ |
| OLD | NEW |