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

Unified Diff: chrome/browser/service_process/service_process_control.cc

Issue 347953002: Use the same set of switches for service process autorun and for launching process from browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Thu 06/19/2014 19:02:33.22 Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/service_process/service_process_control.cc
diff --git a/chrome/browser/service_process/service_process_control.cc b/chrome/browser/service_process/service_process_control.cc
index 3650429c38d3033f0a70b6d142ee5fdb324994ed..56d6870e9689294f8b9bd205073b906d6a61286b 100644
--- a/chrome/browser/service_process/service_process_control.cc
+++ b/chrome/browser/service_process/service_process_control.cc
@@ -18,15 +18,11 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/upgrade_detector.h"
-#include "chrome/common/chrome_switches.h"
#include "chrome/common/service_messages.h"
#include "chrome/common/service_process_util.h"
-#include "components/cloud_devices/common/cloud_devices_switches.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/common/child_process_host.h"
-#include "google_apis/gaia/gaia_switches.h"
-#include "ui/base/ui_base_switches.h"
using content::BrowserThread;
using content::ChildProcessHost;
@@ -127,38 +123,9 @@ void ServiceProcessControl::Launch(const base::Closure& success_task,
int flags = ChildProcessHost::CHILD_NORMAL;
#endif
- base::FilePath exe_path = ChildProcessHost::GetChildPath(flags);
- if (exe_path.empty())
- NOTREACHED() << "Unable to get service process binary name.";
-
- CommandLine* cmd_line = new CommandLine(exe_path);
- cmd_line->AppendSwitchASCII(switches::kProcessType,
- switches::kServiceProcess);
-
- static const char* const kSwitchesToCopy[] = {
- switches::kCloudPrintSetupProxy,
- switches::kCloudPrintURL,
- switches::kCloudPrintXmppEndpoint,
-#if defined(OS_WIN)
- switches::kEnableCloudPrintXps,
-#endif
- switches::kEnableLogging,
- switches::kIgnoreUrlFetcherCertRequests,
- switches::kLang,
- switches::kLoggingLevel,
- switches::kLsoUrl,
- switches::kNoServiceAutorun,
- switches::kUserDataDir,
- switches::kV,
- switches::kVModule,
- switches::kWaitForDebugger,
- };
- cmd_line->CopySwitchesFrom(*CommandLine::ForCurrentProcess(),
- kSwitchesToCopy,
- arraysize(kSwitchesToCopy));
-
+ scoped_ptr<CommandLine> cmd_line(CreateServiceProcessCommandLine());
Lei Zhang 2014/06/20 02:50:29 base::CommandLine
Vitaly Buka (NO REVIEWS) 2014/06/20 04:38:43 Done.
// And then start the process asynchronously.
- launcher_ = new Launcher(this, cmd_line);
+ launcher_ = new Launcher(this, cmd_line.Pass());
launcher_->Run(base::Bind(&ServiceProcessControl::OnProcessLaunched,
base::Unretained(this)));
}
@@ -356,10 +323,11 @@ ServiceProcessControl* ServiceProcessControl::GetInstance() {
return Singleton<ServiceProcessControl>::get();
}
-ServiceProcessControl::Launcher::Launcher(ServiceProcessControl* process,
- CommandLine* cmd_line)
+ServiceProcessControl::Launcher::Launcher(
+ ServiceProcessControl* process,
+ scoped_ptr<base::CommandLine> cmd_line)
: process_(process),
- cmd_line_(cmd_line),
+ cmd_line_(cmd_line.Pass()),
launched_(false),
retry_count_(0),
process_handle_(base::kNullProcessHandle) {

Powered by Google App Engine
This is Rietveld 408576698