Chromium Code Reviews| Index: content/browser/devtools/devtools_manager.cc |
| diff --git a/content/browser/devtools/devtools_manager.cc b/content/browser/devtools/devtools_manager.cc |
| index d4889002d9f3f70d038c46c921f289f7647d99d6..8984e47401e0e3594ae565cb7d9cc8a7d7bf223e 100644 |
| --- a/content/browser/devtools/devtools_manager.cc |
| +++ b/content/browser/devtools/devtools_manager.cc |
| @@ -5,15 +5,39 @@ |
| #include "content/browser/devtools/devtools_manager.h" |
| #include "base/bind.h" |
| +#include "base/memory/ptr_util.h" |
| #include "base/message_loop/message_loop.h" |
| #include "content/browser/devtools/devtools_agent_host_impl.h" |
| +#include "content/browser/devtools/devtools_http_handler.h" |
| #include "content/browser/loader/netlog_observer.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/content_browser_client.h" |
| +#include "content/public/browser/devtools_socket_factory.h" |
| namespace content { |
| // static |
| +void DevToolsAgentHost::StartRemoteDebuggingServer( |
| + std::unique_ptr<DevToolsSocketFactory> server_socket_factory, |
| + const std::string& frontend_url, |
| + const base::FilePath& active_port_output_directory, |
| + const base::FilePath& debug_frontend_dir, |
| + const std::string& product_name, |
| + const std::string& user_agent) { |
| + DevToolsManager* manager = DevToolsManager::GetInstance(); |
| + manager->SetHttpHandler(base::WrapUnique(new DevToolsHttpHandler( |
|
dgozman
2016/09/02 19:33:07
if (!delegate) return;
|
| + manager->delegate(), std::move(server_socket_factory), frontend_url, |
| + active_port_output_directory, debug_frontend_dir, product_name, |
| + user_agent))); |
| +} |
| + |
| +// static |
| +void DevToolsAgentHost::StopRemoteDebuggingServer() { |
| + DevToolsManager* manager = DevToolsManager::GetInstance(); |
| + manager->SetHttpHandler(nullptr); |
| +} |
| + |
| +// static |
| DevToolsManager* DevToolsManager::GetInstance() { |
| return base::Singleton<DevToolsManager>::get(); |
| } |
| @@ -49,4 +73,9 @@ void DevToolsManager::AgentHostStateChanged( |
| } |
| } |
| +void DevToolsManager::SetHttpHandler( |
| + std::unique_ptr<DevToolsHttpHandler> http_handler) { |
| + http_handler_ = std::move(http_handler); |
| +} |
| + |
| } // namespace content |