Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Side by Side Diff: chrome/browser/printing/printed_document.cc

Issue 21057: Remove black magic and >100 lines. Unhook a lot of dead code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_view_manager.cc ('k') | chrome/browser/printing/printed_pages_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698