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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 | 468 |
469 // Add occurrence of event to our histogram, so that we can see what is being | 469 // Add occurrence of event to our histogram, so that we can see what is being |
470 // done in a specific MessageLoop instance (i.e., specific thread). | 470 // done in a specific MessageLoop instance (i.e., specific thread). |
471 // If message_histogram_ is NULL, this is a no-op. | 471 // If message_histogram_ is NULL, this is a no-op. |
472 void HistogramEvent(int event); | 472 void HistogramEvent(int event); |
473 | 473 |
474 // MessagePump::Delegate methods: | 474 // MessagePump::Delegate methods: |
475 bool DoWork() override; | 475 bool DoWork() override; |
476 bool DoDelayedWork(TimeTicks* next_delayed_work_time) override; | 476 bool DoDelayedWork(TimeTicks* next_delayed_work_time) override; |
477 bool DoIdleWork() override; | 477 bool DoIdleWork() override; |
| 478 TimeTicks GetNewlyAddedTaskDelay() override; |
478 | 479 |
479 const Type type_; | 480 const Type type_; |
480 | 481 |
481 // A list of tasks that need to be processed by this instance. Note that | 482 // A list of tasks that need to be processed by this instance. Note that |
482 // this queue is only accessed (push/pop) by our current thread. | 483 // this queue is only accessed (push/pop) by our current thread. |
483 TaskQueue work_queue_; | 484 TaskQueue work_queue_; |
484 | 485 |
485 #if defined(OS_WIN) | 486 #if defined(OS_WIN) |
486 // How many high resolution tasks are in the pending task queue. This value | 487 // How many high resolution tasks are in the pending task queue. This value |
487 // increases by N every time we call ReloadWorkQueue() and decreases by 1 | 488 // increases by N every time we call ReloadWorkQueue() and decreases by 1 |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 | 684 |
684 // Do not add any member variables to MessageLoopForIO! This is important b/c | 685 // Do not add any member variables to MessageLoopForIO! This is important b/c |
685 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 686 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
686 // data that you need should be stored on the MessageLoop's pump_ instance. | 687 // data that you need should be stored on the MessageLoop's pump_ instance. |
687 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 688 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
688 MessageLoopForIO_should_not_have_extra_member_variables); | 689 MessageLoopForIO_should_not_have_extra_member_variables); |
689 | 690 |
690 } // namespace base | 691 } // namespace base |
691 | 692 |
692 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 693 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
OLD | NEW |