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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 // Returns the TaskAnnotator which is used to add debug information to posted | 426 // Returns the TaskAnnotator which is used to add debug information to posted |
427 // tasks. | 427 // tasks. |
428 debug::TaskAnnotator* task_annotator() { return &task_annotator_; } | 428 debug::TaskAnnotator* task_annotator() { return &task_annotator_; } |
429 | 429 |
430 // Loads tasks from the incoming queue to |work_queue_| if the latter is | 430 // Loads tasks from the incoming queue to |work_queue_| if the latter is |
431 // empty. | 431 // empty. |
432 void ReloadWorkQueue(); | 432 void ReloadWorkQueue(); |
433 | 433 |
434 // Wakes up the message pump. Can be called on any thread. The caller is | 434 // Wakes up the message pump. Can be called on any thread. The caller is |
435 // responsible for synchronizing ScheduleWork() calls. | 435 // responsible for synchronizing ScheduleWork() calls. |
436 void ScheduleWork(bool was_empty); | 436 void ScheduleWork(); |
437 | 437 |
438 // Start recording histogram info about events and action IF it was enabled | 438 // Start recording histogram info about events and action IF it was enabled |
439 // and IF the statistics recorder can accept a registration of our histogram. | 439 // and IF the statistics recorder can accept a registration of our histogram. |
440 void StartHistogrammer(); | 440 void StartHistogrammer(); |
441 | 441 |
442 // Add occurrence of event to our histogram, so that we can see what is being | 442 // Add occurrence of event to our histogram, so that we can see what is being |
443 // done in a specific MessageLoop instance (i.e., specific thread). | 443 // done in a specific MessageLoop instance (i.e., specific thread). |
444 // If message_histogram_ is NULL, this is a no-op. | 444 // If message_histogram_ is NULL, this is a no-op. |
445 void HistogramEvent(int event); | 445 void HistogramEvent(int event); |
446 | 446 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 | 650 |
651 // Do not add any member variables to MessageLoopForIO! This is important b/c | 651 // Do not add any member variables to MessageLoopForIO! This is important b/c |
652 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 652 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
653 // data that you need should be stored on the MessageLoop's pump_ instance. | 653 // data that you need should be stored on the MessageLoop's pump_ instance. |
654 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 654 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
655 MessageLoopForIO_should_not_have_extra_member_variables); | 655 MessageLoopForIO_should_not_have_extra_member_variables); |
656 | 656 |
657 } // namespace base | 657 } // namespace base |
658 | 658 |
659 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 659 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
OLD | NEW |