| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "headless/lib/browser/headless_devtools.h" | 5 #include "headless/lib/browser/headless_devtools.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 return nullptr; | 49 return nullptr; |
| 50 } | 50 } |
| 51 | 51 |
| 52 net::IPEndPoint endpoint_; | 52 net::IPEndPoint endpoint_; |
| 53 | 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory); | 54 DISALLOW_COPY_AND_ASSIGN(TCPServerSocketFactory); |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace | 57 } // namespace |
| 58 | 58 |
| 59 void StartLocalDevToolsHttpHandler( | 59 void StartLocalDevToolsHttpHandler(HeadlessBrowser::Options* options) { |
| 60 HeadlessBrowser::Options* options) { | |
| 61 const net::IPEndPoint& endpoint = options->devtools_endpoint; | 60 const net::IPEndPoint& endpoint = options->devtools_endpoint; |
| 62 std::unique_ptr<content::DevToolsSocketFactory> socket_factory( | 61 std::unique_ptr<content::DevToolsSocketFactory> socket_factory( |
| 63 new TCPServerSocketFactory(endpoint)); | 62 new TCPServerSocketFactory(endpoint)); |
| 64 content::DevToolsAgentHost::StartRemoteDebuggingServer( | 63 content::DevToolsAgentHost::StartRemoteDebuggingServer( |
| 65 std::move(socket_factory), std::string(), | 64 std::move(socket_factory), std::string(), |
| 66 options->user_data_dir, // TODO(altimin): Figure a proper value for this. | 65 options->user_data_dir, // TODO(altimin): Figure a proper value for this. |
| 67 base::FilePath(), std::string(), options->user_agent); | 66 base::FilePath(), options->product_name_and_version, options->user_agent); |
| 68 } | 67 } |
| 69 | 68 |
| 70 void StopLocalDevToolsHttpHandler() { | 69 void StopLocalDevToolsHttpHandler() { |
| 71 content::DevToolsAgentHost::StopRemoteDebuggingServer(); | 70 content::DevToolsAgentHost::StopRemoteDebuggingServer(); |
| 72 } | 71 } |
| 73 | 72 |
| 74 } // namespace headless | 73 } // namespace headless |
| OLD | NEW |