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

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

Issue 10412028: Convert printing code to use base::TimeDelta in PostDelayedTask interfaces. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 7 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
« no previous file with comments | « chrome/browser/printing/print_job.h ('k') | chrome/browser/printing/print_job_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/print_job.h" 5 #include "chrome/browser/printing/print_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 scoped_refptr<JobEventDetails> details( 190 scoped_refptr<JobEventDetails> details(
191 new JobEventDetails(JobEventDetails::FAILED, NULL, NULL)); 191 new JobEventDetails(JobEventDetails::FAILED, NULL, NULL));
192 content::NotificationService::current()->Notify( 192 content::NotificationService::current()->Notify(
193 chrome::NOTIFICATION_PRINT_JOB_EVENT, 193 chrome::NOTIFICATION_PRINT_JOB_EVENT,
194 content::Source<PrintJob>(this), 194 content::Source<PrintJob>(this),
195 content::Details<JobEventDetails>(details.get())); 195 content::Details<JobEventDetails>(details.get()));
196 Stop(); 196 Stop();
197 is_canceling_ = false; 197 is_canceling_ = false;
198 } 198 }
199 199
200 bool PrintJob::FlushJob(int timeout_ms) { 200 bool PrintJob::FlushJob(base::TimeDelta timeout) {
201 // Make sure the object outlive this message loop. 201 // Make sure the object outlive this message loop.
202 scoped_refptr<PrintJob> handle(this); 202 scoped_refptr<PrintJob> handle(this);
203 203
204 MessageLoop::current()->PostDelayedTask(FROM_HERE, 204 MessageLoop::current()->PostDelayedTask(FROM_HERE,
205 base::Bind(&PrintJob::Quit, quit_factory_.GetWeakPtr()), timeout_ms); 205 base::Bind(&PrintJob::Quit, quit_factory_.GetWeakPtr()), timeout);
206 206
207 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); 207 MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
208 MessageLoop::current()->Run(); 208 MessageLoop::current()->Run();
209 209
210 return true; 210 return true;
211 } 211 }
212 212
213 void PrintJob::DisconnectSource() { 213 void PrintJob::DisconnectSource() {
214 source_ = NULL; 214 source_ = NULL;
215 if (document_.get()) 215 if (document_.get())
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 368
369 PrintedDocument* JobEventDetails::document() const { 369 PrintedDocument* JobEventDetails::document() const {
370 return document_; 370 return document_;
371 } 371 }
372 372
373 PrintedPage* JobEventDetails::page() const { 373 PrintedPage* JobEventDetails::page() const {
374 return page_; 374 return page_;
375 } 375 }
376 376
377 } // namespace printing 377 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_job.h ('k') | chrome/browser/printing/print_job_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698