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

Side by Side Diff: chrome/browser/printing/print_job_worker_owner.h

Issue 2871303004: Rename TaskRunner::RunsTasksOnCurrentThread() in //chrome (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__ 5 #ifndef CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__
6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__ 6 #define CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 26 matching lines...) Expand all
37 // Detach the PrintJobWorker associated to this object. 37 // Detach the PrintJobWorker associated to this object.
38 virtual std::unique_ptr<PrintJobWorker> DetachWorker( 38 virtual std::unique_ptr<PrintJobWorker> DetachWorker(
39 PrintJobWorkerOwner* new_owner) = 0; 39 PrintJobWorkerOwner* new_owner) = 0;
40 40
41 // Access the current settings. 41 // Access the current settings.
42 virtual const PrintSettings& settings() const = 0; 42 virtual const PrintSettings& settings() const = 0;
43 43
44 // Cookie uniquely identifying the PrintedDocument and/or loaded settings. 44 // Cookie uniquely identifying the PrintedDocument and/or loaded settings.
45 virtual int cookie() const = 0; 45 virtual int cookie() const = 0;
46 46
47 // Returns true if the current thread is a thread on which a task 47 // Returns true if the current thread is a thread on which a task
Lei Zhang 2017/05/15 18:16:10 Update comment?
48 // may be run, and false if no task will be run on the current 48 // may be run, and false if no task will be run on the current
49 // thread. 49 // thread.
50 bool RunsTasksOnCurrentThread() const; 50 bool RunsTasksInCurrentSequence() const;
51 51
52 // Posts the given task to be run. 52 // Posts the given task to be run.
53 bool PostTask(const tracked_objects::Location& from_here, 53 bool PostTask(const tracked_objects::Location& from_here,
54 const base::Closure& task); 54 const base::Closure& task);
55 55
56 protected: 56 protected:
57 friend class base::RefCountedThreadSafe<PrintJobWorkerOwner>; 57 friend class base::RefCountedThreadSafe<PrintJobWorkerOwner>;
58 58
59 virtual ~PrintJobWorkerOwner(); 59 virtual ~PrintJobWorkerOwner();
60 60
61 // Task runner reference. Used to send notifications in the right 61 // Task runner reference. Used to send notifications in the right
62 // thread. 62 // thread.
63 scoped_refptr<base::SequencedTaskRunner> task_runner_; 63 scoped_refptr<base::SequencedTaskRunner> task_runner_;
64 }; 64 };
65 65
66 } // namespace printing 66 } // namespace printing
67 67
68 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__ 68 #endif // CHROME_BROWSER_PRINTING_PRINT_JOB_WORKER_OWNER_H__
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_job_worker.cc ('k') | chrome/browser/printing/print_job_worker_owner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698