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

Unified Diff: chrome/common/service_process_util_linux.cc

Issue 6591002: Removed the command line from ServiceProcessState::AddToAutoRun() and had the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Scott's review comments addressed Created 9 years, 10 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 | « chrome/common/service_process_util.cc ('k') | chrome/common/service_process_util_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/service_process_util_linux.cc
===================================================================
--- chrome/common/service_process_util_linux.cc (revision 75945)
+++ chrome/common/service_process_util_linux.cc (working copy)
@@ -7,9 +7,11 @@
#include <signal.h>
#include <unistd.h>
+#include "base/command_line.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/threading/platform_thread.h"
+#include "chrome/common/auto_start_linux.h"
#include "chrome/common/multi_process_lock.h"
namespace {
@@ -41,6 +43,13 @@
return TakeNamedLock(lock_name, waiting);
}
+std::string GetBaseDesktopName() {
+#if defined(GOOGLE_CHROME_BUILD)
+ return "google-chrome-service.desktop";
+#else // CHROMIUM_BUILD
+ return "chromium-service.desktop";
+#endif
+}
} // namespace
MultiProcessLock* TakeServiceRunningLock(bool waiting) {
@@ -68,12 +77,21 @@
return state_->initializing_lock_.get();
}
-bool ServiceProcessState::AddToAutoRun(CommandLine* cmd_line) {
- NOTIMPLEMENTED();
- return false;
+bool ServiceProcessState::AddToAutoRun() {
+ DCHECK(autorun_command_line_.get());
+#if defined(GOOGLE_CHROME_BUILD)
+ std::string app_name = "Google Chrome Service";
+#else // CHROMIUM_BUILD
+ std::string app_name = "Chromium Service";
+#endif
+ return AutoStart::AddApplication(
+ GetServiceProcessScopedName(GetBaseDesktopName()),
+ app_name,
+ autorun_command_line_->command_line_string(),
+ false);
}
bool ServiceProcessState::RemoveFromAutoRun() {
- NOTIMPLEMENTED();
- return false;
+ return AutoStart::Remove(
+ GetServiceProcessScopedName(GetBaseDesktopName()));
}
« no previous file with comments | « chrome/common/service_process_util.cc ('k') | chrome/common/service_process_util_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698