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; | |
479 | 478 |
480 const Type type_; | 479 const Type type_; |
481 | 480 |
482 // A list of tasks that need to be processed by this instance. Note that | 481 // A list of tasks that need to be processed by this instance. Note that |
483 // this queue is only accessed (push/pop) by our current thread. | 482 // this queue is only accessed (push/pop) by our current thread. |
484 TaskQueue work_queue_; | 483 TaskQueue work_queue_; |
485 | 484 |
486 #if defined(OS_WIN) | 485 #if defined(OS_WIN) |
487 // How many high resolution tasks are in the pending task queue. This value | 486 // How many high resolution tasks are in the pending task queue. This value |
488 // increases by N every time we call ReloadWorkQueue() and decreases by 1 | 487 // 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... |
684 | 683 |
685 // Do not add any member variables to MessageLoopForIO! This is important b/c | 684 // Do not add any member variables to MessageLoopForIO! This is important b/c |
686 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 685 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
687 // data that you need should be stored on the MessageLoop's pump_ instance. | 686 // data that you need should be stored on the MessageLoop's pump_ instance. |
688 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 687 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
689 MessageLoopForIO_should_not_have_extra_member_variables); | 688 MessageLoopForIO_should_not_have_extra_member_variables); |
690 | 689 |
691 } // namespace base | 690 } // namespace base |
692 | 691 |
693 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ | 692 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ |
OLD | NEW |