Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Side by Side Diff: base/message_loop.h

Issue 7778033: Add trace code to track all posted tasks in message_loop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trace_event.h formatting fix Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/memory/singleton.h ('k') | base/message_loop.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 // Counter for location where the Closure was posted from. 423 // Counter for location where the Closure was posted from.
424 tracked_objects::Births* post_births; 424 tracked_objects::Births* post_births;
425 #endif // defined(TRACK_ALL_TASK_OBJECTS) 425 #endif // defined(TRACK_ALL_TASK_OBJECTS)
426 426
427 // Time this PendingTask was posted. 427 // Time this PendingTask was posted.
428 base::TimeTicks time_posted; 428 base::TimeTicks time_posted;
429 429
430 // The time when the task should be run. 430 // The time when the task should be run.
431 base::TimeTicks delayed_run_time; 431 base::TimeTicks delayed_run_time;
432 432
433 // The site this PendingTask was posted from.
434 tracked_objects::Location posted_from;
435
433 // Secondary sort key for run time. 436 // Secondary sort key for run time.
434 int sequence_num; 437 int sequence_num;
435 438
436 // OK to dispatch from a nested loop. 439 // OK to dispatch from a nested loop.
437 bool nestable; 440 bool nestable;
438
439 // The site this PendingTask was posted from.
440 const void* birth_program_counter;
441 }; 441 };
442 442
443 class TaskQueue : public std::queue<PendingTask> { 443 class TaskQueue : public std::queue<PendingTask> {
444 public: 444 public:
445 void Swap(TaskQueue* queue) { 445 void Swap(TaskQueue* queue) {
446 c.swap(queue->c); // Calls std::deque::swap 446 c.swap(queue->c); // Calls std::deque::swap
447 } 447 }
448 }; 448 };
449 449
450 typedef std::priority_queue<PendingTask> DelayedTaskQueue; 450 typedef std::priority_queue<PendingTask> DelayedTaskQueue;
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 #endif // defined(OS_POSIX) 706 #endif // defined(OS_POSIX)
707 }; 707 };
708 708
709 // Do not add any member variables to MessageLoopForIO! This is important b/c 709 // Do not add any member variables to MessageLoopForIO! This is important b/c
710 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra 710 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra
711 // data that you need should be stored on the MessageLoop's pump_ instance. 711 // data that you need should be stored on the MessageLoop's pump_ instance.
712 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), 712 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO),
713 MessageLoopForIO_should_not_have_extra_member_variables); 713 MessageLoopForIO_should_not_have_extra_member_variables);
714 714
715 #endif // BASE_MESSAGE_LOOP_H_ 715 #endif // BASE_MESSAGE_LOOP_H_
OLDNEW
« no previous file with comments | « base/memory/singleton.h ('k') | base/message_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698