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

Unified Diff: chrome/browser/metrics/metrics_service.cc

Issue 9703115: Add DeviceSettingProvider unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed documentation. Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/metrics/metrics_service.cc
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index b11a44b1fad332fce1948d47ea3854adb8b0073d..745c6c95369255bae10aca1ef756ede2fa23de2e 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -402,6 +402,20 @@ MetricsService::MetricsService()
log_manager_.set_max_ongoing_log_store_size(kUploadLogAvoidRetransmitSize);
}
+// Constrcutor for tests. Will not initialize the object for realz.
+MetricsService::MetricsService(bool active)
+ : recording_active_(active),
+ reporting_active_(active),
+ state_(INITIALIZED),
+ io_thread_(NULL),
+ idle_since_last_transmission_(false),
+ next_window_id_(0),
+ ALLOW_THIS_IN_INITIALIZER_LIST(self_ptr_factory_(this)),
+ ALLOW_THIS_IN_INITIALIZER_LIST(state_saver_factory_(this)),
+ waiting_for_asynchronus_reporting_step_(false) {
+ DCHECK(IsSingleThreaded());
+}
+
MetricsService::~MetricsService() {
SetRecording(false);
}

Powered by Google App Engine
This is Rietveld 408576698