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())) |
| 198 LOG(WARNING) << "Unable to set scratch metafile directory"; |
198 #if defined(OS_WIN) | 199 #if defined(OS_WIN) |
199 printing::NativeMetafile metafile; | 200 printing::NativeMetafile metafile; |
200 if (!metafile.CreateFromFile(metafile_path)) { | 201 if (!metafile.CreateFromFile(metafile_path)) { |
201 OnRenderPDFPagesToMetafileFailed(); | 202 OnRenderPDFPagesToMetafileFailed(); |
202 } else { | 203 } else { |
203 OnRenderPDFPagesToMetafileSucceeded(metafile, highest_rendered_page_number); | 204 OnRenderPDFPagesToMetafileSucceeded(metafile, highest_rendered_page_number); |
204 // Close it so that ScopedTempDir can delete the folder. | 205 // Close it so that ScopedTempDir can delete the folder. |
205 metafile.CloseEmf(); | 206 metafile.CloseEmf(); |
206 } | 207 } |
207 #endif // defined(OS_WIN) | 208 #endif // defined(OS_WIN) |
208 } | 209 } |
209 | 210 |
OLD | NEW |