diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-26 23:40:48 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-26 23:40:48 +0000 |
commit | 02468668f05673052602812d9a9b1846f97bfad3 (patch) | |
tree | a0b1596402ece05bb7a23d6053c6543ec6b30438 /chrome/browser/jankometer.cc | |
parent | 88424e6e8ed416c21e92bc8efc4b2658f89b7329 (diff) | |
download | chromium_src-02468668f05673052602812d9a9b1846f97bfad3.zip chromium_src-02468668f05673052602812d9a9b1846f97bfad3.tar.gz chromium_src-02468668f05673052602812d9a9b1846f97bfad3.tar.bz2 |
Added task to Observer methods
By adding the task to the observer methods and GetBirthPlace() to Tracked it
makes it possible to register an observer that can print more information about
the tasks as they are being processed.
BUG=NONE
TEST=MessageLoopTest.*
Review URL: http://codereview.chromium.org/4081003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63983 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/jankometer.cc')
-rw-r--r-- | chrome/browser/jankometer.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/jankometer.cc b/chrome/browser/jankometer.cc index a9a99b0..e58b71a 100644 --- a/chrome/browser/jankometer.cc +++ b/chrome/browser/jankometer.cc @@ -206,13 +206,13 @@ class IOJankObserver : public base::RefCountedThreadSafe<IOJankObserver>, helper_.EndProcessingTimers(); } - virtual void WillProcessTask(base::TimeTicks birth_time) { + virtual void WillProcessTask(const Task* task) { base::TimeTicks now = base::TimeTicks::Now(); - const base::TimeDelta queueing_time = now - birth_time; + const base::TimeDelta queueing_time = now - task->tracked_birth_time(); helper_.StartProcessingTimers(queueing_time); } - virtual void DidProcessTask() { + virtual void DidProcessTask(const Task* task) { helper_.EndProcessingTimers(); } @@ -250,13 +250,13 @@ class UIJankObserver : public base::RefCountedThreadSafe<UIJankObserver>, MessageLoopForUI::current()->RemoveObserver(this); } - virtual void WillProcessTask(base::TimeTicks birth_time) { + virtual void WillProcessTask(const Task* task) { base::TimeTicks now = base::TimeTicks::Now(); - const base::TimeDelta queueing_time = now - birth_time; + const base::TimeDelta queueing_time = now - task->tracked_birth_time(); helper_.StartProcessingTimers(queueing_time); } - virtual void DidProcessTask() { + virtual void DidProcessTask(const Task* task) { helper_.EndProcessingTimers(); } |