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 #ifndef BASE_MESSAGE_LOOP_H_ | 5 #ifndef BASE_MESSAGE_LOOP_H_ |
6 #define BASE_MESSAGE_LOOP_H_ | 6 #define BASE_MESSAGE_LOOP_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "base/time.h" | 23 #include "base/time.h" |
24 | 24 |
25 #if defined(OS_WIN) | 25 #if defined(OS_WIN) |
26 // We need this to declare base::MessagePumpWin::Dispatcher, which we should | 26 // We need this to declare base::MessagePumpWin::Dispatcher, which we should |
27 // really just eliminate. | 27 // really just eliminate. |
28 #include "base/message_pump_win.h" | 28 #include "base/message_pump_win.h" |
29 #elif defined(OS_POSIX) | 29 #elif defined(OS_POSIX) |
30 #include "base/message_pump_libevent.h" | 30 #include "base/message_pump_libevent.h" |
31 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) | 31 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
32 | 32 |
33 #if defined(USE_AURA) && !defined(OS_NACL) | 33 #if defined(USE_AURA) && defined(USE_X11) && !defined(OS_NACL) |
34 #include "base/message_pump_aurax11.h" | 34 #include "base/message_pump_aurax11.h" |
35 #else | 35 #else |
36 #include "base/message_pump_gtk.h" | 36 #include "base/message_pump_gtk.h" |
37 #endif | 37 #endif |
38 | 38 |
39 #endif | 39 #endif |
40 #endif | 40 #endif |
41 | 41 |
42 namespace base { | 42 namespace base { |
43 class Histogram; | 43 class Histogram; |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 // never be called. Instead use Start(), which will forward all the native UI | 564 // never be called. Instead use Start(), which will forward all the native UI |
565 // events to the Java message loop. | 565 // events to the Java message loop. |
566 void Start(); | 566 void Start(); |
567 #elif !defined(OS_MACOSX) | 567 #elif !defined(OS_MACOSX) |
568 // Please see message_pump_win/message_pump_glib for definitions of these | 568 // Please see message_pump_win/message_pump_glib for definitions of these |
569 // methods. | 569 // methods. |
570 void AddObserver(Observer* observer); | 570 void AddObserver(Observer* observer); |
571 void RemoveObserver(Observer* observer); | 571 void RemoveObserver(Observer* observer); |
572 | 572 |
573 protected: | 573 protected: |
| 574 #if defined(USE_AURA) && defined(USE_X11) && !defined(OS_NACL) |
| 575 friend class base::MessagePumpAuraX11; |
| 576 #endif |
| 577 |
574 // TODO(rvargas): Make this platform independent. | 578 // TODO(rvargas): Make this platform independent. |
575 base::MessagePumpForUI* pump_ui() { | 579 base::MessagePumpForUI* pump_ui() { |
576 return static_cast<base::MessagePumpForUI*>(pump_.get()); | 580 return static_cast<base::MessagePumpForUI*>(pump_.get()); |
577 } | 581 } |
578 #endif // !defined(OS_MACOSX) | 582 #endif // !defined(OS_MACOSX) |
579 }; | 583 }; |
580 | 584 |
581 // Do not add any member variables to MessageLoopForUI! This is important b/c | 585 // Do not add any member variables to MessageLoopForUI! This is important b/c |
582 // MessageLoopForUI is often allocated via MessageLoop(TYPE_UI). Any extra | 586 // MessageLoopForUI is often allocated via MessageLoop(TYPE_UI). Any extra |
583 // data that you need should be stored on the MessageLoop's pump_ instance. | 587 // data that you need should be stored on the MessageLoop's pump_ instance. |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 #endif // defined(OS_POSIX) | 659 #endif // defined(OS_POSIX) |
656 }; | 660 }; |
657 | 661 |
658 // Do not add any member variables to MessageLoopForIO! This is important b/c | 662 // Do not add any member variables to MessageLoopForIO! This is important b/c |
659 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 663 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
660 // data that you need should be stored on the MessageLoop's pump_ instance. | 664 // data that you need should be stored on the MessageLoop's pump_ instance. |
661 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 665 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
662 MessageLoopForIO_should_not_have_extra_member_variables); | 666 MessageLoopForIO_should_not_have_extra_member_variables); |
663 | 667 |
664 #endif // BASE_MESSAGE_LOOP_H_ | 668 #endif // BASE_MESSAGE_LOOP_H_ |
OLD | NEW |