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

Unified Diff: components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java

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: Implemented the rest TODOs: pulling time from response and GZIP compressed seed support 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
Index: components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java
diff --git a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java
index c752d884b1fb67c05c0648f2f4bd1d2de2d90f26..b1e4ed18a903eeb40bc5a5cfe357320b606123b6 100644
--- a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java
+++ b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java
@@ -48,7 +48,7 @@ public class VariationsSeedService extends IntentService {
connection.setConnectTimeout(REQUEST_TIMEOUT);
connection.setDoInput(true);
// TODO(agulenko): add gzip compression support.
- // connection.setRequestProperty("A-IM", "gzip");
+ connection.setRequestProperty("A-IM", "gzip");
connection.connect();
int responseCode = connection.getResponseCode();
if (responseCode != HttpURLConnection.HTTP_OK) {
@@ -60,8 +60,11 @@ public class VariationsSeedService extends IntentService {
byte[] rawSeed = getRawSeed(connection);
String signature = connection.getHeaderField("X-Seed-Signature");
String country = connection.getHeaderField("X-Country");
+ String date = connection.getHeaderField("Date");
+ String compression = connection.getHeaderField("IM");
+ boolean isGzipCompressed = (compression.indexOf("gzip") != -1);
Alexei Svitkine (slow) 2015/11/12 16:26:55 This logic doesn't match the C++ side. You want t
Alexander Agulenko 2015/11/12 20:07:41 Done.
VariationsSeedBridge.setVariationsFirstRunSeed(
- getApplicationContext(), rawSeed, signature, country);
+ getApplicationContext(), rawSeed, signature, country, date, isGzipCompressed);
return true;
} catch (IOException e) {
Log.w(TAG, "IOException fetching first run seed: ", e);

Powered by Google App Engine
This is Rietveld 408576698