OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "printing/printing_context.h" | 5 #include "printing/printing_context.h" |
6 | 6 |
7 #include <winspool.h> | 7 #include <winspool.h> |
8 | 8 |
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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 filename += base::TimeFormatTimeOfDay(now); | 281 filename += base::TimeFormatTimeOfDay(now); |
282 filename += L"_"; | 282 filename += L"_"; |
283 filename += document_name; | 283 filename += document_name; |
284 filename += L"_"; | 284 filename += L"_"; |
285 filename += L"buffer.prn"; | 285 filename += L"buffer.prn"; |
286 file_util::ReplaceIllegalCharacters(&filename, '_'); | 286 file_util::ReplaceIllegalCharacters(&filename, '_'); |
287 file_util::AppendToPath(&debug_dump_path, filename); | 287 file_util::AppendToPath(&debug_dump_path, filename); |
288 di.lpszOutput = debug_dump_path.c_str(); | 288 di.lpszOutput = debug_dump_path.c_str(); |
289 } | 289 } |
290 | 290 |
291 DCHECK_EQ(MessageLoop::current()->NestableTasksAllowed(), false); | 291 // No message loop running in unit tests. |
| 292 DCHECK(!MessageLoop::current() ? true : |
| 293 !MessageLoop::current()->NestableTasksAllowed()); |
| 294 |
292 // Begin a print job by calling the StartDoc function. | 295 // Begin a print job by calling the StartDoc function. |
293 // NOTE: StartDoc() starts a message loop. That causes a lot of problems with | 296 // NOTE: StartDoc() starts a message loop. That causes a lot of problems with |
294 // IPC. Make sure recursive task processing is disabled. | 297 // IPC. Make sure recursive task processing is disabled. |
295 if (StartDoc(hdc_, &di) <= 0) | 298 if (StartDoc(hdc_, &di) <= 0) |
296 return OnError(); | 299 return OnError(); |
297 | 300 |
298 #ifndef NDEBUG | 301 #ifndef NDEBUG |
299 page_number_ = 0; | 302 page_number_ = 0; |
300 #endif | 303 #endif |
301 return OK; | 304 return OK; |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 | 601 |
599 if (dialog_options.hDevMode != NULL) | 602 if (dialog_options.hDevMode != NULL) |
600 GlobalFree(dialog_options.hDevMode); | 603 GlobalFree(dialog_options.hDevMode); |
601 if (dialog_options.hDevNames != NULL) | 604 if (dialog_options.hDevNames != NULL) |
602 GlobalFree(dialog_options.hDevNames); | 605 GlobalFree(dialog_options.hDevNames); |
603 | 606 |
604 return hdc_ ? OK : FAILED; | 607 return hdc_ ? OK : FAILED; |
605 } | 608 } |
606 | 609 |
607 } // namespace printing | 610 } // namespace printing |
OLD | NEW |