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

Unified Diff: components/variations/variations_seed_store.cc

Issue 1438123002: Removed callbacks to JNI functions + added gzip compressed seed support & pulling response time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merging this CL with master Created 5 years, 1 month 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 | « components/variations/variations_seed_store.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/variations/variations_seed_store.cc
diff --git a/components/variations/variations_seed_store.cc b/components/variations/variations_seed_store.cc
index 91fc4e65f2997a553844e21fba5f83c6e9eb094e..9054eaea729b34d610aca2e66686c4c943e6ae2d 100644
--- a/components/variations/variations_seed_store.cc
+++ b/components/variations/variations_seed_store.cc
@@ -363,27 +363,25 @@ void VariationsSeedStore::ClearPrefs() {
#if defined(OS_ANDROID)
void VariationsSeedStore::ImportFirstRunJavaSeed() {
DVLOG(1) << "Importing first run seed from Java preferences.";
- if (get_variations_first_run_seed_.is_null()) {
- RecordFirstRunResult(FIRST_RUN_SEED_IMPORT_FAIL_NO_CALLBACK);
- return;
- }
std::string seed_data;
std::string seed_signature;
std::string seed_country;
- get_variations_first_run_seed_.Run(&seed_data, &seed_signature,
- &seed_country);
+ std::string response_date;
+ bool is_gzip_compressed;
+
+ android::GetVariationsFirstRunSeed(&seed_data, &seed_signature, &seed_country,
+ &response_date, &is_gzip_compressed);
if (seed_data.empty()) {
RecordFirstRunResult(FIRST_RUN_SEED_IMPORT_FAIL_NO_FIRST_RUN_SEED);
return;
}
- // TODO(agulenko): Pull actual time from the response.
- base::Time current_time = base::Time::Now();
+ base::Time current_date;
+ base::Time::FromUTCString(response_date.c_str(), &current_date);
- // TODO(agulenko): Support gzip compressed seed.
- if (!StoreSeedData(seed_data, seed_signature, seed_country, current_time,
- false, false, nullptr)) {
+ if (!StoreSeedData(seed_data, seed_signature, seed_country, current_date,
+ false, is_gzip_compressed, nullptr)) {
RecordFirstRunResult(FIRST_RUN_SEED_IMPORT_FAIL_STORE_FAILED);
LOG(WARNING) << "First run variations seed is invalid.";
return;
« no previous file with comments | « components/variations/variations_seed_store.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698