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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
187 IPC_END_MESSAGE_MAP_EX() | 187 IPC_END_MESSAGE_MAP_EX() |
188 return handled; | 188 return handled; |
189 } | 189 } |
190 | 190 |
191 void ServiceUtilityProcessHost::Client::MetafileAvailable( | 191 void ServiceUtilityProcessHost::Client::MetafileAvailable( |
192 const FilePath& metafile_path, | 192 const FilePath& metafile_path, |
193 int highest_rendered_page_number) { | 193 int highest_rendered_page_number) { |
194 // The metafile was created in a temp folder which needs to get deleted after | 194 // The metafile was created in a temp folder which needs to get deleted after |
195 // we have processed it. | 195 // we have processed it. |
196 ScopedTempDir scratch_metafile_dir; | 196 ScopedTempDir scratch_metafile_dir; |
197 scratch_metafile_dir.Set(metafile_path.DirName()); | 197 if (!scratch_metafile_dir.Set(metafile_path.DirName())) { |
sanjeevr
2011/01/07 04:38:57
The only use to the scratch_metafile_dir is to del
cbentzel
2011/01/10 14:14:36
Moved to LOG(WARNING) and fallthrough in this case
| |
198 // This will happen if metafile_path is invalid. It could potentially | |
199 // be strengthened to a CHECK. | |
200 OnRenderPDFPagesToMetafileFailed(); | |
201 return; | |
202 } | |
198 #if defined(OS_WIN) | 203 #if defined(OS_WIN) |
199 printing::NativeMetafile metafile; | 204 printing::NativeMetafile metafile; |
200 if (!metafile.CreateFromFile(metafile_path)) { | 205 if (!metafile.CreateFromFile(metafile_path)) { |
201 OnRenderPDFPagesToMetafileFailed(); | 206 OnRenderPDFPagesToMetafileFailed(); |
202 } else { | 207 } else { |
203 OnRenderPDFPagesToMetafileSucceeded(metafile, highest_rendered_page_number); | 208 OnRenderPDFPagesToMetafileSucceeded(metafile, highest_rendered_page_number); |
204 // Close it so that ScopedTempDir can delete the folder. | 209 // Close it so that ScopedTempDir can delete the folder. |
205 metafile.CloseEmf(); | 210 metafile.CloseEmf(); |
206 } | 211 } |
207 #endif // defined(OS_WIN) | 212 #endif // defined(OS_WIN) |
208 } | 213 } |
209 | 214 |
OLD | NEW |