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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 // Start recording histogram info about events and action IF it was enabled | 437 // Start recording histogram info about events and action IF it was enabled |
438 // and IF the statistics recorder can accept a registration of our histogram. | 438 // and IF the statistics recorder can accept a registration of our histogram. |
439 void StartHistogrammer(); | 439 void StartHistogrammer(); |
440 | 440 |
441 // Add occurrence of event to our histogram, so that we can see what is being | 441 // Add occurrence of event to our histogram, so that we can see what is being |
442 // done in a specific MessageLoop instance (i.e., specific thread). | 442 // done in a specific MessageLoop instance (i.e., specific thread). |
443 // If message_histogram_ is NULL, this is a no-op. | 443 // If message_histogram_ is NULL, this is a no-op. |
444 void HistogramEvent(int event); | 444 void HistogramEvent(int event); |
445 | 445 |
446 // MessagePump::Delegate methods: | 446 // MessagePump::Delegate methods: |
447 virtual bool DoWork() OVERRIDE; | 447 bool DoWork() override; |
448 virtual bool DoDelayedWork(TimeTicks* next_delayed_work_time) OVERRIDE; | 448 bool DoDelayedWork(TimeTicks* next_delayed_work_time) override; |
449 virtual bool DoIdleWork() OVERRIDE; | 449 bool DoIdleWork() override; |
450 | 450 |
451 const Type type_; | 451 const Type type_; |
452 | 452 |
453 // A list of tasks that need to be processed by this instance. Note that | 453 // A list of tasks that need to be processed by this instance. Note that |
454 // this queue is only accessed (push/pop) by our current thread. | 454 // this queue is only accessed (push/pop) by our current thread. |
455 TaskQueue work_queue_; | 455 TaskQueue work_queue_; |
456 | 456 |
457 // How many high resolution tasks are in the pending task queue. This value | 457 // How many high resolution tasks are in the pending task queue. This value |
458 // increases by N every time we call ReloadWorkQueue() and decreases by 1 | 458 // increases by N every time we call ReloadWorkQueue() and decreases by 1 |
459 // every time we call RunTask() if the task needs a high resolution timer. | 459 // every time we call RunTask() if the task needs a high resolution timer. |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 | 649 |
650 // Do not add any member variables to MessageLoopForIO! This is important b/c | 650 // Do not add any member variables to MessageLoopForIO! This is important b/c |
651 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 651 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
652 // data that you need should be stored on the MessageLoop's pump_ instance. | 652 // data that you need should be stored on the MessageLoop's pump_ instance. |
653 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 653 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
654 MessageLoopForIO_should_not_have_extra_member_variables); | 654 MessageLoopForIO_should_not_have_extra_member_variables); |
655 | 655 |
656 } // namespace base | 656 } // namespace base |
657 | 657 |
658 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 658 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
OLD | NEW |