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

Issue 1417733008: Java code for fetching variations first run seed after receiving chrome.TOS_ACKED broadcast. (Closed)

Created:
5 years, 1 month ago by Alexander Agulenko
Modified:
5 years, 1 month ago
CC:
chromium-reviews, asvitkine+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Java code for fetching variations first run seed after receiving chrome.TOS_ACKED broadcast. I implemented BroadcastReceiver that starts a service upon receiving a chrome.TOS_ACKED broadcast. The service makes a HTTP request to Google servers to fetch the seed and stores it in SharedPreferences. After Chrome start Chromium core uses a bridge to get this seed from Java side (see https://codereview.chromium.org/1417503010/). BUG=551029 Committed: https://crrev.com/2d59816a69420e25c1ff39fb55d2d6f245c424b3 Cr-Commit-Position: refs/heads/master@{#359036}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Moved code for fetching variations first run seed to components/variations #

Patch Set 3 : Minor fixes: changed comments and removed unused includes and usings #

Total comments: 43

Patch Set 4 : Code review comments fixed #

Total comments: 4

Patch Set 5 : IOException is caught instead of generic; added HTTP response code validation #

Total comments: 2

Patch Set 6 : Minor codestyle fix #

Total comments: 6

Patch Set 7 : Moved exception catch closer to place of possible raise #

Total comments: 11

Patch Set 8 : Splitted fetching code into two functions #

Total comments: 2

Patch Set 9 : Minor change in logging message #

Total comments: 2

Patch Set 10 : Removed unnecessary exception throw declaration #

Unified diffs Side-by-side diffs Delta from patch set Stats (+290 lines, -82 lines) Patch
M chrome/android/java/AndroidManifest.xml View 1 1 chunk +10 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java View 2 chunks +0 lines, -40 lines 0 comments Download
M chrome/browser/android/chrome_jni_registrar.cc View 1 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/android/preferences/pref_service_bridge.h View 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/browser/android/preferences/pref_service_bridge.cc View 5 chunks +0 lines, -32 lines 0 comments Download
M chrome/browser/metrics/variations/chrome_variations_service_client.cc View 1 3 chunks +5 lines, -5 lines 0 comments Download
M components/variations.gypi View 1 2 chunks +3 lines, -0 lines 0 comments Download
M components/variations/BUILD.gn View 1 2 3 2 chunks +3 lines, -0 lines 0 comments Download
A components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java View 1 2 3 1 chunk +60 lines, -0 lines 0 comments Download
A components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java View 1 2 3 4 5 6 7 8 9 1 chunk +97 lines, -0 lines 0 comments Download
A components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedServiceLauncher.java View 1 2 3 1 chunk +27 lines, -0 lines 0 comments Download
A components/variations/android/variations_seed_bridge.h View 1 2 3 1 chunk +24 lines, -0 lines 0 comments Download
A components/variations/android/variations_seed_bridge.cc View 1 2 3 1 chunk +59 lines, -0 lines 0 comments Download

Messages

Total messages: 56 (16 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1417733008/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1417733008/1
5 years, 1 month ago (2015-11-05 07:45:34 UTC) #3
commit-bot: I haz the power
Dry run: No L-G-T-M from a valid reviewer yet. Only full committers are accepted. Even ...
5 years, 1 month ago (2015-11-05 07:45:36 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1417733008/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1417733008/1
5 years, 1 month ago (2015-11-05 16:34:06 UTC) #7
Alexei Svitkine (slow)
https://codereview.chromium.org/1417733008/diff/1/chrome/browser/android/chrome_jni_registrar.cc File chrome/browser/android/chrome_jni_registrar.cc (right): https://codereview.chromium.org/1417733008/diff/1/chrome/browser/android/chrome_jni_registrar.cc#newcode347 chrome/browser/android/chrome_jni_registrar.cc:347: VariationsSeedBridge::RegisterVariationsSeedBridge}, Seems like we already have "Variations" above? Can ...
5 years, 1 month ago (2015-11-05 16:38:27 UTC) #8
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/153914) android_clang_dbg_recipe on ...
5 years, 1 month ago (2015-11-05 16:47:01 UTC) #10
Alexander Agulenko
Fixed codereview comments and tested the code. Alexei, please run Dry Run for this CL ...
5 years, 1 month ago (2015-11-06 08:09:01 UTC) #13
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1417733008/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1417733008/40001
5 years, 1 month ago (2015-11-06 15:59:26 UTC) #15
Alexei Svitkine (slow)
https://codereview.chromium.org/1417733008/diff/40001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java (right): https://codereview.chromium.org/1417733008/diff/40001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java#newcode16 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java:16: * before the Nit: Wrapping is off. https://codereview.chromium.org/1417733008/diff/40001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java#newcode23 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java:23: ...
5 years, 1 month ago (2015-11-06 16:17:56 UTC) #16
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 1 month ago (2015-11-06 16:57:04 UTC) #18
newt (away)
General question: what happens if Chrome is offline when tos acked is broadcast? Seems like ...
5 years, 1 month ago (2015-11-06 18:27:15 UTC) #19
Alexander Agulenko
>> General question: what happens if Chrome is offline when tos acked is broadcast? To ...
5 years, 1 month ago (2015-11-06 19:18:36 UTC) #20
Alexander Agulenko
https://codereview.chromium.org/1417733008/diff/40001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java (right): https://codereview.chromium.org/1417733008/diff/40001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java#newcode16 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java:16: * before the On 2015/11/06 16:17:55, Alexei Svitkine (slow) ...
5 years, 1 month ago (2015-11-06 19:54:38 UTC) #21
Alexei Svitkine (slow)
https://codereview.chromium.org/1417733008/diff/60001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/60001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode60 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:60: Log.d(TAG, "Response code = %d", responseCode); As mentioned earlier, ...
5 years, 1 month ago (2015-11-06 20:11:12 UTC) #22
newt (away)
https://codereview.chromium.org/1417733008/diff/40001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/40001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode76 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:76: Log.d(TAG, "variationsTracker: Response code = " + Integer.toString(responseCode)); On ...
5 years, 1 month ago (2015-11-06 20:57:23 UTC) #23
Alexander Agulenko
https://codereview.chromium.org/1417733008/diff/60001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/60001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode41 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:41: } catch (Exception e) { On 2015/11/06 20:57:23, newt ...
5 years, 1 month ago (2015-11-09 11:35:20 UTC) #24
Alexei Svitkine (slow)
LGTM % comment. Please also wait for newt@ to review. https://codereview.chromium.org/1417733008/diff/80001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/80001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode71 ...
5 years, 1 month ago (2015-11-09 16:02:33 UTC) #25
Alexander Agulenko
https://codereview.chromium.org/1417733008/diff/80001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/80001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode71 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:71: return false; On 2015/11/09 16:02:33, Alexei Svitkine (slow) wrote: ...
5 years, 1 month ago (2015-11-09 19:09:45 UTC) #26
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1417733008/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1417733008/100001
5 years, 1 month ago (2015-11-09 19:11:48 UTC) #28
commit-bot: I haz the power
Dry run: All required reviewers (with asterisk prefixes) have not yet approved this CL. No ...
5 years, 1 month ago (2015-11-09 19:11:51 UTC) #30
newt (away)
https://codereview.chromium.org/1417733008/diff/100001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/100001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode41 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:41: } catch (IOException e) { Why are you catching ...
5 years, 1 month ago (2015-11-09 22:47:13 UTC) #31
Alexander Agulenko
https://codereview.chromium.org/1417733008/diff/100001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/100001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode41 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:41: } catch (IOException e) { On 2015/11/09 22:47:12, newt ...
5 years, 1 month ago (2015-11-09 22:48:43 UTC) #32
newt (away)
https://codereview.chromium.org/1417733008/diff/100001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/100001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode41 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:41: } catch (IOException e) { On 2015/11/09 22:48:43, Alexander ...
5 years, 1 month ago (2015-11-09 22:51:21 UTC) #33
Alexander Agulenko
https://codereview.chromium.org/1417733008/diff/100001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/100001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode41 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:41: } catch (IOException e) { On 2015/11/09 22:51:20, newt ...
5 years, 1 month ago (2015-11-10 05:58:18 UTC) #34
newt (away)
https://codereview.chromium.org/1417733008/diff/120001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/120001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode53 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:53: throws IOException, MalformedURLException { Remove the "throws" clause; this ...
5 years, 1 month ago (2015-11-10 06:20:15 UTC) #35
Alexander Agulenko
https://codereview.chromium.org/1417733008/diff/120001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/120001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode53 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:53: throws IOException, MalformedURLException { On 2015/11/10 06:20:15, newt wrote: ...
5 years, 1 month ago (2015-11-10 06:40:12 UTC) #36
Alexander Agulenko
https://codereview.chromium.org/1417733008/diff/120001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/120001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode78 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:78: } finally { On 2015/11/10 06:40:12, Alexander Agulenko wrote: ...
5 years, 1 month ago (2015-11-10 06:41:56 UTC) #37
Alexei Svitkine (slow)
still lgtm https://codereview.chromium.org/1417733008/diff/120001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/120001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode66 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:66: Log.d(TAG, "Response code = %d", responseCode); Nit: ...
5 years, 1 month ago (2015-11-10 16:23:24 UTC) #38
Alexei Svitkine (slow)
By the way, we're hoping to land this very soon as Alex has a couple ...
5 years, 1 month ago (2015-11-10 16:48:02 UTC) #39
newt (away)
https://codereview.chromium.org/1417733008/diff/120001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/120001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode78 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:78: } finally { On 2015/11/10 06:40:12, Alexander Agulenko wrote: ...
5 years, 1 month ago (2015-11-10 17:17:52 UTC) #40
Steven Holte
https://codereview.chromium.org/1417733008/diff/120001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/120001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode78 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:78: } finally { On 2015/11/10 17:17:51, newt wrote: > ...
5 years, 1 month ago (2015-11-10 20:51:10 UTC) #41
Alexander Agulenko
https://codereview.chromium.org/1417733008/diff/120001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/120001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode66 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:66: Log.d(TAG, "Response code = %d", responseCode); On 2015/11/10 16:23:24, ...
5 years, 1 month ago (2015-11-10 22:44:13 UTC) #42
Alexei Svitkine (slow)
lgtm https://codereview.chromium.org/1417733008/diff/140001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/140001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode67 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:67: Log.w(TAG, "Variations service has thrown IO Exception.", e); ...
5 years, 1 month ago (2015-11-10 22:49:45 UTC) #43
Alexander Agulenko
https://codereview.chromium.org/1417733008/diff/140001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/140001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode67 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:67: Log.w(TAG, "Variations service has thrown IO Exception.", e); On ...
5 years, 1 month ago (2015-11-10 22:52:38 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1417733008/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1417733008/160001
5 years, 1 month ago (2015-11-10 23:15:48 UTC) #47
commit-bot: I haz the power
All required reviewers (with asterisk prefixes) have not yet approved this CL. No L-G-T-M from ...
5 years, 1 month ago (2015-11-10 23:15:53 UTC) #49
newt (away)
lgtm after nit https://codereview.chromium.org/1417733008/diff/160001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/160001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode43 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:43: private boolean downloadContent(URL variationsServerUrl) throws MalformedURLException ...
5 years, 1 month ago (2015-11-10 23:26:22 UTC) #50
Alexander Agulenko
https://codereview.chromium.org/1417733008/diff/160001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java File components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java (right): https://codereview.chromium.org/1417733008/diff/160001/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java#newcode43 components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedService.java:43: private boolean downloadContent(URL variationsServerUrl) throws MalformedURLException { On 2015/11/10 ...
5 years, 1 month ago (2015-11-11 01:43:27 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1417733008/180001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1417733008/180001
5 years, 1 month ago (2015-11-11 01:45:29 UTC) #54
commit-bot: I haz the power
Committed patchset #10 (id:180001)
5 years, 1 month ago (2015-11-11 03:50:44 UTC) #55
commit-bot: I haz the power
5 years, 1 month ago (2015-11-11 03:51:33 UTC) #56
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/2d59816a69420e25c1ff39fb55d2d6f245c424b3
Cr-Commit-Position: refs/heads/master@{#359036}

Powered by Google App Engine
This is Rietveld 408576698