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 <queue> | 8 #include <queue> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 } | 579 } |
580 | 580 |
581 // Returns the MessageLoopForUI of the current thread. | 581 // Returns the MessageLoopForUI of the current thread. |
582 static MessageLoopForUI* current() { | 582 static MessageLoopForUI* current() { |
583 MessageLoop* loop = MessageLoop::current(); | 583 MessageLoop* loop = MessageLoop::current(); |
584 DCHECK(loop); | 584 DCHECK(loop); |
585 DCHECK_EQ(MessageLoop::TYPE_UI, loop->type()); | 585 DCHECK_EQ(MessageLoop::TYPE_UI, loop->type()); |
586 return static_cast<MessageLoopForUI*>(loop); | 586 return static_cast<MessageLoopForUI*>(loop); |
587 } | 587 } |
588 | 588 |
589 #if defined(OS_WIN) | |
590 void DidProcessMessage(const MSG& message); | |
591 #endif // defined(OS_WIN) | |
592 | |
593 #if defined(OS_IOS) | 589 #if defined(OS_IOS) |
594 // On iOS, the main message loop cannot be Run(). Instead call Attach(), | 590 // On iOS, the main message loop cannot be Run(). Instead call Attach(), |
595 // which connects this MessageLoop to the UI thread's CFRunLoop and allows | 591 // which connects this MessageLoop to the UI thread's CFRunLoop and allows |
596 // PostTask() to work. | 592 // PostTask() to work. |
597 void Attach(); | 593 void Attach(); |
598 #endif | 594 #endif |
599 | 595 |
600 #if defined(OS_ANDROID) | 596 #if defined(OS_ANDROID) |
601 // On Android, the UI message loop is handled by Java side. So Run() should | 597 // On Android, the UI message loop is handled by Java side. So Run() should |
602 // never be called. Instead use Start(), which will forward all the native UI | 598 // never be called. Instead use Start(), which will forward all the native UI |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
735 | 731 |
736 // Do not add any member variables to MessageLoopForIO! This is important b/c | 732 // Do not add any member variables to MessageLoopForIO! This is important b/c |
737 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 733 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
738 // data that you need should be stored on the MessageLoop's pump_ instance. | 734 // data that you need should be stored on the MessageLoop's pump_ instance. |
739 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 735 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
740 MessageLoopForIO_should_not_have_extra_member_variables); | 736 MessageLoopForIO_should_not_have_extra_member_variables); |
741 | 737 |
742 } // namespace base | 738 } // namespace base |
743 | 739 |
744 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 740 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
OLD | NEW |