| 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 "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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 IPC_END_MESSAGE_MAP_EX() | 191 IPC_END_MESSAGE_MAP_EX() |
| 192 return handled; | 192 return handled; |
| 193 } | 193 } |
| 194 | 194 |
| 195 void ServiceUtilityProcessHost::Client::MetafileAvailable( | 195 void ServiceUtilityProcessHost::Client::MetafileAvailable( |
| 196 const FilePath& metafile_path, | 196 const FilePath& metafile_path, |
| 197 int highest_rendered_page_number) { | 197 int highest_rendered_page_number) { |
| 198 // The metafile was created in a temp folder which needs to get deleted after | 198 // The metafile was created in a temp folder which needs to get deleted after |
| 199 // we have processed it. | 199 // we have processed it. |
| 200 ScopedTempDir scratch_metafile_dir; | 200 ScopedTempDir scratch_metafile_dir; |
| 201 scratch_metafile_dir.Set(metafile_path.DirName()); | 201 if (!scratch_metafile_dir.Set(metafile_path.DirName())) |
| 202 LOG(WARNING) << "Unable to set scratch metafile directory"; |
| 202 #if defined(OS_WIN) | 203 #if defined(OS_WIN) |
| 203 printing::NativeMetafile metafile; | 204 printing::NativeMetafile metafile; |
| 204 if (!metafile.CreateFromFile(metafile_path)) { | 205 if (!metafile.CreateFromFile(metafile_path)) { |
| 205 OnRenderPDFPagesToMetafileFailed(); | 206 OnRenderPDFPagesToMetafileFailed(); |
| 206 } else { | 207 } else { |
| 207 OnRenderPDFPagesToMetafileSucceeded(metafile, highest_rendered_page_number); | 208 OnRenderPDFPagesToMetafileSucceeded(metafile, highest_rendered_page_number); |
| 208 // Close it so that ScopedTempDir can delete the folder. | 209 // Close it so that ScopedTempDir can delete the folder. |
| 209 metafile.CloseEmf(); | 210 metafile.CloseEmf(); |
| 210 } | 211 } |
| 211 #endif // defined(OS_WIN) | 212 #endif // defined(OS_WIN) |
| 212 } | 213 } |
| 213 | 214 |
| OLD | NEW |