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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 11412281: Moved dev tools initialization bit earlier for ChromeOS browser start. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | « no previous file | chrome/browser/ui/startup/startup_browser_creator_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index f5e408a34a3f2a485992c6b610312bb6424b4d14..7e444f46104d2b86c3d4589c89641e4091daf12f 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -104,6 +104,7 @@
#include "chrome/installer/util/google_update_settings.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_client.h"
+#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
#include "grit/app_locale_settings.h"
#include "grit/browser_resources.h"
@@ -419,6 +420,29 @@ bool HasImportSwitch(const CommandLine& command_line) {
command_line.HasSwitch(switches::kImportFromFile));
}
+void LaunchDevToolsHandlerIfNeeded(Profile* profile,
+ const CommandLine& command_line) {
+ if (command_line.HasSwitch(::switches::kRemoteDebuggingPort)) {
+ std::string port_str =
+ command_line.GetSwitchValueASCII(::switches::kRemoteDebuggingPort);
+ int port;
+ if (base::StringToInt(port_str, &port) && port > 0 && port < 65535) {
+ std::string frontend_str;
+ if (command_line.HasSwitch(::switches::kRemoteDebuggingFrontend)) {
+ frontend_str = command_line.GetSwitchValueASCII(
+ ::switches::kRemoteDebuggingFrontend);
+ }
+ g_browser_process->CreateDevToolsHttpProtocolHandler(
+ profile,
+ "127.0.0.1",
+ port,
+ frontend_str);
+ } else {
+ DLOG(WARNING) << "Invalid http debugger port number " << port;
+ }
+ }
+}
+
#if defined(ENABLE_RLZ)
bool IsGoogleUrl(const GURL& url) {
return google_util::IsGoogleHomePageUrl(url.possibly_invalid_spec());
@@ -861,6 +885,7 @@ void ChromeBrowserMainParts::PreProfileInit() {
}
void ChromeBrowserMainParts::PostProfileInit() {
+ LaunchDevToolsHandlerIfNeeded(profile(), parsed_command_line());
Nikita (slow) 2012/12/05 14:06:04 This part isn't reached on ChromeOS build. #0 ch
stevenjb 2012/12/05 17:35:23 Yikes! Good thing that (until now) PostProfileInit
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PostProfileInit();
}
« no previous file with comments | « no previous file | chrome/browser/ui/startup/startup_browser_creator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698