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

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

Issue 438163004: Fix inverted early return check in variations simulation code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 DoActualFetch(); 564 DoActualFetch();
565 565
566 // This service must have created a scheduler in order for this to be called. 566 // This service must have created a scheduler in order for this to be called.
567 DCHECK(request_scheduler_.get()); 567 DCHECK(request_scheduler_.get());
568 request_scheduler_->Reset(); 568 request_scheduler_->Reset();
569 } 569 }
570 570
571 void VariationsService::PerformSimulationWithVersion( 571 void VariationsService::PerformSimulationWithVersion(
572 scoped_ptr<variations::VariationsSeed> seed, 572 scoped_ptr<variations::VariationsSeed> seed,
573 const base::Version& version) { 573 const base::Version& version) {
574 if (version.IsValid()) 574 if (!version.IsValid())
575 return; 575 return;
576 576
577 const base::ElapsedTimer timer; 577 const base::ElapsedTimer timer;
578 578
579 scoped_ptr<const base::FieldTrial::EntropyProvider> entropy_provider = 579 scoped_ptr<const base::FieldTrial::EntropyProvider> entropy_provider =
580 state_manager_->CreateEntropyProvider(); 580 state_manager_->CreateEntropyProvider();
581 variations::VariationsSeedSimulator seed_simulator(*entropy_provider); 581 variations::VariationsSeedSimulator seed_simulator(*entropy_provider);
582 582
583 const variations::VariationsSeedSimulator::Result result = 583 const variations::VariationsSeedSimulator::Result result =
584 seed_simulator.SimulateSeedStudies( 584 seed_simulator.SimulateSeedStudies(
(...skipping 16 matching lines...) Expand all
601 601
602 void VariationsService::RecordLastFetchTime() { 602 void VariationsService::RecordLastFetchTime() {
603 // local_state_ is NULL in tests, so check it first. 603 // local_state_ is NULL in tests, so check it first.
604 if (local_state_) { 604 if (local_state_) {
605 local_state_->SetInt64(prefs::kVariationsLastFetchTime, 605 local_state_->SetInt64(prefs::kVariationsLastFetchTime,
606 base::Time::Now().ToInternalValue()); 606 base::Time::Now().ToInternalValue());
607 } 607 }
608 } 608 }
609 609
610 } // namespace chrome_variations 610 } // namespace chrome_variations
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698