| 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 #ifndef BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
| 6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 // which connects this MessageLoop to the UI thread's CFRunLoop and allows | 607 // which connects this MessageLoop to the UI thread's CFRunLoop and allows |
| 608 // PostTask() to work. | 608 // PostTask() to work. |
| 609 void Attach(); | 609 void Attach(); |
| 610 #endif | 610 #endif |
| 611 | 611 |
| 612 #if defined(OS_ANDROID) | 612 #if defined(OS_ANDROID) |
| 613 // On Android, the UI message loop is handled by Java side. So Run() should | 613 // On Android, the UI message loop is handled by Java side. So Run() should |
| 614 // never be called. Instead use Start(), which will forward all the native UI | 614 // never be called. Instead use Start(), which will forward all the native UI |
| 615 // events to the Java message loop. | 615 // events to the Java message loop. |
| 616 void Start(); | 616 void Start(); |
| 617 void StartForTesting(WaitableEvent* test_done_event); |
| 618 // In Android there are cases where we want to abort immediately without |
| 619 // calling Quit(), in these cases we call Abort(). |
| 620 void Abort(); |
| 617 #endif | 621 #endif |
| 618 | 622 |
| 619 #if defined(USE_OZONE) || (defined(USE_X11) && !defined(USE_GLIB)) | 623 #if defined(USE_OZONE) || (defined(USE_X11) && !defined(USE_GLIB)) |
| 620 // Please see MessagePumpLibevent for definition. | 624 // Please see MessagePumpLibevent for definition. |
| 621 bool WatchFileDescriptor( | 625 bool WatchFileDescriptor( |
| 622 int fd, | 626 int fd, |
| 623 bool persistent, | 627 bool persistent, |
| 624 MessagePumpLibevent::Mode mode, | 628 MessagePumpLibevent::Mode mode, |
| 625 MessagePumpLibevent::FileDescriptorWatcher* controller, | 629 MessagePumpLibevent::FileDescriptorWatcher* controller, |
| 626 MessagePumpLibevent::Watcher* delegate); | 630 MessagePumpLibevent::Watcher* delegate); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 | 712 |
| 709 // Do not add any member variables to MessageLoopForIO! This is important b/c | 713 // Do not add any member variables to MessageLoopForIO! This is important b/c |
| 710 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 714 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
| 711 // data that you need should be stored on the MessageLoop's pump_ instance. | 715 // data that you need should be stored on the MessageLoop's pump_ instance. |
| 712 static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 716 static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
| 713 "MessageLoopForIO should not have extra member variables"); | 717 "MessageLoopForIO should not have extra member variables"); |
| 714 | 718 |
| 715 } // namespace base | 719 } // namespace base |
| 716 | 720 |
| 717 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 721 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
| OLD | NEW |