| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/shell/shell_devtools_delegate.h" | 5 #include "content/shell/shell_devtools_delegate.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 net::StreamListenSocketFactory* CreateSocketFactory() { | 28 net::StreamListenSocketFactory* CreateSocketFactory() { |
| 29 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 29 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 30 #if defined(OS_ANDROID) | 30 #if defined(OS_ANDROID) |
| 31 std::string socket_name = "content_shell_devtools_remote"; | 31 std::string socket_name = "content_shell_devtools_remote"; |
| 32 if (command_line.HasSwitch(switches::kRemoteDebuggingSocketName)) { | 32 if (command_line.HasSwitch(switches::kRemoteDebuggingSocketName)) { |
| 33 socket_name = command_line.GetSwitchValueASCII( | 33 socket_name = command_line.GetSwitchValueASCII( |
| 34 switches::kRemoteDebuggingSocketName); | 34 switches::kRemoteDebuggingSocketName); |
| 35 } | 35 } |
| 36 return new net::UnixDomainSocketWithAbstractNamespaceFactory( | 36 return new net::UnixDomainSocketWithAbstractNamespaceFactory( |
| 37 socket_name, base::Bind(&content::CanUserConnectToDevTools)); | 37 socket_name, "", base::Bind(&content::CanUserConnectToDevTools)); |
| 38 #else | 38 #else |
| 39 // See if the user specified a port on the command line (useful for | 39 // See if the user specified a port on the command line (useful for |
| 40 // automation). If not, use an ephemeral port by specifying 0. | 40 // automation). If not, use an ephemeral port by specifying 0. |
| 41 int port = 0; | 41 int port = 0; |
| 42 if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) { | 42 if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) { |
| 43 int temp_port; | 43 int temp_port; |
| 44 std::string port_str = | 44 std::string port_str = |
| 45 command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort); | 45 command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort); |
| 46 if (base::StringToInt(port_str, &temp_port) && | 46 if (base::StringToInt(port_str, &temp_port) && |
| 47 temp_port > 0 && temp_port < 65535) { | 47 temp_port > 0 && temp_port < 65535) { |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 } | 108 } |
| 109 | 109 |
| 110 scoped_refptr<net::StreamListenSocket> | 110 scoped_refptr<net::StreamListenSocket> |
| 111 ShellDevToolsDelegate::CreateSocketForTethering( | 111 ShellDevToolsDelegate::CreateSocketForTethering( |
| 112 net::StreamListenSocket::Delegate* delegate, | 112 net::StreamListenSocket::Delegate* delegate, |
| 113 std::string* name) { | 113 std::string* name) { |
| 114 return NULL; | 114 return NULL; |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace content | 117 } // namespace content |
| OLD | NEW |