Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // This file contains the implementation shared by | |
| 6 // MessageLoopProxy::PostTaskAndReply and WorkerPool::PostTaskAndReply. | |
| 7 | |
| 8 #ifndef BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_ | |
| 9 #define BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_ | |
| 10 #pragma once | |
| 11 | |
| 12 #include "base/bind.h" | |
| 13 #include "base/location.h" | |
| 14 | |
| 15 namespace base { | |
| 16 namespace internal { | |
| 17 | |
| 18 // Inherit from this in a class that implements PostTask appropriately | |
| 19 // for sending to a destination thread. | |
| 20 // | |
| 21 // Note that 'reply' will always get posted back to your current | |
| 22 // MessageLoop. | |
| 23 // | |
| 24 // If you're looking for a concrete implementation of | |
| 25 // PostTaskAndReply, you probably want base::MessageLoopProxy, or you | |
| 26 // may want base::WorkerPool. | |
| 27 class PostTaskAndReplyImpl { | |
| 28 public: | |
| 29 // Implementation for MessageLoopProxy::PostTaskAndReply and | |
| 30 // WorkerPool::PostTaskAndReply. | |
| 31 bool PostTaskAndReply(const tracked_objects::Location& from_here, | |
| 32 const Closure& task, | |
| 33 const Closure& reply); | |
| 34 | |
| 35 protected: | |
|
willchan no longer on Chromium
2011/10/13 19:36:38
Why is this protected instead of private? Is a sub
Jói
2011/10/13 20:27:58
Subclasses override this.
Jói
2011/10/13 22:46:07
Made it private, it is only overridden.
| |
| 36 virtual bool PostTask(const tracked_objects::Location& from_here, | |
| 37 const Closure& task) = 0; | |
| 38 }; | |
| 39 | |
| 40 } // namespace internal | |
| 41 } // namespace base | |
| 42 | |
| 43 #endif // BASE_THREADING_POST_TASK_AND_REPLY_IMPL_H_ | |
| OLD | NEW |