summaryrefslogtreecommitdiffstats
path: root/chrome/app/chrome_dll_main.cc
diff options
context:
space:
mode:
authorsanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-12 19:25:07 +0000
committersanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-12 19:25:07 +0000
commit1d0ee423b6a0bb307c7c19fe28c95d8761691e9a (patch)
tree5766edd6b8b8a7b2eb3942e75008388a0ecfeff0 /chrome/app/chrome_dll_main.cc
parentb90b874fe7023537531fbd08df403694e3e3a520 (diff)
downloadchromium_src-1d0ee423b6a0bb307c7c19fe28c95d8761691e9a.zip
chromium_src-1d0ee423b6a0bb307c7c19fe28c95d8761691e9a.tar.gz
chromium_src-1d0ee423b6a0bb307c7c19fe28c95d8761691e9a.tar.bz2
Created a new process type called the service process to host background tasks such as the Cloud Print Proxy.
BUG=None. TEST=None. Review URL: http://codereview.chromium.org/2001009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47055 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/chrome_dll_main.cc')
-rw-r--r--chrome/app/chrome_dll_main.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc
index c1077ac..ba4b481 100644
--- a/chrome/app/chrome_dll_main.cc
+++ b/chrome/app/chrome_dll_main.cc
@@ -103,6 +103,7 @@ extern int ZygoteMain(const MainFunctionParams&);
#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 @@ static void AdjustLinuxOOMScore(const std::string& process_type) {
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 @@ bool SubprocessNeedsResourceBundle(const std::string& process_type) {
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 @@ int ChromeMain(int argc, char** argv) {
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 @@ int ChromeMain(int argc, char** argv) {
#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;