| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/service/service_utility_process_host.h" | 5 #include "chrome/service/service_utility_process_host.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 CommandLine cmd_line(exe_path); | 110 CommandLine cmd_line(exe_path); |
| 111 cmd_line.AppendSwitchASCII(switches::kProcessType, switches::kUtilityProcess); | 111 cmd_line.AppendSwitchASCII(switches::kProcessType, switches::kUtilityProcess); |
| 112 cmd_line.AppendSwitchASCII(switches::kProcessChannelID, channel_id()); | 112 cmd_line.AppendSwitchASCII(switches::kProcessChannelID, channel_id()); |
| 113 cmd_line.AppendSwitch(switches::kLang); | 113 cmd_line.AppendSwitch(switches::kLang); |
| 114 | 114 |
| 115 return Launch(&cmd_line, no_sandbox, exposed_dir); | 115 return Launch(&cmd_line, no_sandbox, exposed_dir); |
| 116 } | 116 } |
| 117 | 117 |
| 118 FilePath ServiceUtilityProcessHost::GetUtilityProcessCmd() { | 118 FilePath ServiceUtilityProcessHost::GetUtilityProcessCmd() { |
| 119 return GetChildPath(true); | 119 #if defined(OS_LINUX) |
| 120 int flags = CHILD_ALLOW_SELF; |
| 121 #else |
| 122 int flags = CHILD_NORMAL; |
| 123 #endif |
| 124 return GetChildPath(flags); |
| 120 } | 125 } |
| 121 | 126 |
| 122 bool ServiceUtilityProcessHost::CanShutdown() { | 127 bool ServiceUtilityProcessHost::CanShutdown() { |
| 123 return true; | 128 return true; |
| 124 } | 129 } |
| 125 | 130 |
| 126 void ServiceUtilityProcessHost::OnChildDied() { | 131 void ServiceUtilityProcessHost::OnChildDied() { |
| 127 if (waiting_for_reply_) { | 132 if (waiting_for_reply_) { |
| 128 // If we are yet to receive a reply then notify the client that the | 133 // If we are yet to receive a reply then notify the client that the |
| 129 // child died. | 134 // child died. |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 printing::Emf metafile; | 218 printing::Emf metafile; |
| 214 if (!metafile.InitFromFile(metafile_path)) { | 219 if (!metafile.InitFromFile(metafile_path)) { |
| 215 OnRenderPDFPagesToMetafileFailed(); | 220 OnRenderPDFPagesToMetafileFailed(); |
| 216 } else { | 221 } else { |
| 217 OnRenderPDFPagesToMetafileSucceeded(metafile, | 222 OnRenderPDFPagesToMetafileSucceeded(metafile, |
| 218 highest_rendered_page_number); | 223 highest_rendered_page_number); |
| 219 } | 224 } |
| 220 #endif // defined(OS_WIN) | 225 #endif // defined(OS_WIN) |
| 221 } | 226 } |
| 222 | 227 |
| OLD | NEW |