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

Side by Side Diff: content/child/worker_thread_task_runner.h

Issue 671663002: Standardize usage of virtual/override/final in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « content/child/webthread_impl.cc ('k') | content/common/child_process_host_impl.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CONTENT_CHILD_WORKER_THREAD_TASK_RUNNER_H_ 5 #ifndef CONTENT_CHILD_WORKER_THREAD_TASK_RUNNER_H_
6 #define CONTENT_CHILD_WORKER_THREAD_TASK_RUNNER_H_ 6 #define CONTENT_CHILD_WORKER_THREAD_TASK_RUNNER_H_
7 7
8 #include "base/task_runner.h" 8 #include "base/task_runner.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 // A task runner that runs tasks on a single webkit worker thread which 12 // A task runner that runs tasks on a single webkit worker thread which
13 // is managed by WorkerTaskRunner. 13 // is managed by WorkerTaskRunner.
14 // Note that this implementation ignores the delay duration for PostDelayedTask 14 // Note that this implementation ignores the delay duration for PostDelayedTask
15 // and have it behave the same as PostTask. 15 // and have it behave the same as PostTask.
16 class WorkerThreadTaskRunner : public base::TaskRunner { 16 class WorkerThreadTaskRunner : public base::TaskRunner {
17 public: 17 public:
18 explicit WorkerThreadTaskRunner(int worker_thread_id); 18 explicit WorkerThreadTaskRunner(int worker_thread_id);
19 19
20 // Gets the WorkerThreadTaskRunner for the current worker thread. 20 // Gets the WorkerThreadTaskRunner for the current worker thread.
21 // This returns non-null value only when it is called on a worker thread. 21 // This returns non-null value only when it is called on a worker thread.
22 static scoped_refptr<WorkerThreadTaskRunner> current(); 22 static scoped_refptr<WorkerThreadTaskRunner> current();
23 23
24 // TaskRunner overrides. 24 // TaskRunner overrides.
25 virtual bool PostDelayedTask(const tracked_objects::Location& from_here, 25 bool PostDelayedTask(const tracked_objects::Location& from_here,
26 const base::Closure& task, 26 const base::Closure& task,
27 base::TimeDelta delay) override; 27 base::TimeDelta delay) override;
28 virtual bool RunsTasksOnCurrentThread() const override; 28 bool RunsTasksOnCurrentThread() const override;
29 29
30 protected: 30 protected:
31 virtual ~WorkerThreadTaskRunner(); 31 ~WorkerThreadTaskRunner() override;
32 32
33 private: 33 private:
34 const int worker_thread_id_; 34 const int worker_thread_id_;
35 }; 35 };
36 36
37 } // namespace content 37 } // namespace content
38 38
39 #endif // CONTENT_CHILD_WORKER_THREAD_TASK_RUNNER_H_ 39 #endif // CONTENT_CHILD_WORKER_THREAD_TASK_RUNNER_H_
OLDNEW
« no previous file with comments | « content/child/webthread_impl.cc ('k') | content/common/child_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698