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

Unified Diff: chrome/browser/metrics/variations/variations_service.cc

Issue 12251003: Fix variations seed being reset on a 304 response. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/variations/variations_service.cc
===================================================================
--- chrome/browser/metrics/variations/variations_service.cc (revision 181784)
+++ chrome/browser/metrics/variations/variations_service.cc (working copy)
@@ -287,7 +287,9 @@
base::TimeDelta::FromMilliseconds(kServerTimeResolutionMs),
latency);
}
- } else if (response_code != net::HTTP_OK) {
+ }
+
+ if (response_code != net::HTTP_OK) {
DVLOG(1) << "Variations server request returned non-HTTP_OK response code: "
<< response_code;
if (response_code == net::HTTP_NOT_MODIFIED)
@@ -321,6 +323,11 @@
bool VariationsService::StoreSeedData(const std::string& seed_data,
const base::Time& seed_date,
PrefService* local_prefs) {
+ if (seed_data.empty()) {
+ VLOG(1) << "Variations Seed data from server is empty, rejecting the seed.";
+ return false;
+ }
+
// Only store the seed data if it parses correctly.
TrialsSeed seed;
if (!seed.ParseFromString(seed_data)) {
« 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