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_pump_glib.h" | 5 #include "base/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> |
11 | 11 |
12 #include "base/eintr_wrapper.h" | |
13 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/posix/eintr_wrapper.h" |
14 #include "base/threading/platform_thread.h" | 14 #include "base/threading/platform_thread.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 // Return a timeout suitable for the glib loop, -1 to block forever, | 18 // Return a timeout suitable for the glib loop, -1 to block forever, |
19 // 0 to return right away, or a timeout in milliseconds from now. | 19 // 0 to return right away, or a timeout in milliseconds from now. |
20 int GetTimeIntervalMilliseconds(const base::TimeTicks& from) { | 20 int GetTimeIntervalMilliseconds(const base::TimeTicks& from) { |
21 if (from.is_null()) | 21 if (from.is_null()) |
22 return -1; | 22 return -1; |
23 | 23 |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 g_source_unref(work_source_); | 321 g_source_unref(work_source_); |
322 close(wakeup_pipe_read_); | 322 close(wakeup_pipe_read_); |
323 close(wakeup_pipe_write_); | 323 close(wakeup_pipe_write_); |
324 } | 324 } |
325 | 325 |
326 MessagePumpDispatcher* MessagePumpGlib::GetDispatcher() { | 326 MessagePumpDispatcher* MessagePumpGlib::GetDispatcher() { |
327 return state_ ? state_->dispatcher : NULL; | 327 return state_ ? state_->dispatcher : NULL; |
328 } | 328 } |
329 | 329 |
330 } // namespace base | 330 } // namespace base |
OLD | NEW |