| Index: content/shell/shell_devtools_delegate.cc
|
| diff --git a/content/shell/shell_devtools_delegate.cc b/content/shell/shell_devtools_delegate.cc
|
| index 2d7b15ef30b5c0c654e9a97e9f41738a434da5d3..814a5a552bb921d29b43f760b78269b29ea890b4 100644
|
| --- a/content/shell/shell_devtools_delegate.cc
|
| +++ b/content/shell/shell_devtools_delegate.cc
|
| @@ -10,6 +10,7 @@
|
| #include "base/command_line.h"
|
| #include "base/strings/string_number_conversions.h"
|
| #include "content/public/browser/devtools_http_handler.h"
|
| +#include "content/public/browser/devtools_remote_frontend_util.h"
|
| #include "content/public/browser/web_contents.h"
|
| #include "content/public/common/content_switches.h"
|
| #include "content/public/common/url_constants.h"
|
| @@ -25,16 +26,23 @@
|
|
|
| namespace {
|
|
|
| -net::StreamListenSocketFactory* CreateSocketFactory() {
|
| +content::DevToolsHttpHandler* CreateDevToolsHttpHandler(
|
| + content::DevToolsHttpHandlerDelegate* delegate) {
|
| const CommandLine& command_line = *CommandLine::ForCurrentProcess();
|
| +
|
| #if defined(OS_ANDROID)
|
| - std::string socket_name = "content_shell_devtools_remote";
|
| + std::string socket_name =
|
| + content::GetDevToolsServerSocketName("content_shell");
|
| if (command_line.HasSwitch(switches::kRemoteDebuggingSocketName)) {
|
| socket_name = command_line.GetSwitchValueASCII(
|
| switches::kRemoteDebuggingSocketName);
|
| }
|
| - return new net::UnixDomainSocketWithAbstractNamespaceFactory(
|
| - socket_name, "", base::Bind(&content::CanUserConnectToDevTools));
|
| +
|
| + return content::DevToolsHttpHandler::Start(
|
| + new net::UnixDomainSocketWithAbstractNamespaceFactory(
|
| + socket_name, "", base::Bind(&content::CanUserConnectToDevTools)),
|
| + content::GetDevToolsFrontendMainResourceURL(),
|
| + delegate);
|
| #else
|
| // See if the user specified a port on the command line (useful for
|
| // automation). If not, use an ephemeral port by specifying 0.
|
| @@ -50,7 +58,11 @@ net::StreamListenSocketFactory* CreateSocketFactory() {
|
| DLOG(WARNING) << "Invalid http debugger port number " << temp_port;
|
| }
|
| }
|
| - return new net::TCPListenSocketFactory("127.0.0.1", port);
|
| +
|
| + return content::DevToolsHttpHandler::Start(
|
| + new net::TCPListenSocketFactory("127.0.0.1", port),
|
| + std::string(),
|
| + delegate);
|
| #endif
|
| }
|
| } // namespace
|
| @@ -59,8 +71,7 @@ namespace content {
|
|
|
| ShellDevToolsDelegate::ShellDevToolsDelegate(BrowserContext* browser_context)
|
| : browser_context_(browser_context) {
|
| - devtools_http_handler_ =
|
| - DevToolsHttpHandler::Start(CreateSocketFactory(), std::string(), this);
|
| + devtools_http_handler_ = CreateDevToolsHttpHandler(this);
|
| }
|
|
|
| ShellDevToolsDelegate::~ShellDevToolsDelegate() {
|
| @@ -77,7 +88,11 @@ std::string ShellDevToolsDelegate::GetDiscoveryPageHTML() {
|
| }
|
|
|
| bool ShellDevToolsDelegate::BundlesFrontendResources() {
|
| +#if defined(OS_ANDROID)
|
| + return false;
|
| +#else
|
| return true;
|
| +#endif
|
| }
|
|
|
| base::FilePath ShellDevToolsDelegate::GetDebugFrontendDir() {
|
|
|