| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef BASE_MESSAGE_LOOP_H_ |
| 6 #define BASE_MESSAGE_LOOP_H_ | 6 #define BASE_MESSAGE_LOOP_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 base::TimeTicks time_posted; | 408 base::TimeTicks time_posted; |
| 409 | 409 |
| 410 // The time when the task should be run. | 410 // The time when the task should be run. |
| 411 base::TimeTicks delayed_run_time; | 411 base::TimeTicks delayed_run_time; |
| 412 | 412 |
| 413 // Secondary sort key for run time. | 413 // Secondary sort key for run time. |
| 414 int sequence_num; | 414 int sequence_num; |
| 415 | 415 |
| 416 // OK to dispatch from a nested loop. | 416 // OK to dispatch from a nested loop. |
| 417 bool nestable; | 417 bool nestable; |
| 418 |
| 419 // The site this PendingTask was posted from. |
| 420 const void* birth_program_counter; |
| 418 }; | 421 }; |
| 419 | 422 |
| 420 class TaskQueue : public std::queue<PendingTask> { | 423 class TaskQueue : public std::queue<PendingTask> { |
| 421 public: | 424 public: |
| 422 void Swap(TaskQueue* queue) { | 425 void Swap(TaskQueue* queue) { |
| 423 c.swap(queue->c); // Calls std::deque::swap | 426 c.swap(queue->c); // Calls std::deque::swap |
| 424 } | 427 } |
| 425 }; | 428 }; |
| 426 | 429 |
| 427 typedef std::priority_queue<PendingTask> DelayedTaskQueue; | 430 typedef std::priority_queue<PendingTask> DelayedTaskQueue; |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 #endif // defined(OS_POSIX) | 690 #endif // defined(OS_POSIX) |
| 688 }; | 691 }; |
| 689 | 692 |
| 690 // Do not add any member variables to MessageLoopForIO! This is important b/c | 693 // Do not add any member variables to MessageLoopForIO! This is important b/c |
| 691 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra | 694 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra |
| 692 // data that you need should be stored on the MessageLoop's pump_ instance. | 695 // data that you need should be stored on the MessageLoop's pump_ instance. |
| 693 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), | 696 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), |
| 694 MessageLoopForIO_should_not_have_extra_member_variables); | 697 MessageLoopForIO_should_not_have_extra_member_variables); |
| 695 | 698 |
| 696 #endif // BASE_MESSAGE_LOOP_H_ | 699 #endif // BASE_MESSAGE_LOOP_H_ |
| OLD | NEW |