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

Side by Side Diff: base/threading/post_task_and_reply_impl.h

Issue 1048373003: CancelableTaskTracker::PostDelayedTask() support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unnecessary base:: Created 5 years, 8 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 | « base/task_runner.cc ('k') | base/threading/post_task_and_reply_impl.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) 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 // This file contains the implementation shared by 5 // This file contains the implementation shared by
6 // MessageLoopProxy::PostTaskAndReply and WorkerPool::PostTaskAndReply. 6 // MessageLoopProxy::PostTaskAndReply and WorkerPool::PostTaskAndReply.
7 7
8 #ifndef BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_ 8 #ifndef BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_
9 #define BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_ 9 #define BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_
10 10
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 #include "base/location.h" 12 #include "base/location.h"
13 #include "base/time/time.h"
13 14
14 namespace base { 15 namespace base {
15 namespace internal { 16 namespace internal {
16 17
17 // Inherit from this in a class that implements PostTask appropriately 18 // Inherit from this in a class that implements PostTask appropriately
18 // for sending to a destination thread. 19 // for sending to a destination thread.
19 // 20 //
20 // Note that 'reply' will always get posted back to your current 21 // Note that 'reply' will always get posted back to your current
21 // MessageLoop. 22 // MessageLoop.
22 // 23 //
23 // If you're looking for a concrete implementation of 24 // If you're looking for a concrete implementation of
24 // PostTaskAndReply, you probably want base::MessageLoopProxy, or you 25 // PostTaskAndReply, you probably want base::MessageLoopProxy, or you
25 // may want base::WorkerPool. 26 // may want base::WorkerPool.
26 class PostTaskAndReplyImpl { 27 class PostTaskAndReplyImpl {
27 public: 28 public:
28 // Implementation for MessageLoopProxy::PostTaskAndReply and 29 // Implementation for MessageLoopProxy::PostTaskAndReply and
29 // WorkerPool::PostTaskAndReply. 30 // WorkerPool::PostTaskAndReply.
30 bool PostTaskAndReply(const tracked_objects::Location& from_here, 31 bool PostTaskAndReply(const tracked_objects::Location& from_here,
31 const Closure& task, 32 const Closure& task,
32 const Closure& reply); 33 const Closure& reply);
33 34
35 // Implementation for MessageLoopProxy::PostDelayedTaskAndReply.
36 bool PostDelayedTaskAndReply(const tracked_objects::Location& from_here,
37 const Closure& task,
38 const Closure& reply,
39 const TimeDelta& delay);
40
34 private: 41 private:
35 virtual bool PostTask(const tracked_objects::Location& from_here, 42 virtual bool PostTask(const tracked_objects::Location& from_here,
36 const Closure& task) = 0; 43 const Closure& task) = 0;
44 virtual bool PostDelayedTask(const tracked_objects::Location& from_here,
45 const Closure& task,
46 const TimeDelta& delay) = 0;
37 }; 47 };
38 48
39 } // namespace internal 49 } // namespace internal
40 } // namespace base 50 } // namespace base
41 51
42 #endif // BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_ 52 #endif // BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_
OLDNEW
« no previous file with comments | « base/task_runner.cc ('k') | base/threading/post_task_and_reply_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698