OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // The Android UI message loop needs to get notified each time a task is added | 93 // The Android UI message loop needs to get notified each time a task is added |
94 // to the incoming queue. | 94 // to the incoming queue. |
95 return type == MessageLoop::TYPE_UI || type == MessageLoop::TYPE_JAVA; | 95 return type == MessageLoop::TYPE_UI || type == MessageLoop::TYPE_JAVA; |
96 #else | 96 #else |
97 return false; | 97 return false; |
98 #endif | 98 #endif |
99 } | 99 } |
100 | 100 |
101 #if defined(OS_IOS) | 101 #if defined(OS_IOS) |
102 typedef MessagePumpIOSForIO MessagePumpForIO; | 102 typedef MessagePumpIOSForIO MessagePumpForIO; |
103 #elif defined(OS_NACL) | 103 #elif defined(OS_NACL) && !defined(__native_client_nonsfi__) |
104 typedef MessagePumpDefault MessagePumpForIO; | 104 typedef MessagePumpDefault MessagePumpForIO; |
105 #elif defined(OS_POSIX) | 105 #elif defined(OS_POSIX) |
106 typedef MessagePumpLibevent MessagePumpForIO; | 106 typedef MessagePumpLibevent MessagePumpForIO; |
107 #endif | 107 #endif |
108 | 108 |
109 MessagePumpForIO* ToPumpIO(MessagePump* pump) { | 109 MessagePumpForIO* ToPumpIO(MessagePump* pump) { |
110 return static_cast<MessagePumpForIO*>(pump); | 110 return static_cast<MessagePumpForIO*>(pump); |
111 } | 111 } |
112 | 112 |
113 } // namespace | 113 } // namespace |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 controller, | 669 controller, |
670 delegate); | 670 delegate); |
671 } | 671 } |
672 #endif | 672 #endif |
673 | 673 |
674 #endif // !defined(OS_NACL) | 674 #endif // !defined(OS_NACL) |
675 | 675 |
676 //------------------------------------------------------------------------------ | 676 //------------------------------------------------------------------------------ |
677 // MessageLoopForIO | 677 // MessageLoopForIO |
678 | 678 |
679 #if !defined(OS_NACL) | 679 #if !defined(OS_NACL) || defined(__native_client_nonsfi__) |
680 void MessageLoopForIO::AddIOObserver( | 680 void MessageLoopForIO::AddIOObserver( |
681 MessageLoopForIO::IOObserver* io_observer) { | 681 MessageLoopForIO::IOObserver* io_observer) { |
682 ToPumpIO(pump_.get())->AddIOObserver(io_observer); | 682 ToPumpIO(pump_.get())->AddIOObserver(io_observer); |
683 } | 683 } |
684 | 684 |
685 void MessageLoopForIO::RemoveIOObserver( | 685 void MessageLoopForIO::RemoveIOObserver( |
686 MessageLoopForIO::IOObserver* io_observer) { | 686 MessageLoopForIO::IOObserver* io_observer) { |
687 ToPumpIO(pump_.get())->RemoveIOObserver(io_observer); | 687 ToPumpIO(pump_.get())->RemoveIOObserver(io_observer); |
688 } | 688 } |
689 | 689 |
(...skipping 17 matching lines...) Expand all Loading... |
707 Watcher *delegate) { | 707 Watcher *delegate) { |
708 return ToPumpIO(pump_.get())->WatchFileDescriptor( | 708 return ToPumpIO(pump_.get())->WatchFileDescriptor( |
709 fd, | 709 fd, |
710 persistent, | 710 persistent, |
711 mode, | 711 mode, |
712 controller, | 712 controller, |
713 delegate); | 713 delegate); |
714 } | 714 } |
715 #endif | 715 #endif |
716 | 716 |
717 #endif // !defined(OS_NACL) | 717 #endif // !defined(OS_NACL) || defined(__native_client_nonsfi__) |
718 | 718 |
719 } // namespace base | 719 } // namespace base |
OLD | NEW |