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

Side by Side Diff: chrome/browser/android/dev_tools_server.cc

Issue 23458029: Make both DevToolsServer constructors to be equivalent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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
« no previous file with comments | « chrome/browser/android/dev_tools_server.h ('k') | no next file » | 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 "chrome/browser/android/dev_tools_server.h" 5 #include "chrome/browser/android/dev_tools_server.h"
6 6
7 #include <pwd.h> 7 #include <pwd.h>
8 #include <cstring> 8 #include <cstring>
9 9
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 if (command_line.HasSwitch(switches::kRemoteDebuggingSocketName)) { 141 if (command_line.HasSwitch(switches::kRemoteDebuggingSocketName)) {
142 socket_name_ = command_line.GetSwitchValueASCII( 142 socket_name_ = command_line.GetSwitchValueASCII(
143 switches::kRemoteDebuggingSocketName); 143 switches::kRemoteDebuggingSocketName);
144 } 144 }
145 } 145 }
146 146
147 DevToolsServer::DevToolsServer(const std::string& socket_name_prefix) 147 DevToolsServer::DevToolsServer(const std::string& socket_name_prefix)
148 : socket_name_(base::StringPrintf(kDevToolsChannelNameFormat, 148 : socket_name_(base::StringPrintf(kDevToolsChannelNameFormat,
149 socket_name_prefix.c_str())), 149 socket_name_prefix.c_str())),
150 protocol_handler_(NULL) { 150 protocol_handler_(NULL) {
151 // Override the socket name if one is specified on the command line.
152 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
153 if (command_line.HasSwitch(switches::kRemoteDebuggingSocketName)) {
154 socket_name_ = command_line.GetSwitchValueASCII(
155 switches::kRemoteDebuggingSocketName);
156 }
151 } 157 }
152 158
153 DevToolsServer::~DevToolsServer() { 159 DevToolsServer::~DevToolsServer() {
154 Stop(); 160 Stop();
155 } 161 }
156 162
157 void DevToolsServer::Start() { 163 void DevToolsServer::Start() {
158 if (protocol_handler_) 164 if (protocol_handler_)
159 return; 165 return;
160 166
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 jobject obj, 213 jobject obj,
208 jint server, 214 jint server,
209 jboolean enabled) { 215 jboolean enabled) {
210 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); 216 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server);
211 if (enabled) { 217 if (enabled) {
212 devtools_server->Start(); 218 devtools_server->Start();
213 } else { 219 } else {
214 devtools_server->Stop(); 220 devtools_server->Stop();
215 } 221 }
216 } 222 }
OLDNEW
« no previous file with comments | « chrome/browser/android/dev_tools_server.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698