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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 | 471 |
472 // Add occurrence of event to our histogram, so that we can see what is being | 472 // Add occurrence of event to our histogram, so that we can see what is being |
473 // done in a specific MessageLoop instance (i.e., specific thread). | 473 // done in a specific MessageLoop instance (i.e., specific thread). |
474 // If message_histogram_ is NULL, this is a no-op. | 474 // If message_histogram_ is NULL, this is a no-op. |
475 void HistogramEvent(int event); | 475 void HistogramEvent(int event); |
476 | 476 |
477 // MessagePump::Delegate methods: | 477 // MessagePump::Delegate methods: |
478 virtual bool DoWork() OVERRIDE; | 478 virtual bool DoWork() OVERRIDE; |
479 virtual bool DoDelayedWork(TimeTicks* next_delayed_work_time) OVERRIDE; | 479 virtual bool DoDelayedWork(TimeTicks* next_delayed_work_time) OVERRIDE; |
480 virtual bool DoIdleWork() OVERRIDE; | 480 virtual bool DoIdleWork() OVERRIDE; |
| 481 virtual void GetQueueingInformation(size_t* queue_size, |
| 482 TimeDelta* queueing_delay) OVERRIDE; |
481 | 483 |
482 Type type_; | 484 Type type_; |
483 | 485 |
484 // A list of tasks that need to be processed by this instance. Note that | 486 // A list of tasks that need to be processed by this instance. Note that |
485 // this queue is only accessed (push/pop) by our current thread. | 487 // this queue is only accessed (push/pop) by our current thread. |
486 TaskQueue work_queue_; | 488 TaskQueue work_queue_; |
487 | 489 |
488 // Contains delayed tasks, sorted by their 'delayed_run_time' property. | 490 // Contains delayed tasks, sorted by their 'delayed_run_time' property. |
489 DelayedTaskQueue delayed_work_queue_; | 491 DelayedTaskQueue delayed_work_queue_; |
490 | 492 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 | 712 |
711 // Do not add any member variables to MessageLoopForIO! This is important b/c | 713 // Do not add any member variables to MessageLoopForIO! This is important b/c |
712 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 714 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
713 // data that you need should be stored on the MessageLoop's pump_ instance. | 715 // data that you need should be stored on the MessageLoop's pump_ instance. |
714 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 716 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
715 MessageLoopForIO_should_not_have_extra_member_variables); | 717 MessageLoopForIO_should_not_have_extra_member_variables); |
716 | 718 |
717 } // namespace base | 719 } // namespace base |
718 | 720 |
719 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 721 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
OLD | NEW |