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

Unified Diff: content/shell/shell_browser_main_parts.cc

Issue 10829303: Add --remote-debugging-port back to content_shell since nduca mentioned he wants to use it with And… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/common/content_switches.cc ('k') | content/shell/shell_devtools_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/shell_browser_main_parts.cc
===================================================================
--- content/shell/shell_browser_main_parts.cc (revision 151267)
+++ content/shell/shell_browser_main_parts.cc (working copy)
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/message_loop.h"
+#include "base/string_number_conversions.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "content/public/common/content_switches.h"
@@ -95,8 +96,26 @@
Shell::PlatformInitialize();
net::NetModule::SetResourceProvider(PlatformResourceProvider);
+ int port = 0;
+// On android the port number isn't used.
+#if !defined(OS_ANDROID)
+ // See if the user specified a port on the command line (useful for
+ // automation). If not, use an ephemeral port by specifying 0.
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) {
+ int temp_port;
+ std::string port_str =
+ command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort);
+ if (base::StringToInt(port_str, &temp_port) &&
+ temp_port > 0 && temp_port < 65535) {
+ port = temp_port;
+ } else {
+ DLOG(WARNING) << "Invalid http debugger port number " << temp_port;
+ }
+ }
+#endif
devtools_delegate_ = new ShellDevToolsDelegate(
- browser_context_->GetRequestContext());
+ port, browser_context_->GetRequestContext());
if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) {
Shell::CreateNewWindow(browser_context_.get(),
« no previous file with comments | « content/public/common/content_switches.cc ('k') | content/shell/shell_devtools_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698