OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/app_switches.h" | 7 #include "app/app_switches.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 cmd_line.AppendSwitchASCII(switches::kProcessChannelID, channel_id()); | 95 cmd_line.AppendSwitchASCII(switches::kProcessChannelID, channel_id()); |
96 cmd_line.AppendSwitch(switches::kLang); | 96 cmd_line.AppendSwitch(switches::kLang); |
97 | 97 |
98 return Launch(&cmd_line, exposed_dir); | 98 return Launch(&cmd_line, exposed_dir); |
99 } | 99 } |
100 | 100 |
101 FilePath ServiceUtilityProcessHost::GetUtilityProcessCmd() { | 101 FilePath ServiceUtilityProcessHost::GetUtilityProcessCmd() { |
102 return GetChildPath(true); | 102 return GetChildPath(true); |
103 } | 103 } |
104 | 104 |
| 105 bool ServiceUtilityProcessHost::CanShutdown() { |
| 106 return true; |
| 107 } |
| 108 |
105 void ServiceUtilityProcessHost::OnChildDied() { | 109 void ServiceUtilityProcessHost::OnChildDied() { |
106 if (waiting_for_reply_) { | 110 if (waiting_for_reply_) { |
107 // If we are yet to receive a reply then notify the client that the | 111 // If we are yet to receive a reply then notify the client that the |
108 // child died. | 112 // child died. |
109 client_message_loop_proxy_->PostTask( | 113 client_message_loop_proxy_->PostTask( |
110 FROM_HERE, | 114 FROM_HERE, |
111 NewRunnableMethod(client_.get(), &Client::OnChildDied)); | 115 NewRunnableMethod(client_.get(), &Client::OnChildDied)); |
112 } | 116 } |
113 // The base class implementation will delete |this|. | 117 // The base class implementation will delete |this|. |
114 ServiceChildProcessHost::OnChildDied(); | 118 ServiceChildProcessHost::OnChildDied(); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 if (!metafile.CreateFromFile(metafile_path)) { | 182 if (!metafile.CreateFromFile(metafile_path)) { |
179 OnRenderPDFPagesToMetafileFailed(); | 183 OnRenderPDFPagesToMetafileFailed(); |
180 } else { | 184 } else { |
181 OnRenderPDFPagesToMetafileSucceeded(metafile, highest_rendered_page_number); | 185 OnRenderPDFPagesToMetafileSucceeded(metafile, highest_rendered_page_number); |
182 // Close it so that ScopedTempDir can delete the folder. | 186 // Close it so that ScopedTempDir can delete the folder. |
183 metafile.CloseEmf(); | 187 metafile.CloseEmf(); |
184 } | 188 } |
185 #endif // defined(OS_WIN) | 189 #endif // defined(OS_WIN) |
186 } | 190 } |
187 | 191 |
OLD | NEW |