Fix variations seed being reset on a 304 response.

This was broken by https://chromiumcodereview.appspot.com/12096096,
which refactored the code causing a 304 response to no longer
resulting in an early return.

I'll write a test in a follow-up CL.

BUG=175795
TEST=VariationsService logging shows that the seed
does not get reset when we get a 304.

Review URL: https://chromiumcodereview.appspot.com/12251003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182151 0039d316-1c4b-4281-b951-d872f2087c98
parent 845720a1
...@@ -287,7 +287,9 @@ void VariationsService::OnURLFetchComplete(const net::URLFetcher* source) { ...@@ -287,7 +287,9 @@ void VariationsService::OnURLFetchComplete(const net::URLFetcher* source) {
base::TimeDelta::FromMilliseconds(kServerTimeResolutionMs), base::TimeDelta::FromMilliseconds(kServerTimeResolutionMs),
latency); 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: " DVLOG(1) << "Variations server request returned non-HTTP_OK response code: "
<< response_code; << response_code;
if (response_code == net::HTTP_NOT_MODIFIED) if (response_code == net::HTTP_NOT_MODIFIED)
...@@ -321,6 +323,11 @@ void VariationsService::OnResourceRequestsAllowed() { ...@@ -321,6 +323,11 @@ void VariationsService::OnResourceRequestsAllowed() {
bool VariationsService::StoreSeedData(const std::string& seed_data, bool VariationsService::StoreSeedData(const std::string& seed_data,
const base::Time& seed_date, const base::Time& seed_date,
PrefService* local_prefs) { 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. // Only store the seed data if it parses correctly.
TrialsSeed seed; TrialsSeed seed;
if (!seed.ParseFromString(seed_data)) { if (!seed.ParseFromString(seed_data)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment