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

Unified Diff: chrome/browser/metrics/histogram_synchronizer.h

Issue 8603013: base::Bind() conversion for MetricsService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/metrics/histogram_synchronizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/histogram_synchronizer.h
diff --git a/chrome/browser/metrics/histogram_synchronizer.h b/chrome/browser/metrics/histogram_synchronizer.h
index 7d89e848327e9b311e3515943ba0c19cc02447a6..f5cdb73ae4d2051901f5cb4e3b816512ca476006 100644
--- a/chrome/browser/metrics/histogram_synchronizer.h
+++ b/chrome/browser/metrics/histogram_synchronizer.h
@@ -10,13 +10,13 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/synchronization/condition_variable.h"
#include "base/synchronization/lock.h"
#include "base/time.h"
class MessageLoop;
-class Task;
// This class maintains state that is used to upload histogram data from the
// various renderer processes, into the browser process. Such transactions are
@@ -75,10 +75,12 @@ class HistogramSynchronizer : public
// Contact all renderers, and get them to upload to the browser any/all
// changes to histograms. When all changes have been acquired, or when the
- // wait time expires (whichever is sooner), post the callback_task to the
- // specified thread. Note the callback_task is posted exactly once.
+ // wait time expires (whichever is sooner), post the callback to the
+ // specified message loop. Note the callback is posted exactly once.
static void FetchRendererHistogramsAsynchronously(
- MessageLoop* callback_thread, Task* callback_task, int wait_time);
+ MessageLoop* callback_thread,
+ const base::Closure& callback,
+ int wait_time);
// This method is called on the IO thread. Deserializes the histograms and
// records that we have received histograms from a renderer process.
@@ -102,13 +104,13 @@ class HistogramSynchronizer : public
// either signal the waiting process or call the callback function.
void DecrementPendingRenderers(int sequence_number);
- // Set the callback_thread_ and callback_task_ members. If these members
- // already had values, then as a side effect, post the old callback_task_ to
- // the old callaback_thread_. This side effect should not generally happen,
- // but is in place to assure correctness (that any tasks that were set, are
- // eventually called, and never merely discarded).
+ // Set the callback_thread_ and callback_ members. If these members already
+ // had values, then as a side effect, post the old callback_ to the old
+ // callaback_thread_. This side effect should not generally happen, but is in
+ // place to assure correctness (that any tasks that were set, are eventually
+ // called, and never merely discarded).
void SetCallbackTaskAndThread(MessageLoop* callback_thread,
- Task* callback_task);
+ const base::Closure& callback);
void ForceHistogramSynchronizationDoneCallback(int sequence_number);
@@ -118,8 +120,10 @@ class HistogramSynchronizer : public
int renderer_count);
// Internal helper function, to post task, and record callback stats.
- void InternalPostTask(MessageLoop* thread, Task* task,
- int unresponsive_renderers, const base::TimeTicks& started);
+ void InternalPostTask(MessageLoop* thread,
+ const base::Closure& callback,
+ int unresponsive_renderers,
+ const base::TimeTicks& started);
// This lock_ protects access to all members.
base::Lock lock_;
@@ -130,8 +134,8 @@ class HistogramSynchronizer : public
// When a request is made to asynchronously update the histograms, we store
// the task and thread we use to post a completion notification in
- // callback_task_ and callback_thread_.
- Task* callback_task_;
+ // callback_ and callback_thread_.
+ base::Closure callback_;
MessageLoop* callback_thread_;
// We don't track the actual renderers that are contacted for an update, only
« no previous file with comments | « no previous file | chrome/browser/metrics/histogram_synchronizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698