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

Side by Side Diff: remoting/base/auto_message_loop.cc

Issue 10829467: [Chromoting] Introducing refcount-based life time management of the message loops in the service (d… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Destructors of ref-counted objects should not be public. Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698