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

Unified Diff: chrome/browser/io_thread.h

Issue 2517363002: Decouple Metrics Initialization from IO Thread Initialization (Closed)
Patch Set: Created 4 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
Index: chrome/browser/io_thread.h
diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h
index ab7f5568e05f01a88b76eef457b53c2d6a65e77d..ba51d048dd5fc9cde2ae1b89fd5068c7c611e6ba 100644
--- a/chrome/browser/io_thread.h
+++ b/chrome/browser/io_thread.h
@@ -16,6 +16,7 @@
#include <vector>
#include "base/compiler_specific.h"
+#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
@@ -239,6 +240,9 @@ class IOThread : public content::BrowserThreadDelegate {
base::TimeTicks creation_time() const;
+ // Initializes the callback for updating data use prefs.
+ void InitMetricsDataUseForwarder();
+
// Returns the callback for updating data use prefs.
const metrics::UpdateUsagePrefCallbackType& GetMetricsDataUseForwarder();
@@ -404,6 +408,11 @@ class IOThread : public content::BrowserThreadDelegate {
// thread and passed to |DataUseNetworkDelegate|.
metrics::UpdateUsagePrefCallbackType metrics_data_use_forwarder_;
+#if DCHECK_IS_ON()
+ // True if |metrics_data_use_forwarder_| has been set.
+ bool metrics_data_use_forwarder_set_ = false;
+#endif
+
base::WeakPtrFactory<IOThread> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(IOThread);

Powered by Google App Engine
This is Rietveld 408576698