Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / components / metrics / metrics_state_manager.cc
index 08875f3..7f7b8e5 100644 (file)
@@ -12,6 +12,7 @@
 #include "base/prefs/pref_service.h"
 #include "base/rand_util.h"
 #include "base/strings/string_number_conversions.h"
+#include "base/threading/thread_restrictions.h"
 #include "base/time/time.h"
 #include "components/metrics/cloned_install_detector.h"
 #include "components/metrics/machine_id_provider.h"
@@ -162,7 +163,6 @@ MetricsStateManager::CreateEntropyProvider() {
   if (IsMetricsReportingEnabled()) {
     if (entropy_source_returned_ == ENTROPY_SOURCE_NONE)
       entropy_source_returned_ = ENTROPY_SOURCE_HIGH;
-    DCHECK_EQ(ENTROPY_SOURCE_HIGH, entropy_source_returned_);
     const std::string high_entropy_source =
         client_id_ + base::IntToString(low_entropy_source_value);
     return scoped_ptr<const base::FieldTrial::EntropyProvider>(
@@ -171,7 +171,6 @@ MetricsStateManager::CreateEntropyProvider() {
 
   if (entropy_source_returned_ == ENTROPY_SOURCE_NONE)
     entropy_source_returned_ = ENTROPY_SOURCE_LOW;
-  DCHECK_EQ(ENTROPY_SOURCE_LOW, entropy_source_returned_);
 
 #if defined(OS_ANDROID) || defined(OS_IOS)
   return scoped_ptr<const base::FieldTrial::EntropyProvider>(
@@ -220,6 +219,9 @@ void MetricsStateManager::RegisterPrefs(PrefRegistrySimple* registry) {
 }
 
 void MetricsStateManager::BackUpCurrentClientInfo() {
+  // TODO(gayane): Eliminate use of ScopedAllowIO. crbug.com/413783
+  base::ThreadRestrictions::ScopedAllowIO allow_io;
+
   ClientInfo client_info;
   client_info.client_id = client_id_;
   client_info.installation_date = local_state_->GetInt64(prefs::kInstallDate);