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 "base/message_loop/message_pump_glib.h" | 5 #include "base/message_loop/message_pump_glib.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <math.h> | 8 #include <math.h> |
9 | 9 |
10 #include <glib.h> | 10 #include <glib.h> |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 } | 313 } |
314 } | 314 } |
315 | 315 |
316 void MessagePumpGlib::ScheduleDelayedWork(const TimeTicks& delayed_work_time) { | 316 void MessagePumpGlib::ScheduleDelayedWork(const TimeTicks& delayed_work_time) { |
317 // We need to wake up the loop in case the poll timeout needs to be | 317 // We need to wake up the loop in case the poll timeout needs to be |
318 // adjusted. This will cause us to try to do work, but that's ok. | 318 // adjusted. This will cause us to try to do work, but that's ok. |
319 delayed_work_time_ = delayed_work_time; | 319 delayed_work_time_ = delayed_work_time; |
320 ScheduleWork(); | 320 ScheduleWork(); |
321 } | 321 } |
322 | 322 |
323 void MessagePumpGlib::Shutdown() { | |
324 } | |
325 | |
326 MessagePumpGlib::~MessagePumpGlib() { | 323 MessagePumpGlib::~MessagePumpGlib() { |
327 g_source_destroy(work_source_); | 324 g_source_destroy(work_source_); |
328 g_source_unref(work_source_); | 325 g_source_unref(work_source_); |
329 close(wakeup_pipe_read_); | 326 close(wakeup_pipe_read_); |
330 close(wakeup_pipe_write_); | 327 close(wakeup_pipe_write_); |
331 } | 328 } |
332 | 329 |
333 MessagePumpDispatcher* MessagePumpGlib::GetDispatcher() { | 330 MessagePumpDispatcher* MessagePumpGlib::GetDispatcher() { |
334 return state_ ? state_->dispatcher : NULL; | 331 return state_ ? state_->dispatcher : NULL; |
335 } | 332 } |
336 | 333 |
337 } // namespace base | 334 } // namespace base |
OLD | NEW |