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

Side by Side Diff: base/message_loop.cc

Issue 7375006: Startup race fixes to tracked objects (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: consistent ifdefs Created 9 years, 5 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 | « no previous file | base/tracked.h » ('j') | base/tracked.cc » ('J')
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 #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 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 const tracked_objects::Location& posted_from, 773 const tracked_objects::Location& posted_from,
774 TimeTicks delayed_run_time, 774 TimeTicks delayed_run_time,
775 bool nestable) 775 bool nestable)
776 : task(task), 776 : task(task),
777 time_posted(TimeTicks::Now()), 777 time_posted(TimeTicks::Now()),
778 delayed_run_time(delayed_run_time), 778 delayed_run_time(delayed_run_time),
779 sequence_num(0), 779 sequence_num(0),
780 nestable(nestable), 780 nestable(nestable),
781 birth_program_counter(posted_from.program_counter()) { 781 birth_program_counter(posted_from.program_counter()) {
782 #if defined(TRACK_ALL_TASK_OBJECTS) 782 #if defined(TRACK_ALL_TASK_OBJECTS)
783 post_births = NULL;
783 if (tracked_objects::ThreadData::IsActive()) { 784 if (tracked_objects::ThreadData::IsActive()) {
784 tracked_objects::ThreadData* current_thread_data = 785 tracked_objects::ThreadData* current_thread_data =
785 tracked_objects::ThreadData::current(); 786 tracked_objects::ThreadData::current();
786 if (current_thread_data) { 787 if (current_thread_data) {
787 post_births = current_thread_data->TallyABirth(posted_from); 788 post_births = current_thread_data->TallyABirth(posted_from);
788 } else {
789 // Shutdown started, and this thread wasn't registered.
790 post_births = NULL;
791 } 789 }
792 } 790 }
793 #endif // defined(TRACK_ALL_TASK_OBJECTS) 791 #endif // defined(TRACK_ALL_TASK_OBJECTS)
794 } 792 }
795 793
796 MessageLoop::PendingTask::~PendingTask() { 794 MessageLoop::PendingTask::~PendingTask() {
797 } 795 }
798 796
799 bool MessageLoop::PendingTask::operator<(const PendingTask& other) const { 797 bool MessageLoop::PendingTask::operator<(const PendingTask& other) const {
800 // Since the top of a priority queue is defined as the "greatest" element, we 798 // Since the top of a priority queue is defined as the "greatest" element, we
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 Watcher *delegate) { 863 Watcher *delegate) {
866 return pump_libevent()->WatchFileDescriptor( 864 return pump_libevent()->WatchFileDescriptor(
867 fd, 865 fd,
868 persistent, 866 persistent,
869 static_cast<base::MessagePumpLibevent::Mode>(mode), 867 static_cast<base::MessagePumpLibevent::Mode>(mode),
870 controller, 868 controller,
871 delegate); 869 delegate);
872 } 870 }
873 871
874 #endif 872 #endif
OLDNEW
« no previous file with comments | « no previous file | base/tracked.h » ('j') | base/tracked.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698