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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 | 439 |
440 // Add occurrence of event to our histogram, so that we can see what is being | 440 // Add occurrence of event to our histogram, so that we can see what is being |
441 // done in a specific MessageLoop instance (i.e., specific thread). | 441 // done in a specific MessageLoop instance (i.e., specific thread). |
442 // If message_histogram_ is NULL, this is a no-op. | 442 // If message_histogram_ is NULL, this is a no-op. |
443 void HistogramEvent(int event); | 443 void HistogramEvent(int event); |
444 | 444 |
445 // MessagePump::Delegate methods: | 445 // MessagePump::Delegate methods: |
446 virtual bool DoWork() OVERRIDE; | 446 virtual bool DoWork() OVERRIDE; |
447 virtual bool DoDelayedWork(TimeTicks* next_delayed_work_time) OVERRIDE; | 447 virtual bool DoDelayedWork(TimeTicks* next_delayed_work_time) OVERRIDE; |
448 virtual bool DoIdleWork() OVERRIDE; | 448 virtual bool DoIdleWork() OVERRIDE; |
| 449 virtual void GetQueueingInformation(size_t* queue_size, |
| 450 TimeDelta* queueing_delay) OVERRIDE; |
449 | 451 |
450 const Type type_; | 452 const Type type_; |
451 | 453 |
452 // A list of tasks that need to be processed by this instance. Note that | 454 // A list of tasks that need to be processed by this instance. Note that |
453 // this queue is only accessed (push/pop) by our current thread. | 455 // this queue is only accessed (push/pop) by our current thread. |
454 TaskQueue work_queue_; | 456 TaskQueue work_queue_; |
455 | 457 |
456 // Contains delayed tasks, sorted by their 'delayed_run_time' property. | 458 // Contains delayed tasks, sorted by their 'delayed_run_time' property. |
457 DelayedTaskQueue delayed_work_queue_; | 459 DelayedTaskQueue delayed_work_queue_; |
458 | 460 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 | 648 |
647 // Do not add any member variables to MessageLoopForIO! This is important b/c | 649 // Do not add any member variables to MessageLoopForIO! This is important b/c |
648 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 650 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
649 // data that you need should be stored on the MessageLoop's pump_ instance. | 651 // data that you need should be stored on the MessageLoop's pump_ instance. |
650 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 652 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
651 MessageLoopForIO_should_not_have_extra_member_variables); | 653 MessageLoopForIO_should_not_have_extra_member_variables); |
652 | 654 |
653 } // namespace base | 655 } // namespace base |
654 | 656 |
655 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 657 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
OLD | NEW |