Chromium Code Reviews| Index: remoting/protocol/ref_counted_task.h |
| diff --git a/remoting/protocol/ref_counted_message.h b/remoting/protocol/ref_counted_task.h |
| similarity index 78% |
| rename from remoting/protocol/ref_counted_message.h |
| rename to remoting/protocol/ref_counted_task.h |
| index 24a8b52c41844e4de3c02c4f17a8ea0aff84c084..618b37f210cecad4ed7d92b633e324a7bd0d0942 100644 |
| --- a/remoting/protocol/ref_counted_message.h |
| +++ b/remoting/protocol/ref_counted_task.h |
| @@ -8,26 +8,28 @@ |
| // A single protobuf can contain multiple messages that will be handled by |
| // different message handlers. We use this wrapper to ensure that the |
| -// protobuf is only deleted after all the handlers have finished executing. |
| +// done_task is only called after all the handlers have finished executing. |
| #ifndef REMOTING_PROTOCOL_REF_COUNTED_MESSAGE_H_ |
| #define REMOTING_PROTOCOL_REF_COUNTED_MESSAGE_H_ |
| #include "base/ref_counted.h" |
| #include "base/task.h" |
| +#include "base/scoped_ptr.h" |
| namespace remoting { |
| namespace protocol { |
| -template <typename T> |
| -class RefCountedMessage : public base::RefCounted<RefCountedMessage<T> > { |
| +class RefCountedTask : public base::RefCounted<RefCountedTask> { |
|
awong
2011/01/19 02:12:48
I'm not sure I completely agree with having this c
Sergey Ulanov
2011/01/19 20:07:00
ScopedRunnableMethodFactory can't be used here bec
|
| public: |
| - RefCountedMessage(T* message) : message_(message) { } |
| - |
| - T* message() { return message_.get(); } |
| + RefCountedTask(Task* task); |
| private: |
| - scoped_ptr<T> message_; |
| + friend class base::RefCounted<RefCountedTask>; |
| + |
| + virtual ~RefCountedTask(); |
| + |
| + scoped_ptr<Task> task_; |
| }; |
| // Dummy methods to destroy messages. |