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

Unified Diff: chrome/service/service_utility_process_host.cc

Issue 5947002: As the first step in an effort to improve robustness of the cloud print proxy... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Fixed Mac/Linux compile error Created 10 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
Index: chrome/service/service_utility_process_host.cc
===================================================================
--- chrome/service/service_utility_process_host.cc (revision 69496)
+++ chrome/service/service_utility_process_host.cc (working copy)
@@ -47,7 +47,7 @@
return false;
}
- if (!StartProcess(scratch_metafile_dir_->path()))
+ if (!StartProcess(false, scratch_metafile_dir_->path()))
return false;
ScopedHandle pdf_file(
@@ -76,7 +76,17 @@
#endif // !defined(OS_WIN)
}
-bool ServiceUtilityProcessHost::StartProcess(const FilePath& exposed_dir) {
+bool ServiceUtilityProcessHost::StartGetPrinterCapsAndDefaults(
+ const std::string& printer_name) {
+ FilePath exposed_path;
+ if (!StartProcess(true, exposed_path))
+ return false;
+ waiting_for_reply_ = true;
+ return Send(new UtilityMsg_GetPrinterCapsAndDefaults(printer_name));
+}
+
+bool ServiceUtilityProcessHost::StartProcess(bool no_sandbox,
+ const FilePath& exposed_dir) {
// Name must be set or metrics_service will crash in any test which
// launches a UtilityProcessHost.
set_name(L"utility process");
@@ -94,8 +104,10 @@
cmd_line.AppendSwitchASCII(switches::kProcessType, switches::kUtilityProcess);
cmd_line.AppendSwitchASCII(switches::kProcessChannelID, channel_id());
cmd_line.AppendSwitch(switches::kLang);
+ if (no_sandbox)
+ cmd_line.AppendSwitch(switches::kNoSandbox);
gene 2010/12/20 22:52:31 Why this is needed? Since we are passing no_sandbo
sanjeevr 2010/12/21 21:28:45 Moved to lower layer.
- return Launch(&cmd_line, exposed_dir);
+ return Launch(&cmd_line, no_sandbox, exposed_dir);
}
FilePath ServiceUtilityProcessHost::GetUtilityProcessCmd() {
@@ -167,6 +179,10 @@
IPC_BEGIN_MESSAGE_MAP(ServiceUtilityProcessHost, message)
IPC_MESSAGE_HANDLER(UtilityHostMsg_RenderPDFPagesToMetafile_Failed,
Client::OnRenderPDFPagesToMetafileFailed)
+ IPC_MESSAGE_HANDLER(UtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded,
+ Client::OnGetPrinterCapsAndDefaultsSucceeded)
+ IPC_MESSAGE_HANDLER(UtilityHostMsg_GetPrinterCapsAndDefaults_Failed,
+ Client::OnGetPrinterCapsAndDefaultsFailed)
IPC_END_MESSAGE_MAP_EX()
}

Powered by Google App Engine
This is Rietveld 408576698