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

Issue 15421011: Use OAuth2 token for sync (Closed)

Created:
7 years, 7 months ago by pavely
Modified:
7 years, 6 months ago
CC:
chromium-reviews, Raghu Simha, haitaol1, akalin, tim (not reviewing), cbentzel+watch_chromium.org, Bernhard Bauer
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Use OAuth2 token for sync ProfileSyncService requests access token from OAuth2TokenService and passes it to ServerConnectionManager through UpdateCredentials. When server returns AUTH_ERROR it gets propagated to ProfileSyncService through OnGetStatusChange call. At this point ProfileSyncService needs to invalidate old token with OAuth2TokenService and request a new one. Access token is requested in PSS::StartUp since this is the place where all preconditions are verified. There is a call to pre-request access token in Initialize and Observe after Login token is loaded. There are still two tests disabled, I'll fix them and update this CR. BUG=226464 TBR=jhawkins@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=206224

Patch Set 1 #

Total comments: 80

Patch Set 2 : Fix issues based on feedback #

Total comments: 9

Patch Set 3 : Remove token prefetch. Move UMA counters. Fix some tests. Etc. #

Total comments: 18

Patch Set 4 : Rebase, apply feedback. #

Patch Set 5 : Cleanup #

Patch Set 6 : Add todo #

Patch Set 7 : Rebase #

Patch Set 8 : Fix test after rebase #

Patch Set 9 : Last upload didn't work, retrying #

Patch Set 10 : Fix android build #

Patch Set 11 : Fix android build #

Total comments: 1

Patch Set 12 : Rebase. Fix integration tests. #

Patch Set 13 : Add commandline switch to toggle between OAuth2 and ClientLogin token #

Total comments: 1

Patch Set 14 : Fix test. Rebase. #

Patch Set 15 : Inverse command line flag to "disable oauth2". Set it by default for android. #

Total comments: 3

Patch Set 16 : Apply feedback #

Patch Set 17 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+503 lines, -179 lines) Patch
M chrome/browser/android/chrome_startup_flags.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/signin/signin_tracker_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +5 lines, -1 line 0 comments Download
M chrome/browser/sync/about_sync_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +10 lines, -4 lines 0 comments Download
M chrome/browser/sync/profile_sync_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +40 lines, -4 lines 0 comments Download
M chrome/browser/sync/profile_sync_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 15 chunks +195 lines, -49 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_autofill_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +7 lines, -2 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_harness.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_mock.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service_password_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_preference_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_session_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_startup_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 19 chunks +50 lines, -31 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_typed_url_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/sync/test/integration/single_client_managed_user_settings_sync_test.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/sync/test/integration/sync_errors_test.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +14 lines, -2 lines 0 comments Download
M chrome/browser/sync/test_profile_sync_service.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +21 lines, -0 lines 0 comments Download
M chrome/browser/sync/test_profile_sync_service.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +38 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/options/browser_options_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/sync_setup_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 12 chunks +12 lines, -11 lines 0 comments Download
M chrome/common/chrome_switches.h 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 chrome/common/chrome_switches.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +4 lines, -0 lines 0 comments Download
M google_apis/gaia/gaia_constants.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M google_apis/gaia/gaia_constants.cc View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M jingle/notifier/base/notifier_options_util.cc View 1 chunk +5 lines, -2 lines 0 comments Download
M sync/engine/net/server_connection_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +12 lines, -11 lines 0 comments Download
M sync/engine/net/server_connection_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +4 lines, -30 lines 0 comments Download
M sync/engine/syncer_proto_util_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M sync/internal_api/public/sync_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -3 lines 0 comments Download
M sync/internal_api/public/test/fake_sync_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M sync/internal_api/sync_manager_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M sync/internal_api/sync_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +5 lines, -5 lines 0 comments Download
M sync/internal_api/sync_manager_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -1 line 0 comments Download
M sync/internal_api/syncapi_server_connection_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M sync/internal_api/syncapi_server_connection_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +9 lines, -4 lines 0 comments Download
M sync/internal_api/syncapi_server_connection_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M sync/internal_api/test/fake_sync_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -1 line 0 comments Download
M sync/test/engine/mock_connection_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -2 lines 0 comments Download
M sync/tools/sync_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M sync/tools/testserver/xmppserver.py View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 48 (0 generated)
pavely
7 years, 7 months ago (2013-05-20 16:07:53 UTC) #1
tim (not reviewing)
https://codereview.chromium.org/15421011/diff/1/chrome/browser/signin/oauth2_token_service.cc File chrome/browser/signin/oauth2_token_service.cc (right): https://codereview.chromium.org/15421011/diff/1/chrome/browser/signin/oauth2_token_service.cc#newcode443 chrome/browser/signin/oauth2_token_service.cc:443: if (token_iterator != token_cache_.end() && I guess this wasn't ...
7 years, 7 months ago (2013-05-23 19:03:41 UTC) #2
Andrew T Wilson (Slow)
https://codereview.chromium.org/15421011/diff/1/chrome/browser/signin/oauth2_token_service.cc File chrome/browser/signin/oauth2_token_service.cc (right): https://codereview.chromium.org/15421011/diff/1/chrome/browser/signin/oauth2_token_service.cc#newcode443 chrome/browser/signin/oauth2_token_service.cc:443: if (token_iterator != token_cache_.end() && On 2013/05/23 19:03:41, timsteele ...
7 years, 7 months ago (2013-05-24 14:10:15 UTC) #3
pavely
Andrew, please take a look. https://codereview.chromium.org/15421011/diff/1/chrome/browser/signin/oauth2_token_service.cc File chrome/browser/signin/oauth2_token_service.cc (right): https://codereview.chromium.org/15421011/diff/1/chrome/browser/signin/oauth2_token_service.cc#newcode443 chrome/browser/signin/oauth2_token_service.cc:443: if (token_iterator != token_cache_.end() ...
7 years, 6 months ago (2013-05-30 07:42:12 UTC) #4
Andrew T Wilson (Slow)
I'd really like to convince you to get rid of the token prefetch, unless Tim ...
7 years, 6 months ago (2013-05-31 12:57:27 UTC) #5
pavely
+jhawkins for browser_options_handler.cc +zea for jingle/notifier/base/notifier_options_util.cc and UMA counter code in PSS::OnGetTokenFailure Drew, could you ...
7 years, 6 months ago (2013-06-04 00:49:58 UTC) #6
Andrew T Wilson (Slow)
LGTM with some nits/questions. Also looping in nyquist/qsr to comment on impact for Android/iOS. https://codereview.chromium.org/15421011/diff/22001/chrome/browser/sync/profile_sync_service.cc ...
7 years, 6 months ago (2013-06-04 14:37:31 UTC) #7
qsr
+chenyu
7 years, 6 months ago (2013-06-04 15:16:45 UTC) #8
pavely
https://codereview.chromium.org/15421011/diff/22001/chrome/browser/sync/profile_sync_service.cc File chrome/browser/sync/profile_sync_service.cc (right): https://codereview.chromium.org/15421011/diff/22001/chrome/browser/sync/profile_sync_service.cc#newcode138 chrome/browser/sync/profile_sync_service.cc:138: 0, On 2013/06/04 14:37:32, Andrew T Wilson wrote: > ...
7 years, 6 months ago (2013-06-04 20:11:13 UTC) #9
Nicolas Zea
jingle and PSS UMA LGTM, with one question https://codereview.chromium.org/15421011/diff/22001/chrome/browser/sync/profile_sync_service.cc File chrome/browser/sync/profile_sync_service.cc (right): https://codereview.chromium.org/15421011/diff/22001/chrome/browser/sync/profile_sync_service.cc#newcode747 chrome/browser/sync/profile_sync_service.cc:747: nit: ...
7 years, 6 months ago (2013-06-04 20:13:58 UTC) #10
pavely
https://codereview.chromium.org/15421011/diff/22001/sync/engine/net/server_connection_manager.cc File sync/engine/net/server_connection_manager.cc (left): https://codereview.chromium.org/15421011/diff/22001/sync/engine/net/server_connection_manager.cc#oldcode232 sync/engine/net/server_connection_manager.cc:232: UMA_HISTOGRAM_CUSTOM_TIMES("Sync.AuthInvalidationRejectedTokenAgeShort", On 2013/06/04 20:13:59, Nicolas Zea wrote: > Is ...
7 years, 6 months ago (2013-06-04 21:30:45 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pavely@chromium.org/15421011/39001
7 years, 6 months ago (2013-06-04 21:31:14 UTC) #12
Nicolas Zea
https://codereview.chromium.org/15421011/diff/22001/sync/engine/net/server_connection_manager.cc File sync/engine/net/server_connection_manager.cc (left): https://codereview.chromium.org/15421011/diff/22001/sync/engine/net/server_connection_manager.cc#oldcode232 sync/engine/net/server_connection_manager.cc:232: UMA_HISTOGRAM_CUSTOM_TIMES("Sync.AuthInvalidationRejectedTokenAgeShort", On 2013/06/04 21:30:45, pavely wrote: > On 2013/06/04 ...
7 years, 6 months ago (2013-06-04 21:33:28 UTC) #13
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=6750
7 years, 6 months ago (2013-06-04 21:40:44 UTC) #14
pavely
+ Roger for gaia_constants.h/gaia_constants.cc
7 years, 6 months ago (2013-06-04 22:32:33 UTC) #15
Roger Tawa OOO till Jul 10th
Gaia constants lgtm On Jun 4, 2013 6:32 PM, <pavely@chromium.org> wrote: > + Roger for ...
7 years, 6 months ago (2013-06-05 13:02:31 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pavely@chromium.org/15421011/46001
7 years, 6 months ago (2013-06-05 20:25:14 UTC) #17
commit-bot: I haz the power
Failed to apply patch for chrome/browser/sync/profile_sync_service.h: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 6 months ago (2013-06-05 20:25:19 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pavely@chromium.org/15421011/52001
7 years, 6 months ago (2013-06-05 20:56:41 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pavely@chromium.org/15421011/70001
7 years, 6 months ago (2013-06-05 21:17:18 UTC) #20
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=7013
7 years, 6 months ago (2013-06-05 21:38:03 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pavely@chromium.org/15421011/70001
7 years, 6 months ago (2013-06-05 21:50:23 UTC) #22
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=7047
7 years, 6 months ago (2013-06-05 22:51:32 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pavely@chromium.org/15421011/84001
7 years, 6 months ago (2013-06-05 22:57:49 UTC) #24
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 6 months ago (2013-06-06 00:53:11 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pavely@chromium.org/15421011/102001
7 years, 6 months ago (2013-06-06 01:10:07 UTC) #26
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 6 months ago (2013-06-06 01:56:21 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pavely@chromium.org/15421011/120001
7 years, 6 months ago (2013-06-06 04:23:38 UTC) #28
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) sync_integration_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=134868
7 years, 6 months ago (2013-06-06 06:25:52 UTC) #29
Andrew T Wilson (Slow)
https://codereview.chromium.org/15421011/diff/120001/chrome/browser/signin/signin_tracker.cc File chrome/browser/signin/signin_tracker.cc (right): https://codereview.chromium.org/15421011/diff/120001/chrome/browser/signin/signin_tracker.cc#newcode20 chrome/browser/signin/signin_tracker.cc:20: GaiaConstants::kSyncService, BTW, should we stop fetching the kSyncService token ...
7 years, 6 months ago (2013-06-07 13:04:42 UTC) #30
nyquist
On 2013/06/07 13:04:42, Andrew T Wilson wrote: > https://codereview.chromium.org/15421011/diff/120001/chrome/browser/signin/signin_tracker.cc > File chrome/browser/signin/signin_tracker.cc (right): > > ...
7 years, 6 months ago (2013-06-07 22:39:17 UTC) #31
pavely
7 years, 6 months ago (2013-06-12 17:19:50 UTC) #32
tim (not reviewing)
https://codereview.chromium.org/15421011/diff/135002/chrome/browser/sync/profile_sync_service.cc File chrome/browser/sync/profile_sync_service.cc (right): https://codereview.chromium.org/15421011/diff/135002/chrome/browser/sync/profile_sync_service.cc#newcode449 chrome/browser/sync/profile_sync_service.cc:449: use_oauth2_token_ = command_line.HasSwitch(switches::kSyncEnableOAuth2Token); Should the flag not be to ...
7 years, 6 months ago (2013-06-12 20:07:37 UTC) #33
pavely
Tim, PTAL.
7 years, 6 months ago (2013-06-12 21:09:57 UTC) #34
tim (not reviewing)
https://codereview.chromium.org/15421011/diff/153001/chrome/browser/sync/profile_sync_service.cc File chrome/browser/sync/profile_sync_service.cc (right): https://codereview.chromium.org/15421011/diff/153001/chrome/browser/sync/profile_sync_service.cc#newcode221 chrome/browser/sync/profile_sync_service.cc:221: bool ProfileSyncService::IsOAuthRefreshTokenAvailable() { Are we sure this isn't called ...
7 years, 6 months ago (2013-06-12 21:54:49 UTC) #35
pavely
Tim, please take a look. https://codereview.chromium.org/15421011/diff/153001/chrome/browser/sync/profile_sync_service.cc File chrome/browser/sync/profile_sync_service.cc (right): https://codereview.chromium.org/15421011/diff/153001/chrome/browser/sync/profile_sync_service.cc#newcode321 chrome/browser/sync/profile_sync_service.cc:321: UMA_HISTOGRAM_BOOLEAN("Sync.CredentialsLost", On 2013/06/12 21:54:49, ...
7 years, 6 months ago (2013-06-12 23:12:31 UTC) #36
tim (not reviewing)
LGTM +mpearson for tools/metrics/histograms OWNERS review.
7 years, 6 months ago (2013-06-12 23:28:45 UTC) #37
Mark P
lgtm
7 years, 6 months ago (2013-06-12 23:31:10 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pavely@chromium.org/15421011/160001
7 years, 6 months ago (2013-06-12 23:42:36 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pavely@chromium.org/15421011/160001
7 years, 6 months ago (2013-06-13 02:27:06 UTC) #40
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 6 months ago (2013-06-13 06:52:07 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pavely@chromium.org/15421011/160001
7 years, 6 months ago (2013-06-13 07:01:58 UTC) #42
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
7 years, 6 months ago (2013-06-13 07:07:27 UTC) #43
Andrew T Wilson (Slow)
I'm concerned we've lost all test coverage for the non-oauth-token codepath. How can we verify ...
7 years, 6 months ago (2013-06-13 07:57:02 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pavely@chromium.org/15421011/160001
7 years, 6 months ago (2013-06-13 13:12:19 UTC) #45
commit-bot: I haz the power
Failed to apply patch for chrome/browser/signin/signin_tracker.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
7 years, 6 months ago (2013-06-13 13:12:26 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pavely@chromium.org/15421011/197001
7 years, 6 months ago (2013-06-13 17:49:43 UTC) #47
commit-bot: I haz the power
7 years, 6 months ago (2013-06-13 23:52:05 UTC) #48
Message was sent while issue was closed.
Change committed as 206224

Powered by Google App Engine
This is Rietveld 408576698