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; | |
451 | 449 |
452 const Type type_; | 450 const Type type_; |
453 | 451 |
454 // A list of tasks that need to be processed by this instance. Note that | 452 // A list of tasks that need to be processed by this instance. Note that |
455 // this queue is only accessed (push/pop) by our current thread. | 453 // this queue is only accessed (push/pop) by our current thread. |
456 TaskQueue work_queue_; | 454 TaskQueue work_queue_; |
457 | 455 |
458 // Contains delayed tasks, sorted by their 'delayed_run_time' property. | 456 // Contains delayed tasks, sorted by their 'delayed_run_time' property. |
459 DelayedTaskQueue delayed_work_queue_; | 457 DelayedTaskQueue delayed_work_queue_; |
460 | 458 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 | 646 |
649 // Do not add any member variables to MessageLoopForIO! This is important b/c | 647 // Do not add any member variables to MessageLoopForIO! This is important b/c |
650 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 648 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
651 // data that you need should be stored on the MessageLoop's pump_ instance. | 649 // data that you need should be stored on the MessageLoop's pump_ instance. |
652 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 650 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
653 MessageLoopForIO_should_not_have_extra_member_variables); | 651 MessageLoopForIO_should_not_have_extra_member_variables); |
654 | 652 |
655 } // namespace base | 653 } // namespace base |
656 | 654 |
657 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 655 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
OLD | NEW |