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

Issue 13197004: Draft: InvalidationService (Closed)

Created:
7 years, 9 months ago by rlarocque
Modified:
7 years, 8 months ago
CC:
chromium-reviews, akalin, Raghu Simha, Aaron Boodman, tzik+watch_chromium.org, chromium-apps-reviews_chromium.org, haitaol1, kinuko+watch, tim (not reviewing), nyquist, pavely, dcheng, Roger Tawa OOO till Jul 10th, Andrew T Wilson (Slow)
Visibility:
Public.

Description

Draft: InvalidationService BUG=

Patch Set 1 #

Patch Set 2 : Fix Android, unit tests, integration tests #

Patch Set 3 : Passes tests #

Total comments: 22
Unified diffs Side-by-side diffs Delta from patch set Stats (+1114 lines, -2174 lines) Patch
A chrome/browser/android_invalidation_service.h View 1 1 chunk +53 lines, -0 lines 3 comments Download
A chrome/browser/android_invalidation_service.cc View 1 1 chunk +85 lines, -0 lines 0 comments Download
M chrome/browser/chrome_to_mobile_service.h View 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/chrome_to_mobile_service.cc View 1 6 chunks +20 lines, -20 lines 0 comments Download
M chrome/browser/chrome_to_mobile_service_unittest.cc View 1 7 chunks +8 lines, -7 lines 0 comments Download
M chrome/browser/extensions/api/push_messaging/push_messaging_api.cc View 1 3 chunks +6 lines, -6 lines 2 comments Download
M chrome/browser/extensions/api/push_messaging/push_messaging_invalidation_handler_unittest.cc View 1 chunk +1 line, -0 lines 0 comments Download
A chrome/browser/invalidation_service.h View 1 1 chunk +89 lines, -0 lines 1 comment Download
A chrome/browser/invalidation_service.cc View 1 1 chunk +286 lines, -0 lines 10 comments Download
A chrome/browser/invalidation_service_factory.h View 1 1 chunk +40 lines, -0 lines 2 comments Download
A chrome/browser/invalidation_service_factory.cc View 1 1 chunk +71 lines, -0 lines 0 comments Download
A chrome/browser/p2p_invalidation_service.h View 1 1 chunk +58 lines, -0 lines 0 comments Download
A chrome/browser/p2p_invalidation_service.cc View 1 1 chunk +132 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_dependency_manager.cc View 1 2 chunks +2 lines, -0 lines 0 comments Download
D chrome/browser/sync/glue/android_invalidator_bridge.h View 1 chunk +0 lines, -85 lines 0 comments Download
D chrome/browser/sync/glue/android_invalidator_bridge.cc View 1 chunk +0 lines, -219 lines 0 comments Download
D chrome/browser/sync/glue/android_invalidator_bridge_proxy.h View 1 chunk +0 lines, -50 lines 0 comments Download
D chrome/browser/sync/glue/android_invalidator_bridge_proxy.cc View 1 chunk +0 lines, -59 lines 0 comments Download
D chrome/browser/sync/glue/android_invalidator_bridge_proxy_unittest.cc View 1 chunk +0 lines, -94 lines 0 comments Download
D chrome/browser/sync/glue/android_invalidator_bridge_unittest.cc View 1 chunk +0 lines, -192 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.h View 1 13 chunks +16 lines, -23 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 1 26 chunks +62 lines, -188 lines 2 comments Download
M chrome/browser/sync/glue/sync_backend_host_unittest.cc View 2 chunks +1 line, -72 lines 0 comments Download
M chrome/browser/sync/invalidation_frontend.h View 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service.h View 1 10 chunks +2 lines, -53 lines 0 comments Download
M chrome/browser/sync/profile_sync_service.cc View 1 2 14 chunks +11 lines, -108 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_autofill_unittest.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service_harness.h View 1 5 chunks +9 lines, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service_harness.cc View 1 4 chunks +24 lines, -2 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_observer.h View 1 1 chunk +4 lines, -0 lines 0 comments Download
A + chrome/browser/sync/profile_sync_service_observer.cc View 1 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_password_unittest.cc View 1 3 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service_preference_unittest.cc View 1 3 chunks +6 lines, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service_session_unittest.cc View 1 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_startup_unittest.cc View 1 11 chunks +23 lines, -11 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_typed_url_unittest.cc View 1 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_unittest.cc View 1 3 chunks +3 lines, -173 lines 0 comments Download
M chrome/browser/sync/test/integration/single_client_bookmarks_sync_test.cc View 1 1 chunk +0 lines, -14 lines 0 comments Download
M chrome/browser/sync/test/integration/sync_test.h View 1 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/sync/test/integration/sync_test.cc View 1 3 chunks +10 lines, -14 lines 0 comments Download
M chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc View 1 1 chunk +0 lines, -15 lines 0 comments Download
M chrome/browser/sync/test_profile_sync_service.h View 2 chunks +0 lines, -5 lines 0 comments Download
M chrome/browser/sync/test_profile_sync_service.cc View 5 chunks +3 lines, -14 lines 0 comments Download
M chrome/browser/sync_file_system/drive_file_sync_service.cc View 1 2 4 chunks +13 lines, -13 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 5 chunks +9 lines, -4 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M sync/internal_api/public/sync_manager.h View 1 5 chunks +7 lines, -25 lines 0 comments Download
M sync/internal_api/public/test/fake_sync_manager.h View 4 chunks +3 lines, -18 lines 0 comments Download
M sync/internal_api/sync_manager_impl.h View 1 6 chunks +3 lines, -21 lines 0 comments Download
M sync/internal_api/sync_manager_impl.cc View 1 2 7 chunks +6 lines, -74 lines 2 comments Download
M sync/internal_api/sync_manager_impl_unittest.cc View 1 9 chunks +3 lines, -40 lines 0 comments Download
M sync/internal_api/test/fake_sync_manager.cc View 1 5 chunks +9 lines, -57 lines 0 comments Download
D sync/notifier/fake_invalidator.h View 1 1 chunk +0 lines, -55 lines 0 comments Download
D sync/notifier/fake_invalidator.cc View 1 1 chunk +0 lines, -77 lines 0 comments Download
D sync/notifier/fake_invalidator_unittest.cc View 1 1 chunk +0 lines, -63 lines 0 comments Download
M sync/notifier/invalidation_notifier.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M sync/notifier/invalidation_notifier.cc View 1 1 chunk +0 lines, -6 lines 0 comments Download
M sync/notifier/invalidator.h View 1 1 chunk +0 lines, -7 lines 0 comments Download
D sync/notifier/invalidator_factory.h View 1 chunk +0 lines, -55 lines 0 comments Download
D sync/notifier/invalidator_factory.cc View 1 chunk +0 lines, -107 lines 0 comments Download
D sync/notifier/invalidator_factory_unittest.cc View 1 chunk +0 lines, -85 lines 0 comments Download
M sync/notifier/invalidator_registrar.cc View 1 2 chunks +3 lines, -1 line 0 comments Download
M sync/notifier/invalidator_registrar_unittest.cc View 1 1 chunk +0 lines, -5 lines 0 comments Download
M sync/notifier/non_blocking_invalidator.h View 1 1 chunk +0 lines, -2 lines 0 comments Download
M sync/notifier/non_blocking_invalidator.cc View 1 1 chunk +0 lines, -7 lines 0 comments Download
M sync/notifier/p2p_invalidator.h View 1 3 chunks +7 lines, -2 lines 0 comments Download
M sync/sync_notifier.gypi View 1 chunk +0 lines, -2 lines 0 comments Download
M sync/sync_tests.gypi View 1 2 chunks +0 lines, -6 lines 0 comments Download
M sync/tools/testserver/xmppserver.py View 1 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
rlarocque
Wondering why you're being CC'ed on this review? Jump to the bottom of this message ...
7 years, 8 months ago (2013-04-05 20:40:06 UTC) #1
rlarocque
On 2013/04/05 20:40:06, rlarocque wrote: > Wondering why you're being CC'ed on this review? Jump ...
7 years, 8 months ago (2013-04-05 20:41:32 UTC) #2
tim (not reviewing)
This is a big (but cool) patch. Hopefully it can be split up a bit? ...
7 years, 8 months ago (2013-04-15 16:48:24 UTC) #3
tim (not reviewing)
https://codereview.chromium.org/13197004/diff/17001/chrome/browser/android_invalidation_service.h File chrome/browser/android_invalidation_service.h (right): https://codereview.chromium.org/13197004/diff/17001/chrome/browser/android_invalidation_service.h#newcode5 chrome/browser/android_invalidation_service.h:5: #ifndef CHROME_BROWSER_ANDROID_INVALIDATION_SERVICE_H_ On 2013/04/15 16:48:24, timsteele wrote: > Just ...
7 years, 8 months ago (2013-04-15 16:49:45 UTC) #4
rlarocque
Drew/Roger: Ping. I don't need you to review the entire CL, I just need pointers ...
7 years, 8 months ago (2013-04-17 01:02:32 UTC) #5
rlarocque
I've uploaded a rebased patch and responded to some comments. I expect this is the ...
7 years, 8 months ago (2013-04-22 21:47:15 UTC) #6
tim (not reviewing)
7 years, 8 months ago (2013-04-22 22:13:56 UTC) #7
https://codereview.chromium.org/13197004/diff/17001/chrome/browser/invalidati...
File chrome/browser/invalidation_service.cc (right):

https://codereview.chromium.org/13197004/diff/17001/chrome/browser/invalidati...
chrome/browser/invalidation_service.cc:182: case
chrome::NOTIFICATION_TOKEN_AVAILABLE: {
On 2013/04/22 21:47:15, rlarocque wrote:
> On 2013/04/15 16:48:24, timsteele wrote:
> > I forget, do we always send TOKEN_AVAILABLE from TokenService when it loads
> > tokens from storage at startup (vs TOKEN_LOADING_FINISHED)?  Is it the same
on
> > all platforms?
> 
> I think that's always guaranteed.  I was a bit suspicious, since the
> ProfileSyncService seems to think it needs to register for both notifications.
 
> 
> Looking at the implementation:
>  - TOKEN_LOADING_FINISHED is emitted by TokenService::LoadTokensIntoMemory()
>  - LoadTokensIntoMemory also has a loop that calls
> TokenService::LoadSingleTokenIntoMemory()
>  - LoadSingleTokenIntoMemory calls FireTokenAvailableNotifications(), which
> emits a TOKEN_AVAILABLE notification.
> 
> I think ProfileSyncService got it wrong; we only need to register for
> TOKEN_AVAILABLE.

More likely is at one time TOKEN_AVAILABLE was actually required, but this code
was left behind in the dust of a refactoring elsewhere.  In any case, Drew would
be the best person to review this.

https://codereview.chromium.org/13197004/diff/17001/chrome/browser/invalidati...
chrome/browser/invalidation_service.cc:189: Start();
On 2013/04/22 21:47:15, rlarocque wrote:
> On 2013/04/15 16:48:24, timsteele wrote:
> > You should check with atwilson@ and rogerta@ about hooking
InvalidationService
> > up with SigninTracker.  See SigninTracker::AreServicesSignedIn, for example.

> As
> > written I think this patch slightly changes the behavior when you sign in to
> > Chrome, since before we were checking ProfileSyncService auth errors (hence
> > invalidator auth errors) before broadcasting
> > SigninTracker::Observer::SigninSuccess.  The OneClickSigninHelper uses that
> > interface as the primary hook to know when its job is done.
> 
> I'm not sure that we want to go in that direction.  I see that
> AreServicesSignedIn() checks for sync-specific things, like
> !service->HasUnrecoverableError().  Should the InvalidationService fail to
start
> if some data type's configuration failed and generated an unrecoverable error?

> I don't think so, but maybe I'm missing something.  
> 
> We can generalize the question as "Should the InvalidationService stop working
> when sync isn't working?"  Currently, invalidations stop working when sync
does,
> so the backwards-compatibility argument favours disabling invalidations when
> sync is broken.  On the other hand, part of the point of this patch is to keep
> sync-specific issues from interfering with invalidations.  
> 
> I'm currently leaning towards keeping them independent, mostly because I have
> more confidence that I could implement this approach correctly.  

As I said, just make sure you check with Drew (at least), since he created the
AreServicesSignedIn method and at one time had some thoughts about how we might
extend this in the future for other non-sync services.

https://codereview.chromium.org/13197004/diff/17001/chrome/browser/invalidati...
chrome/browser/invalidation_service.cc:268: // FIXME: Is it right to use the
sync token here?
On 2013/04/22 21:47:15, rlarocque wrote:
> On 2013/04/15 16:48:24, timsteele wrote:
> > Yes, this seems correct and equivalent to before this CL. I think it's true
> that
> > we'll likely want a separate token down the road for "user-type syncing
> > capabilities" versus "chrome system syncing capabilities", and the latter
may
> or
> > may not be strictly limited to Invalidations (e.g, non-user-controlled
> datatypes
> > for playpen / enterprise policy).  If there isn't already a bug for this,
feel
> > free to open one and reference it here in a TODO.  But for now what you are
> > doing here is the right thing.
> 
> OK.  Just to be clear, my intent with this patch is not to create a
system-level
> syncing service.  InvalidationService is still a ProfileKeyedService and is
> still tied to a specific user.  
> 
> I was considering using a separate token here so that we have less
dependencies
> on sync.  For example, I see that Chrome-to-Mobile and cloud policy have their
> own sync tokens.  It made me think that maybe InvalidationService should have
> its own token, too.

So, yes.  I think we're in agreement? In the future we'll want separate tokens
or scopes. We may want one for invalidations, one for system sync, and one for
profile sync, or a different combination; I think this requires its own design
and CL. We may already have a bug for this, I'll keep looking...

Powered by Google App Engine
This is Rietveld 408576698