OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #include "remoting/jingle_glue/jingle_thread.h" | 5 #include "remoting/jingle_glue/jingle_thread.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "base/message_pump.h" | 10 #include "base/message_pump.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 stopping_ = false; | 85 stopping_ = false; |
86 thread_->Quit(); | 86 thread_->Quit(); |
87 } else { | 87 } else { |
88 thread_->Post(this, kStopMessageId); | 88 thread_->Post(this, kStopMessageId); |
89 } | 89 } |
90 } else { | 90 } else { |
91 NOTREACHED(); | 91 NOTREACHED(); |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
| 95 protected: |
| 96 virtual ~JingleMessagePump() {} |
95 | 97 |
96 private: | 98 private: |
97 void ScheduleNextDelayedTask() { | 99 void ScheduleNextDelayedTask() { |
98 if (!delayed_work_time_.is_null()) { | 100 if (!delayed_work_time_.is_null()) { |
99 base::TimeTicks now = base::TimeTicks::Now(); | 101 base::TimeTicks now = base::TimeTicks::Now(); |
100 int delay = static_cast<int>((delayed_work_time_ - now).InMilliseconds()); | 102 int delay = static_cast<int>((delayed_work_time_ - now).InMilliseconds()); |
101 if (delay > 0) { | 103 if (delay > 0) { |
102 thread_->PostDelayed(delay, this, kRunTasksMessageId); | 104 thread_->PostDelayed(delay, this, kRunTasksMessageId); |
103 } else { | 105 } else { |
104 thread_->Post(this, kRunTasksMessageId); | 106 thread_->Post(this, kRunTasksMessageId); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 195 |
194 base::MessageLoopProxy* JingleThread::message_loop_proxy() { | 196 base::MessageLoopProxy* JingleThread::message_loop_proxy() { |
195 return message_loop_proxy_; | 197 return message_loop_proxy_; |
196 } | 198 } |
197 | 199 |
198 TaskPump* JingleThread::task_pump() { | 200 TaskPump* JingleThread::task_pump() { |
199 return task_pump_; | 201 return task_pump_; |
200 } | 202 } |
201 | 203 |
202 } // namespace remoting | 204 } // namespace remoting |
OLD | NEW |