diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-15 23:59:36 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-15 23:59:36 +0000 |
commit | fd0a645508f9b2a4a4c0b2498fca24ddc0a772b0 (patch) | |
tree | df94bfbd0638aaf9da88042711f215f1d086bda0 /base | |
parent | 8e532d709a7bf325727333ec3c3013faeb532e43 (diff) | |
download | chromium_src-fd0a645508f9b2a4a4c0b2498fca24ddc0a772b0.zip chromium_src-fd0a645508f9b2a4a4c0b2498fca24ddc0a772b0.tar.gz chromium_src-fd0a645508f9b2a4a4c0b2498fca24ddc0a772b0.tar.bz2 |
Handle null timer values when profiling sections
Null time values can appear if the profiler is
not ACTIVE, and the Now() function returns a Null
value (to avoid wasting time and calling the OS Time).
r=rtenneti
Review URL: http://codereview.chromium.org/8573017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110215 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/tracked_objects.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc index 39056d6..02ff130 100644 --- a/base/tracked_objects.cc +++ b/base/tracked_objects.cc @@ -531,7 +531,9 @@ void ThreadData::TallyRunInAScopedRegionIfTracking( return; DurationInt queue_duration = 0; - DurationInt run_duration = (end_of_run - start_of_run).InMilliseconds(); + DurationInt run_duration = 0; + if (!start_of_run.is_null() && !end_of_run.is_null()) + run_duration = (end_of_run - start_of_run).InMilliseconds(); current_thread_data->TallyADeath(*birth, queue_duration, run_duration); } |