Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: content/shell/shell_devtools_delegate.cc

Issue 16093005: [Android] Use a "unique" remote debugging socket name on bind failure (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Always use socket names from MakeSocketPath Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/android/dev_tools_server.cc ('k') | net/socket/unix_domain_socket_posix.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/android/dev_tools_server.cc ('k') | net/socket/unix_domain_socket_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698