Chromium Code Reviews| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 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 #include "remoting/base/auto_message_loop.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 | |
| 9 namespace remoting { | |
| 10 | |
| 11 AutoMessageLoop::AutoMessageLoop(MessageLoop* message_loop) | |
| 12 : message_loop_(message_loop) { | |
| 13 } | |
| 14 | |
| 15 bool AutoMessageLoop::PostDelayedTask( | |
| 16 const tracked_objects::Location& from_here, | |
| 17 const base::Closure& task, | |
| 18 base::TimeDelta delay) { | |
| 19 message_loop_->PostDelayedTask(from_here, task, delay); | |
| 20 return true; | |
| 21 } | |
| 22 | |
| 23 bool AutoMessageLoop::PostNonNestableDelayedTask( | |
| 24 const tracked_objects::Location& from_here, | |
| 25 const base::Closure& task, | |
| 26 base::TimeDelta delay) { | |
| 27 message_loop_->PostNonNestableDelayedTask(from_here, task, delay); | |
| 28 return true; | |
| 29 } | |
| 30 | |
| 31 bool AutoMessageLoop::RunsTasksOnCurrentThread() const { | |
| 32 return MessageLoop::current() == message_loop_; | |
| 33 } | |
| 34 | |
| 35 void AutoMessageLoop::OnDestruct() const { | |
| 36 // Deletes |this| on the message loop and exists the loop. | |
| 
 
Wez
2012/08/24 21:30:49
typo: exits
 
alexeypa (please no reviews)
2012/08/27 21:19:40
Done.
 
 | |
| 37 message_loop_->DeleteSoon(FROM_HERE, this); | |
| 38 message_loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | |
| 39 } | |
| 40 | |
| 41 AutoMessageLoop::~AutoMessageLoop() { | |
| 42 } | |
| 43 | |
| 44 } // namespace remoting | |
| OLD | NEW |