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 "chrome/browser/printing/printed_document.h" | 5 #include "chrome/browser/printing/printed_document.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 void PrintedDocument::PrintPage_ThreadJump(int page_number) { | 337 void PrintedDocument::PrintPage_ThreadJump(int page_number) { |
338 if (MessageLoop::current() != immutable_.source_message_loop_) { | 338 if (MessageLoop::current() != immutable_.source_message_loop_) { |
339 immutable_.source_message_loop_->PostTask(FROM_HERE, NewRunnableMethod( | 339 immutable_.source_message_loop_->PostTask(FROM_HERE, NewRunnableMethod( |
340 this, &PrintedDocument::PrintPage_ThreadJump, page_number)); | 340 this, &PrintedDocument::PrintPage_ThreadJump, page_number)); |
341 } else { | 341 } else { |
342 PrintedPagesSource* source = NULL; | 342 PrintedPagesSource* source = NULL; |
343 { | 343 { |
344 AutoLock lock(lock_); | 344 AutoLock lock(lock_); |
345 source = mutable_.source_; | 345 source = mutable_.source_; |
346 } | 346 } |
347 if (source) { | 347 NOTREACHED(); |
348 // Don't render with the lock held. | |
349 source->RenderOnePrintedPage(this, page_number); | |
350 } else { | |
351 // Printing has probably been canceled already. | |
352 } | |
353 } | 348 } |
354 } | 349 } |
355 | 350 |
356 PrintedDocument::Mutable::Mutable(PrintedPagesSource* source) | 351 PrintedDocument::Mutable::Mutable(PrintedPagesSource* source) |
357 : source_(source), | 352 : source_(source), |
358 expected_page_count_(0), | 353 expected_page_count_(0), |
359 page_count_(0), | 354 page_count_(0), |
360 shrink_factor(0) { | 355 shrink_factor(0) { |
361 } | 356 } |
362 | 357 |
(...skipping 14 matching lines...) Expand all Loading... |
377 time_ = win_util::FormatSystemTime(systemtime, std::wstring()); | 372 time_ = win_util::FormatSystemTime(systemtime, std::wstring()); |
378 #else | 373 #else |
379 Time now = Time::Now(); | 374 Time now = Time::Now(); |
380 date_ = TimeFormat::ShortDateNumeric(now); | 375 date_ = TimeFormat::ShortDateNumeric(now); |
381 time_ = TimeFormat::TimeOfDay(now); | 376 time_ = TimeFormat::TimeOfDay(now); |
382 #endif // WIN32 | 377 #endif // WIN32 |
383 } | 378 } |
384 | 379 |
385 } // namespace printing | 380 } // namespace printing |
386 | 381 |
OLD | NEW |