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

Side by Side Diff: chrome/browser/metrics/variations/variations_service.cc

Issue 634583003: Simplify VersionInfo code, avoid hitting sandbox IPC constantly on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: linux include Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/metrics/variations/variations_service.h" 5 #include "chrome/browser/metrics/variations/variations_service.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/build_time.h" 9 #include "base/build_time.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 252 }
253 253
254 bool VariationsService::CreateTrialsFromSeed() { 254 bool VariationsService::CreateTrialsFromSeed() {
255 create_trials_from_seed_called_ = true; 255 create_trials_from_seed_called_ = true;
256 256
257 variations::VariationsSeed seed; 257 variations::VariationsSeed seed;
258 if (!seed_store_.LoadSeed(&seed)) 258 if (!seed_store_.LoadSeed(&seed))
259 return false; 259 return false;
260 260
261 const chrome::VersionInfo current_version_info; 261 const chrome::VersionInfo current_version_info;
262 if (!current_version_info.is_valid())
263 return false;
264
265 const base::Version current_version(current_version_info.Version()); 262 const base::Version current_version(current_version_info.Version());
266 if (!current_version.IsValid()) 263 if (!current_version.IsValid())
267 return false; 264 return false;
268 265
269 variations::VariationsSeedProcessor().CreateTrialsFromSeed( 266 variations::VariationsSeedProcessor().CreateTrialsFromSeed(
270 seed, 267 seed,
271 g_browser_process->GetApplicationLocale(), 268 g_browser_process->GetApplicationLocale(),
272 GetReferenceDateForExpiryChecks(local_state_), 269 GetReferenceDateForExpiryChecks(local_state_),
273 current_version, 270 current_version,
274 GetChannelForVariations(), 271 GetChannelForVariations(),
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 627
631 void VariationsService::RecordLastFetchTime() { 628 void VariationsService::RecordLastFetchTime() {
632 // local_state_ is NULL in tests, so check it first. 629 // local_state_ is NULL in tests, so check it first.
633 if (local_state_) { 630 if (local_state_) {
634 local_state_->SetInt64(prefs::kVariationsLastFetchTime, 631 local_state_->SetInt64(prefs::kVariationsLastFetchTime,
635 base::Time::Now().ToInternalValue()); 632 base::Time::Now().ToInternalValue());
636 } 633 }
637 } 634 }
638 635
639 } // namespace chrome_variations 636 } // namespace chrome_variations
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698