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

Issue 459513002: Massive refactor of the Android invalidation code. (Closed)

Created:
6 years, 4 months ago by maxbogue
Modified:
6 years, 2 months ago
CC:
chromium-reviews, tim+watch_chromium.org, haitaol+watch_chromium.org, zea+watch_chromium.org, maniscalco+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Massive refactor of the Android invalidation code. We want the invalidations code to exist as a component independent of sync (see bug). This CL seeks to move toward that for the Android invalidations codebase. Generally, things moved from //chrome/browser/invalidation to //components/invalidation, even if git didn't mark them as moves. To accomplish this, I had to unify where the JNI occurred. In Java, InvalidationService was renamed to InvalidationClientService as the class that communicates with GCM. A new InvalidationService class was introduced to handle JNI and other Java entry points to the component. Several methods from ProfileSyncService and InvalidationController moved to it. InvalidationController is now the bridge between sync and the invalidation component, and has no JNI nor C++ counterpart. InvalidationServiceFactory was added to assist in the creation and management of InvalidationService objects across the JNI boundary. BUG=259559 Committed: https://crrev.com/b8d6efcb29ede4dd881700526930b75a077f9a4e Cr-Commit-Position: refs/heads/master@{#297202}

Patch Set 1 #

Patch Set 2 : Remove Profile and some tests from InvalidationServiceAndroid. #

Patch Set 3 : Fix DEPS. #

Patch Set 4 : Rebase. #

Patch Set 5 : Still trying to fix tests. #

Patch Set 6 : Fix more things with InvalidationServiceFactory. #

Patch Set 7 : Fix test and update AndroidManifest. #

Patch Set 8 : Rebase. #

Total comments: 48

Patch Set 9 : Address comments. #

Total comments: 12

Patch Set 10 : Fix tests + rebase. #

Patch Set 11 : Change second manifest file and rebase. #

Total comments: 4

Patch Set 12 : Remove guava deps and a useless constructor. #

Total comments: 2

Patch Set 13 : Use Profile::FromBrowserContext() and rebase. #

Patch Set 14 : Try to fix JNI build settings for tests. #

Patch Set 15 : More test deps/build file/JNI registration nonsense. #

Patch Set 16 : Fix a stray comma breaking GN builds. #

Patch Set 17 : Add missing deps in //content. #

Patch Set 18 : More missing deps that for some reason only break trybots.. #

Patch Set 19 : Maybe a rebase will make the trybots love me. #

Patch Set 20 : Try removing invalidation_unittests and using components_unittests instead. #

Total comments: 1

Patch Set 21 : Remove //content changes because they break on iOS. #

Patch Set 22 : Add invalidation_java to the deps for components_unittests_apk. #

Total comments: 2

Patch Set 23 : A couple GN fixes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+864 lines, -2246 lines) Patch
M chrome/android/DEPS View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationController.java View 1 2 3 4 5 6 7 8 9 10 6 chunks +4 lines, -37 lines 0 comments Download
A chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationServiceFactory.java View 1 2 3 4 5 6 7 8 1 chunk +50 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/sync/ChromiumSyncAdapter.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java View 1 2 3 4 5 6 7 8 9 4 chunks +11 lines, -22 lines 0 comments Download
A chrome/android/javatests/src/org/chromium/chrome/browser/invalidation/IntentSavingContext.java View 1 2 3 4 5 6 7 8 1 chunk +45 lines, -0 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/invalidation/InvalidationControllerTest.java View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -62 lines 0 comments Download
A chrome/android/javatests/src/org/chromium/chrome/browser/invalidation/InvalidationServiceTest.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +76 lines, -0 lines 0 comments Download
M chrome/android/shell/java/AndroidManifest.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/android/sync_shell/java/AndroidManifest.xml View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/android/chrome_jni_registrar.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 4 chunks +5 lines, -2 lines 0 comments Download
D chrome/browser/invalidation/invalidation_controller_android.h View 1 chunk +0 lines, -41 lines 0 comments Download
D chrome/browser/invalidation/invalidation_controller_android.cc View 1 chunk +0 lines, -75 lines 0 comments Download
D chrome/browser/invalidation/invalidation_service_android.h View 1 chunk +0 lines, -84 lines 0 comments Download
D chrome/browser/invalidation/invalidation_service_android.cc View 1 2 3 1 chunk +0 lines, -107 lines 0 comments Download
D chrome/browser/invalidation/invalidation_service_android_unittest.cc View 1 chunk +0 lines, -171 lines 0 comments Download
A chrome/browser/invalidation/invalidation_service_factory_android.h View 1 2 3 4 5 6 1 chunk +23 lines, -0 lines 0 comments Download
A chrome/browser/invalidation/invalidation_service_factory_android.cc View 1 2 3 4 5 6 1 chunk +53 lines, -0 lines 0 comments Download
M chrome/browser/invalidation/profile_invalidation_provider_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +4 lines, -6 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_android.h View 1 2 3 4 5 6 7 3 chunks +0 lines, -26 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_android.cc View 1 2 3 4 5 6 7 8 4 chunks +0 lines, -62 lines 0 comments Download
M chrome/chrome.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +3 lines, -5 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +0 lines, -1 line 0 comments Download
M chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/sync/SyncTestUtil.java View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -1 line 0 comments Download
M components/components_tests.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 2 chunks +5 lines, -1 line 0 comments Download
M components/invalidation.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +60 lines, -0 lines 0 comments Download
M components/invalidation/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 5 chunks +56 lines, -1 line 0 comments Download
M components/invalidation/DEPS View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
A + components/invalidation/android/DEPS View 1 2 0 chunks +-1 lines, --1 lines 0 comments Download
A components/invalidation/android/component_jni_registrar.h View 1 2 3 4 5 6 7 8 1 chunk +21 lines, -0 lines 0 comments Download
A components/invalidation/android/component_jni_registrar.cc View 1 chunk +30 lines, -0 lines 0 comments Download
A + components/invalidation/android/java/src/org/chromium/components/invalidation/InvalidationClientService.java View 1 2 3 4 5 6 7 8 9 10 4 chunks +8 lines, -7 lines 0 comments Download
A components/invalidation/android/java/src/org/chromium/components/invalidation/InvalidationService.java View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +91 lines, -0 lines 0 comments Download
A + components/invalidation/android/javatests/src/org/chromium/components/invalidation/InvalidationClientServiceTest.java View 1 2 3 4 5 6 7 8 9 21 chunks +36 lines, -33 lines 0 comments Download
A + components/invalidation/android/javatests/src/org/chromium/components/invalidation/TestableInvalidationClientService.java View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +3 lines, -6 lines 0 comments Download
A + components/invalidation/invalidation_service_android.h View 1 2 3 4 5 6 3 chunks +40 lines, -22 lines 0 comments Download
A components/invalidation/invalidation_service_android.cc View 1 2 3 4 5 6 7 8 1 chunk +176 lines, -0 lines 0 comments Download
A components/invalidation/invalidation_service_android_unittest.cc View 1 2 3 4 5 6 1 chunk +41 lines, -0 lines 0 comments Download
M components/signin.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +2 lines, -0 lines 0 comments Download
M components/test/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M components/test/run_all_unittests.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +2 lines, -0 lines 0 comments Download
D sync/android/java/src/org/chromium/sync/notifier/InvalidationService.java View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -507 lines 0 comments Download
D sync/android/javatests/src/org/chromium/sync/notifier/InvalidationServiceTest.java View 1 2 3 4 5 6 7 1 chunk +0 lines, -852 lines 0 comments Download
D sync/android/javatests/src/org/chromium/sync/notifier/TestableInvalidationService.java View 1 2 3 4 1 chunk +0 lines, -110 lines 0 comments Download

Messages

Total messages: 35 (7 generated)
maxbogue
maxbogue@chromium.org changed reviewers: + nyquist@chromium.org
6 years, 3 months ago (2014-08-27 17:28:58 UTC) #1
maxbogue
I think this is ready for review; PTAL.
6 years, 3 months ago (2014-08-27 17:28:58 UTC) #2
nyquist
I'm a bit concerned about the new dependency on //sync from //components/invalidation/. Also, I think ...
6 years, 3 months ago (2014-09-04 09:01:57 UTC) #3
nyquist
https://codereview.chromium.org/459513002/diff/140001/chrome/android/shell/java/AndroidManifest.xml File chrome/android/shell/java/AndroidManifest.xml (right): https://codereview.chromium.org/459513002/diff/140001/chrome/android/shell/java/AndroidManifest.xml#newcode179 chrome/android/shell/java/AndroidManifest.xml:179: android:value="org.chromium.components.invalidation.InvalidationClientService"/> FYI: Since you have to do this here, ...
6 years, 3 months ago (2014-09-04 18:16:32 UTC) #4
maxbogue
buh https://codereview.chromium.org/459513002/diff/140001/chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationServiceFactory.java File chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationServiceFactory.java (right): https://codereview.chromium.org/459513002/diff/140001/chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationServiceFactory.java#newcode23 chrome/android/java/src/org/chromium/chrome/browser/invalidation/InvalidationServiceFactory.java:23: public class InvalidationServiceFactory { On 2014/09/04 09:01:55, nyquist ...
6 years, 3 months ago (2014-09-05 16:42:46 UTC) #5
maxbogue
Did I miss anything in the description?
6 years, 3 months ago (2014-09-09 23:43:27 UTC) #6
nyquist
https://codereview.chromium.org/459513002/diff/160001/components/invalidation.gypi File components/invalidation.gypi (right): https://codereview.chromium.org/459513002/diff/160001/components/invalidation.gypi#newcode168 components/invalidation.gypi:168: 'conditions': [ add invalidation_javatests. see for example //sync/sync_tests.gypi:sync_javatests https://codereview.chromium.org/459513002/diff/160001/components/invalidation/android/java/src/org/chromium/components/invalidation/InvalidationService.java ...
6 years, 3 months ago (2014-09-10 18:25:04 UTC) #7
maxbogue
Fixed the tests. Let me know if I added invalidation_javatests to the wrong place in ...
6 years, 3 months ago (2014-09-11 20:08:09 UTC) #8
maxbogue
Er, sorry, I meant chrome/chrome_tests.gypi.
6 years, 3 months ago (2014-09-11 20:10:08 UTC) #9
nyquist
lgtm! https://codereview.chromium.org/459513002/diff/200001/components/invalidation/android/java/src/org/chromium/components/invalidation/InvalidationService.java File components/invalidation/android/java/src/org/chromium/components/invalidation/InvalidationService.java (right): https://codereview.chromium.org/459513002/diff/200001/components/invalidation/android/java/src/org/chromium/components/invalidation/InvalidationService.java#newcode11 components/invalidation/android/java/src/org/chromium/components/invalidation/InvalidationService.java:11: import com.google.common.annotations.VisibleForTesting; Please use the one in org.chromium.base ...
6 years, 3 months ago (2014-09-16 17:33:29 UTC) #10
maxbogue
https://codereview.chromium.org/459513002/diff/200001/components/invalidation/android/java/src/org/chromium/components/invalidation/InvalidationService.java File components/invalidation/android/java/src/org/chromium/components/invalidation/InvalidationService.java (right): https://codereview.chromium.org/459513002/diff/200001/components/invalidation/android/java/src/org/chromium/components/invalidation/InvalidationService.java#newcode11 components/invalidation/android/java/src/org/chromium/components/invalidation/InvalidationService.java:11: import com.google.common.annotations.VisibleForTesting; On 2014/09/16 17:33:29, nyquist wrote: > Please ...
6 years, 3 months ago (2014-09-16 21:07:38 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/459513002/220001
6 years, 3 months ago (2014-09-16 23:07:27 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/11420)
6 years, 3 months ago (2014-09-16 23:22:37 UTC) #15
maxbogue
Adding missing OWNERS. +zea for: chrome/browser/sync/profile_sync_service_android.cc chrome/browser/sync/profile_sync_service_android.h +thestig for: chrome/chrome.gyp
6 years, 3 months ago (2014-09-16 23:39:57 UTC) #17
Lei Zhang
chrome/chrome.gyp lgtm, but it looks like you have a sad android try bot. https://codereview.chromium.org/459513002/diff/220001/chrome/browser/invalidation/profile_invalidation_provider_factory.cc File ...
6 years, 3 months ago (2014-09-17 00:26:20 UTC) #18
maxbogue
The trybot error didn't look related to me. Trying a rebase and running them again. ...
6 years, 3 months ago (2014-09-17 00:57:20 UTC) #19
nyquist
Seems to me like InvalidationServiceAndroidTest.FetchClientId crashed?
6 years, 3 months ago (2014-09-17 02:23:45 UTC) #20
Nicolas Zea
sync LGTM
6 years, 3 months ago (2014-09-18 17:39:35 UTC) #21
maxbogue
+caitkp for: components/test/DEPS components/test/run_all_unittests.cc
6 years, 3 months ago (2014-09-19 19:00:25 UTC) #23
Cait (Slow)
lgtm
6 years, 3 months ago (2014-09-19 19:11:06 UTC) #24
maxbogue
+jam for: content/content.gyp content/content_browser.gypi (The invalidation_unittests target revealed some missing DEPS in //content.)
6 years, 3 months ago (2014-09-19 23:24:22 UTC) #26
jam
https://codereview.chromium.org/459513002/diff/380001/content/content.gyp File content/content.gyp (right): https://codereview.chromium.org/459513002/diff/380001/content/content.gyp#newcode156 content/content.gyp:156: 'content_renderer', huh?
6 years, 3 months ago (2014-09-23 05:14:41 UTC) #27
maxbogue
-jam because I removed the //content changes. Sorry about that.
6 years, 2 months ago (2014-09-25 18:59:23 UTC) #29
nyquist
https://codereview.chromium.org/459513002/diff/420001/components/signin.gypi File components/signin.gypi (right): https://codereview.chromium.org/459513002/diff/420001/components/signin.gypi#newcode29 components/signin.gypi:29: '../base/base.gyp:base_i18n', You didn't change anything in this component, why ...
6 years, 2 months ago (2014-09-26 20:26:15 UTC) #30
maxbogue
https://codereview.chromium.org/459513002/diff/420001/components/signin.gypi File components/signin.gypi (right): https://codereview.chromium.org/459513002/diff/420001/components/signin.gypi#newcode29 components/signin.gypi:29: '../base/base.gyp:base_i18n', On 2014/09/26 20:26:15, nyquist wrote: > You didn't ...
6 years, 2 months ago (2014-09-26 21:06:57 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/459513002/440001
6 years, 2 months ago (2014-09-29 17:40:25 UTC) #33
commit-bot: I haz the power
Committed patchset #23 (id:440001) as 7a5485838c3d0c677194fcb17ef9e04e0ab0377f
6 years, 2 months ago (2014-09-29 17:45:29 UTC) #34
commit-bot: I haz the power
6 years, 2 months ago (2014-09-29 17:46:07 UTC) #35
Message was sent while issue was closed.
Patchset 23 (id:??) landed as
https://crrev.com/b8d6efcb29ede4dd881700526930b75a077f9a4e
Cr-Commit-Position: refs/heads/master@{#297202}

Powered by Google App Engine
This is Rietveld 408576698