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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
383 // Returns true if the message loop is "idle". Provided for testing. | 383 // Returns true if the message loop is "idle". Provided for testing. |
384 bool IsIdleForTesting(); | 384 bool IsIdleForTesting(); |
385 | 385 |
386 // Returns the TaskAnnotator which is used to add debug information to posted | 386 // Returns the TaskAnnotator which is used to add debug information to posted |
387 // tasks. | 387 // tasks. |
388 debug::TaskAnnotator* task_annotator() { return &task_annotator_; } | 388 debug::TaskAnnotator* task_annotator() { return &task_annotator_; } |
389 | 389 |
390 // Runs the specified PendingTask. | 390 // Runs the specified PendingTask. |
391 void RunTask(const PendingTask& pending_task); | 391 void RunTask(const PendingTask& pending_task); |
392 | 392 |
393 #if defined(OS_WIN) | |
394 // TODO (stanisc): crbug.com/596190: Remove this after the signaling issue | |
brucedawson
2016/06/17 18:24:44
Is this comment about removal still needed? That i
| |
395 // has been investigated. | |
396 // This should be used for diagnostic only. If message pump wake-up mechanism | |
397 // is based on auto-reset event this call would reset the event to unset | |
398 // state. | |
399 bool MessagePumpWasSignaled(); | |
400 #endif | |
401 | |
393 //---------------------------------------------------------------------------- | 402 //---------------------------------------------------------------------------- |
394 protected: | 403 protected: |
395 std::unique_ptr<MessagePump> pump_; | 404 std::unique_ptr<MessagePump> pump_; |
396 | 405 |
397 using MessagePumpFactoryCallback = Callback<std::unique_ptr<MessagePump>()>; | 406 using MessagePumpFactoryCallback = Callback<std::unique_ptr<MessagePump>()>; |
398 | 407 |
399 // Common protected constructor. Other constructors delegate the | 408 // Common protected constructor. Other constructors delegate the |
400 // initialization to this constructor. | 409 // initialization to this constructor. |
401 // A subclass can invoke this constructor to create a message_loop of a | 410 // A subclass can invoke this constructor to create a message_loop of a |
402 // specific type with a custom loop. The implementation does not call | 411 // specific type with a custom loop. The implementation does not call |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
681 | 690 |
682 // Do not add any member variables to MessageLoopForIO! This is important b/c | 691 // Do not add any member variables to MessageLoopForIO! This is important b/c |
683 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 692 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
684 // data that you need should be stored on the MessageLoop's pump_ instance. | 693 // data that you need should be stored on the MessageLoop's pump_ instance. |
685 static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 694 static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
686 "MessageLoopForIO should not have extra member variables"); | 695 "MessageLoopForIO should not have extra member variables"); |
687 | 696 |
688 } // namespace base | 697 } // namespace base |
689 | 698 |
690 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 699 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
OLD | NEW |