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

Side by Side Diff: base/message_loop.cc

Issue 12161002: MessageLoop's RUN method will pass a const ref to PendingTask when (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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/message_loop.h ('k') | base/message_loop_unittest.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "base/message_loop.h" 5 #include "base/message_loop.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 const void* program_counter = 465 const void* program_counter =
466 pending_task.posted_from.program_counter(); 466 pending_task.posted_from.program_counter();
467 base::debug::Alias(&program_counter); 467 base::debug::Alias(&program_counter);
468 468
469 HistogramEvent(kTaskRunEvent); 469 HistogramEvent(kTaskRunEvent);
470 470
471 tracked_objects::TrackedTime start_time = 471 tracked_objects::TrackedTime start_time =
472 tracked_objects::ThreadData::NowForStartOfRun(pending_task.birth_tally); 472 tracked_objects::ThreadData::NowForStartOfRun(pending_task.birth_tally);
473 473
474 FOR_EACH_OBSERVER(TaskObserver, task_observers_, 474 FOR_EACH_OBSERVER(TaskObserver, task_observers_,
475 WillProcessTask(pending_task.time_posted)); 475 WillProcessTask(pending_task));
476 pending_task.task.Run(); 476 pending_task.task.Run();
477 FOR_EACH_OBSERVER(TaskObserver, task_observers_, 477 FOR_EACH_OBSERVER(TaskObserver, task_observers_,
478 DidProcessTask(pending_task.time_posted)); 478 DidProcessTask(pending_task));
479 479
480 tracked_objects::ThreadData::TallyRunOnNamedThreadIfTracking(pending_task, 480 tracked_objects::ThreadData::TallyRunOnNamedThreadIfTracking(pending_task,
481 start_time, tracked_objects::ThreadData::NowForEndOfRun()); 481 start_time, tracked_objects::ThreadData::NowForEndOfRun());
482 482
483 nestable_tasks_allowed_ = true; 483 nestable_tasks_allowed_ = true;
484 } 484 }
485 485
486 bool MessageLoop::DeferOrRunPendingTask(const PendingTask& pending_task) { 486 bool MessageLoop::DeferOrRunPendingTask(const PendingTask& pending_task) {
487 if (pending_task.nestable || run_loop_->run_depth_ == 1) { 487 if (pending_task.nestable || run_loop_->run_depth_ == 1) {
488 RunTask(pending_task); 488 RunTask(pending_task);
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 Watcher *delegate) { 806 Watcher *delegate) {
807 return pump_libevent()->WatchFileDescriptor( 807 return pump_libevent()->WatchFileDescriptor(
808 fd, 808 fd,
809 persistent, 809 persistent,
810 mode, 810 mode,
811 controller, 811 controller,
812 delegate); 812 delegate);
813 } 813 }
814 814
815 #endif 815 #endif
OLDNEW
« no previous file with comments | « base/message_loop.h ('k') | base/message_loop_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698