Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: base/message_loop/message_loop.h

Issue 235043005: x11: Remove X11 message-pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/base.gypi ('k') | base/message_loop/message_pump_glib.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 10
(...skipping 16 matching lines...) Expand all
27 27
28 // TODO(sky): these includes should not be necessary. Nuke them. 28 // TODO(sky): these includes should not be necessary. Nuke them.
29 #if defined(OS_WIN) 29 #if defined(OS_WIN)
30 #include "base/message_loop/message_pump_win.h" 30 #include "base/message_loop/message_pump_win.h"
31 #elif defined(OS_IOS) 31 #elif defined(OS_IOS)
32 #include "base/message_loop/message_pump_io_ios.h" 32 #include "base/message_loop/message_pump_io_ios.h"
33 #elif defined(OS_POSIX) 33 #elif defined(OS_POSIX)
34 #include "base/message_loop/message_pump_libevent.h" 34 #include "base/message_loop/message_pump_libevent.h"
35 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) 35 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
36 36
37 #if defined(USE_AURA) && defined(USE_X11) && !defined(OS_NACL) 37 #if defined(USE_GLIB) && !defined(OS_NACL)
38 #include "base/message_loop/message_pump_x11.h" 38 #include "base/message_loop/message_pump_glib.h"
39 #elif !defined(OS_ANDROID_HOST) 39 #elif !defined(OS_ANDROID_HOST)
40 #define USE_GTK_MESSAGE_PUMP 40 #include "base/message_loop/message_pump_glib.h"
41 #include "base/message_loop/message_pump_gtk.h"
42 #if defined(TOOLKIT_GTK)
43 #include "base/message_loop/message_pump_x11.h"
44 #endif
45 #endif 41 #endif
46 42
47 #endif 43 #endif
48 #endif 44 #endif
49 45
50 namespace base { 46 namespace base {
51 47
52 class HistogramBase; 48 class HistogramBase;
53 class MessagePumpObserver; 49 class MessagePumpObserver;
54 class RunLoop; 50 class RunLoop;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // } 84 // }
89 // // Process |hr| (the result returned by DoDragDrop()). 85 // // Process |hr| (the result returned by DoDragDrop()).
90 // 86 //
91 // Please be SURE your task is reentrant (nestable) and all global variables 87 // Please be SURE your task is reentrant (nestable) and all global variables
92 // are stable and accessible before calling SetNestableTasksAllowed(true). 88 // are stable and accessible before calling SetNestableTasksAllowed(true).
93 // 89 //
94 class BASE_EXPORT MessageLoop : public MessagePump::Delegate { 90 class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
95 public: 91 public:
96 #if defined(OS_WIN) 92 #if defined(OS_WIN)
97 typedef MessagePumpObserver Observer; 93 typedef MessagePumpObserver Observer;
98 #elif defined(USE_GTK_MESSAGE_PUMP)
99 typedef MessagePumpGdkObserver Observer;
100 #endif 94 #endif
101 95
102 // A MessageLoop has a particular type, which indicates the set of 96 // A MessageLoop has a particular type, which indicates the set of
103 // asynchronous events it may process in addition to tasks and timers. 97 // asynchronous events it may process in addition to tasks and timers.
104 // 98 //
105 // TYPE_DEFAULT 99 // TYPE_DEFAULT
106 // This type of ML only supports tasks and timers. 100 // This type of ML only supports tasks and timers.
107 // 101 //
108 // TYPE_UI 102 // TYPE_UI
109 // This type of ML also supports native UI events (e.g., Windows messages). 103 // This type of ML also supports native UI events (e.g., Windows messages).
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 protected: 400 protected:
407 401
408 #if defined(OS_WIN) 402 #if defined(OS_WIN)
409 MessagePumpWin* pump_win() { 403 MessagePumpWin* pump_win() {
410 return static_cast<MessagePumpWin*>(pump_.get()); 404 return static_cast<MessagePumpWin*>(pump_.get());
411 } 405 }
412 #elif defined(OS_POSIX) && !defined(OS_IOS) 406 #elif defined(OS_POSIX) && !defined(OS_IOS)
413 MessagePumpLibevent* pump_libevent() { 407 MessagePumpLibevent* pump_libevent() {
414 return static_cast<MessagePumpLibevent*>(pump_.get()); 408 return static_cast<MessagePumpLibevent*>(pump_.get());
415 } 409 }
416 #if defined(TOOLKIT_GTK)
417 friend class MessagePumpX11;
418 MessagePumpX11* pump_gpu() {
419 DCHECK_EQ(TYPE_GPU, type());
420 return static_cast<MessagePumpX11*>(pump_.get());
421 }
422 #endif
423 #endif 410 #endif
424 411
425 scoped_ptr<MessagePump> pump_; 412 scoped_ptr<MessagePump> pump_;
426 413
427 private: 414 private:
428 friend class internal::IncomingTaskQueue; 415 friend class internal::IncomingTaskQueue;
429 friend class RunLoop; 416 friend class RunLoop;
430 417
431 // Configures various members for the two constructors. 418 // Configures various members for the two constructors.
432 void Init(); 419 void Init();
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 // Please see MessagePumpLibevent for definition. 573 // Please see MessagePumpLibevent for definition.
587 bool WatchFileDescriptor( 574 bool WatchFileDescriptor(
588 int fd, 575 int fd,
589 bool persistent, 576 bool persistent,
590 MessagePumpLibevent::Mode mode, 577 MessagePumpLibevent::Mode mode,
591 MessagePumpLibevent::FileDescriptorWatcher* controller, 578 MessagePumpLibevent::FileDescriptorWatcher* controller,
592 MessagePumpLibevent::Watcher* delegate); 579 MessagePumpLibevent::Watcher* delegate);
593 #endif 580 #endif
594 581
595 protected: 582 protected:
596 #if defined(USE_X11)
597 friend class MessagePumpX11;
598 #endif
599
600 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) 583 #if !defined(OS_MACOSX) && !defined(OS_ANDROID)
601 // TODO(rvargas): Make this platform independent. 584 // TODO(rvargas): Make this platform independent.
602 MessagePumpForUI* pump_ui() { 585 MessagePumpForUI* pump_ui() {
603 return static_cast<MessagePumpForUI*>(pump_.get()); 586 return static_cast<MessagePumpForUI*>(pump_.get());
604 } 587 }
605 #endif 588 #endif
606 }; 589 };
607 590
608 // Do not add any member variables to MessageLoopForUI! This is important b/c 591 // Do not add any member variables to MessageLoopForUI! This is important b/c
609 // MessageLoopForUI is often allocated via MessageLoop(TYPE_UI). Any extra 592 // MessageLoopForUI is often allocated via MessageLoop(TYPE_UI). Any extra
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 697
715 // Do not add any member variables to MessageLoopForIO! This is important b/c 698 // Do not add any member variables to MessageLoopForIO! This is important b/c
716 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra 699 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra
717 // data that you need should be stored on the MessageLoop's pump_ instance. 700 // data that you need should be stored on the MessageLoop's pump_ instance.
718 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), 701 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO),
719 MessageLoopForIO_should_not_have_extra_member_variables); 702 MessageLoopForIO_should_not_have_extra_member_variables);
720 703
721 } // namespace base 704 } // namespace base
722 705
723 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ 706 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_
OLDNEW
« no previous file with comments | « base/base.gypi ('k') | base/message_loop/message_pump_glib.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698