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

Unified Diff: chrome/app/chrome_dll_main.cc

Issue 2001009: Created a new process type called the service process to host background task... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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 | « no previous file | chrome/app/dummy_main_functions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_dll_main.cc
===================================================================
--- chrome/app/chrome_dll_main.cc (revision 46945)
+++ chrome/app/chrome_dll_main.cc (working copy)
@@ -103,6 +103,7 @@
#if defined(_WIN64)
extern int NaClBrokerMain(const MainFunctionParams&);
#endif
+extern int ServiceProcessMain(const MainFunctionParams&);
#if defined(OS_WIN)
// TODO(erikkay): isn't this already defined somewhere?
@@ -263,7 +264,8 @@
score = kPluginScore;
} else if (process_type == switches::kUtilityProcess ||
process_type == switches::kWorkerProcess ||
- process_type == switches::kGpuProcess) {
+ process_type == switches::kGpuProcess ||
+ process_type == switches::kServiceProcess) {
score = kMiscScore;
} else if (process_type == switches::kProfileImportProcess) {
NOTIMPLEMENTED();
@@ -367,6 +369,14 @@
process_type == switches::kUtilityProcess;
}
+// Returns true if this process is a child of the browser process.
+bool SubprocessIsBrowserChild(const std::string& process_type) {
+ if (process_type.empty() || process_type == switches::kServiceProcess) {
+ return false;
+ }
+ return true;
+}
+
#if defined(OS_MACOSX)
// Update the name shown in Activity Monitor so users are less likely to ask
// why Chrome has so many processes.
@@ -513,7 +523,7 @@
base::ProcessId browser_pid;
if (process_type.empty()) {
browser_pid = base::GetCurrentProcId();
- } else {
+ } else if (SubprocessIsBrowserChild(process_type)) {
#if defined(OS_WIN)
std::wstring channel_name =
parsed_command_line.GetSwitchValue(switches::kProcessChannelID);
@@ -780,6 +790,8 @@
#else
NOTIMPLEMENTED();
#endif
+ } else if (process_type == switches::kServiceProcess) {
+ rv = ServiceProcessMain(main_params);
} else if (process_type.empty()) {
#if defined(OS_LINUX)
const char* sandbox_binary = NULL;
« no previous file with comments | « no previous file | chrome/app/dummy_main_functions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698