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 225403021: Extract Profile-independent GCMService from GCMProfileService (Closed)

Created:
6 years, 8 months ago by bartfab (slow)
Modified:
6 years, 8 months ago
CC:
chromium-reviews, fgorski
Visibility:
Public.

Description

Extract Profile-independent GCMService from GCMProfileService This CL moves most of the GCMProfileService functionality to a new GCMService class that does not depend on Profile. GCMProfileService becomes a subclass of GCMService that adds Profile-specific lifetime management and control over the service via user preferences. The CL is a prerequisite for Chrome OS device policy pushing, which will need to instantiate a Tango connection using device-wide GAIA credentials not tied to any user or Profile. The CL also fixes a few subtle bugs, such as GCMProfileService::IOWorker being shut down on the wrong thread and unit tests looking at the wrong GCMProfileService when trying to verify correct behavior. BUG=362083 TEST=Updated unit tests R=atwilson@chromium.org, dcheng@chromium.org, jianli@chromium.org, yoz@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266197

Patch Set 1 #

Patch Set 2 : Make chrome compile. #

Patch Set 3 : Ready for review. #

Patch Set 4 : Pass scoped_refptr as const reference. #

Total comments: 26

Patch Set 5 : Addressed comments. Rebased on top of CL 235273002. #

Patch Set 6 : Rebased. #

Patch Set 7 : Rebased. #

Patch Set 8 : Stop calling ProfileOAuth2TokenService::GetAccounts() which contains nothing but a NOTREACHED(). #

Patch Set 9 : Provide GCMService with the list of all accounts. It does use it after all. #

Total comments: 26

Patch Set 10 : Addressed most comments. #

Total comments: 8

Patch Set 11 : Rebased. #

Patch Set 12 : Comments addressed. #

Total comments: 6

Patch Set 13 : Addressed comments. #

Total comments: 2

Patch Set 14 : Ready to go. #

Patch Set 15 : Compilation fix. #

Patch Set 16 : Compilation fixes. #

Patch Set 17 : Fix compilation on Android. #

Patch Set 18 : Do not create real threads in unit tests unnecessarily. #

Patch Set 19 : Disambiguate FakeSigninManager. #

Patch Set 20 : Restore real IO thread in unit tests. Remove sources of flakiness by waiting instead of pumping whe… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2083 lines, -2892 lines) Patch
M chrome/browser/extensions/extension_gcm_app_handler.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_gcm_app_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 10 chunks +118 lines, -31 lines 0 comments Download
M chrome/browser/invalidation/gcm_invalidation_bridge.h View 1 2 3 4 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/invalidation/gcm_invalidation_bridge.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +12 lines, -13 lines 0 comments Download
M chrome/browser/invalidation/ticl_invalidation_service.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -2 lines 0 comments Download
A chrome/browser/services/gcm/fake_gcm_client_factory.h View 1 2 3 4 5 6 7 8 9 1 chunk +34 lines, -0 lines 0 comments Download
A chrome/browser/services/gcm/fake_gcm_client_factory.cc View 1 2 3 4 5 6 7 8 9 1 chunk +24 lines, -0 lines 0 comments Download
A chrome/browser/services/gcm/fake_signin_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +54 lines, -0 lines 0 comments Download
A chrome/browser/services/gcm/fake_signin_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +56 lines, -0 lines 0 comments Download
M chrome/browser/services/gcm/gcm_client_mock.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/services/gcm/gcm_profile_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +12 lines, -191 lines 0 comments Download
M chrome/browser/services/gcm/gcm_profile_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +38 lines, -870 lines 0 comments Download
M chrome/browser/services/gcm/gcm_profile_service_factory.h View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/services/gcm/gcm_profile_service_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +10 lines, -0 lines 0 comments Download
D chrome/browser/services/gcm/gcm_profile_service_test_helper.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -94 lines 0 comments Download
D chrome/browser/services/gcm/gcm_profile_service_test_helper.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -119 lines 0 comments Download
D chrome/browser/services/gcm/gcm_profile_service_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +108 lines, -1161 lines 0 comments Download
A + chrome/browser/services/gcm/gcm_service.h View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +48 lines, -83 lines 0 comments Download
A + chrome/browser/services/gcm/gcm_service.cc View 1 2 3 4 5 6 7 8 9 10 11 24 chunks +219 lines, -316 lines 0 comments Download
A chrome/browser/services/gcm/gcm_service_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +1318 lines, -0 lines 0 comments Download
M chrome/browser/signin/profile_identity_provider.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +8 lines, -1 line 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 1 chunk +2 lines, -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 1 chunk +5 lines, -2 lines 0 comments Download
M sync/notifier/gcm_network_channel.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M sync/notifier/gcm_network_channel_delegate.h View 1 2 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 49 (0 generated)
bartfab (slow)
Hi Jian, Can you please review: chrome/browser/services/gcm/* chrome/browser/extensions/api/gcm/* Hi Daniel, Can you please review chrome/browser/invalidation/*? ...
6 years, 8 months ago (2014-04-10 14:55:57 UTC) #1
jianli
Have you made sure all tests passed on trybots, esp. memory bots? https://codereview.chromium.org/225403021/diff/50001/chrome/browser/extensions/api/gcm/gcm_api.cc File chrome/browser/extensions/api/gcm/gcm_api.cc ...
6 years, 8 months ago (2014-04-10 20:39:55 UTC) #2
Yoyo Zhou
extensions OWNERS rubber stamp LGTM
6 years, 8 months ago (2014-04-10 21:12:04 UTC) #3
bartfab (slow)
https://codereview.chromium.org/225403021/diff/50001/chrome/browser/extensions/api/gcm/gcm_api.cc File chrome/browser/extensions/api/gcm/gcm_api.cc (right): https://codereview.chromium.org/225403021/diff/50001/chrome/browser/extensions/api/gcm/gcm_api.cc#newcode101 chrome/browser/extensions/api/gcm/gcm_api.cc:101: gcm::GCMService* GcmApiFunction::GCMService() const { On 2014/04/10 20:39:56, jianli wrote: ...
6 years, 8 months ago (2014-04-11 16:58:52 UTC) #4
jianli
https://codereview.chromium.org/225403021/diff/50001/chrome/browser/services/gcm/gcm_service.cc File chrome/browser/services/gcm/gcm_service.cc (right): https://codereview.chromium.org/225403021/diff/50001/chrome/browser/services/gcm/gcm_service.cc#newcode428 chrome/browser/services/gcm/gcm_service.cc:428: base::Unretained(io_worker_.get()))); On 2014/04/11 16:58:52, bartfab wrote: > On 2014/04/10 ...
6 years, 8 months ago (2014-04-17 00:33:18 UTC) #5
bartfab (slow)
Hi Yoyo, I addressed most of your comments. I will address the remaining comments as ...
6 years, 8 months ago (2014-04-17 14:20:00 UTC) #6
Yoyo Zhou
On Thu, Apr 17, 2014 at 7:20 AM, <bartfab@chromium.org> wrote: > Hi Yoyo, > > ...
6 years, 8 months ago (2014-04-17 16:10:53 UTC) #7
Munjal (Google)
This refactoring is useful. But several high level comments: - The patch seems to be ...
6 years, 8 months ago (2014-04-17 18:51:24 UTC) #8
jianli
On Thu, Apr 17, 2014 at 11:51 AM, <munjal@chromium.org> wrote: > This refactoring is useful. ...
6 years, 8 months ago (2014-04-17 19:05:58 UTC) #9
jianli
On 2014/04/17 14:20:00, bartfab wrote: > Hi Yoyo, > > I addressed most of your ...
6 years, 8 months ago (2014-04-18 01:35:52 UTC) #10
jianli
You have not addressed my comment that 2 tests in gcm_profile_service_unittest.cc were removed without any ...
6 years, 8 months ago (2014-04-18 01:49:43 UTC) #11
bartfab (slow)
https://codereview.chromium.org/225403021/diff/210001/chrome/browser/services/gcm/gcm_profile_service_unittest.cc File chrome/browser/services/gcm/gcm_profile_service_unittest.cc (left): https://codereview.chromium.org/225403021/diff/210001/chrome/browser/services/gcm/gcm_profile_service_unittest.cc#oldcode494 chrome/browser/services/gcm/gcm_profile_service_unittest.cc:494: TEST_F(GCMProfileServiceTest, RegisterUnderNeutralChannelSignal) { On 2014/04/17 00:33:19, jianli wrote: > ...
6 years, 8 months ago (2014-04-22 17:51:06 UTC) #12
bartfab (slow)
On 2014/04/17 16:10:53, Yoyo Zhou wrote: > On Thu, Apr 17, 2014 at 7:20 AM, ...
6 years, 8 months ago (2014-04-22 17:51:51 UTC) #13
bartfab (slow)
On 2014/04/17 19:05:58, jianli wrote: > On Thu, Apr 17, 2014 at 11:51 AM, <mailto:munjal@chromium.org> ...
6 years, 8 months ago (2014-04-22 17:56:46 UTC) #14
bartfab (slow)
On 2014/04/18 01:35:52, jianli wrote: > On 2014/04/17 14:20:00, bartfab wrote: > > Hi Yoyo, ...
6 years, 8 months ago (2014-04-22 17:59:45 UTC) #15
bartfab (slow)
On 2014/04/18 01:49:43, jianli wrote: > You have not addressed my comment that 2 tests ...
6 years, 8 months ago (2014-04-22 18:00:37 UTC) #16
jianli
lgtm https://codereview.chromium.org/225403021/diff/260001/chrome/browser/services/gcm/gcm_profile_service_unittest.cc File chrome/browser/services/gcm/gcm_profile_service_unittest.cc (right): https://codereview.chromium.org/225403021/diff/260001/chrome/browser/services/gcm/gcm_profile_service_unittest.cc#newcode49 chrome/browser/services/gcm/gcm_profile_service_unittest.cc:49: class FakeSigninManager : public SigninManagerBase { This has ...
6 years, 8 months ago (2014-04-23 00:42:31 UTC) #17
dcheng
chrome/browser/invalidation/* LGTM with one question https://codereview.chromium.org/225403021/diff/260001/chrome/browser/invalidation/ticl_invalidation_service.cc File chrome/browser/invalidation/ticl_invalidation_service.cc (right): https://codereview.chromium.org/225403021/diff/260001/chrome/browser/invalidation/ticl_invalidation_service.cc#newcode432 chrome/browser/invalidation/ticl_invalidation_service.cc:432: if (gcm::GCMProfileService::GetGCMEnabledState(profile_) == Do ...
6 years, 8 months ago (2014-04-23 01:13:58 UTC) #18
bartfab (slow)
https://codereview.chromium.org/225403021/diff/260001/chrome/browser/invalidation/ticl_invalidation_service.cc File chrome/browser/invalidation/ticl_invalidation_service.cc (right): https://codereview.chromium.org/225403021/diff/260001/chrome/browser/invalidation/ticl_invalidation_service.cc#newcode432 chrome/browser/invalidation/ticl_invalidation_service.cc:432: if (gcm::GCMProfileService::GetGCMEnabledState(profile_) == On 2014/04/23 01:13:58, dcheng wrote: > ...
6 years, 8 months ago (2014-04-23 11:33:07 UTC) #19
bartfab (slow)
Hi Drew, You are the only remaining reviewer I need on this CL.
6 years, 8 months ago (2014-04-23 11:34:03 UTC) #20
Andrew T Wilson (Slow)
lgtm https://codereview.chromium.org/225403021/diff/280001/chrome/browser/sync/profile_sync_service.cc File chrome/browser/sync/profile_sync_service.cc (right): https://codereview.chromium.org/225403021/diff/280001/chrome/browser/sync/profile_sync_service.cc#newcode32 chrome/browser/sync/profile_sync_service.cc:32: #include "chrome/browser/services/gcm/gcm_profile_service.h" Do we still need this include ...
6 years, 8 months ago (2014-04-24 08:35:09 UTC) #21
bartfab (slow)
https://codereview.chromium.org/225403021/diff/280001/chrome/browser/sync/profile_sync_service.cc File chrome/browser/sync/profile_sync_service.cc (right): https://codereview.chromium.org/225403021/diff/280001/chrome/browser/sync/profile_sync_service.cc#newcode32 chrome/browser/sync/profile_sync_service.cc:32: #include "chrome/browser/services/gcm/gcm_profile_service.h" On 2014/04/24 08:35:10, Andrew T Wilson wrote: ...
6 years, 8 months ago (2014-04-24 08:41:01 UTC) #22
bartfab (slow)
The CQ bit was checked by bartfab@chromium.org
6 years, 8 months ago (2014-04-24 08:41:17 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartfab@chromium.org/225403021/300001
6 years, 8 months ago (2014-04-24 08:41:26 UTC) #24
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-24 09:29:38 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on chromium_presubmit
6 years, 8 months ago (2014-04-24 09:29:39 UTC) #26
bartfab (slow)
The CQ bit was checked by bartfab@chromium.org
6 years, 8 months ago (2014-04-24 09:36:34 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartfab@chromium.org/225403021/320001
6 years, 8 months ago (2014-04-24 09:36:56 UTC) #28
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-24 11:31:10 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_clang_dbg tryserver.chromium on linux_chromium_clang_dbg tryserver.chromium on mac_chromium_compile_dbg ...
6 years, 8 months ago (2014-04-24 11:31:11 UTC) #30
bartfab (slow)
The CQ bit was checked by bartfab@chromium.org
6 years, 8 months ago (2014-04-24 11:34:01 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartfab@chromium.org/225403021/330025
6 years, 8 months ago (2014-04-24 11:34:20 UTC) #32
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-24 13:30:24 UTC) #33
commit-bot: I haz the power
Retried try job too often on android_dbg for step(s) slave_steps http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=android_dbg&number=174831
6 years, 8 months ago (2014-04-24 13:30:25 UTC) #34
bartfab (slow)
The CQ bit was checked by bartfab@chromium.org
6 years, 8 months ago (2014-04-24 13:55:19 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartfab@chromium.org/225403021/350001
6 years, 8 months ago (2014-04-24 14:16:35 UTC) #36
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-24 16:16:36 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel
6 years, 8 months ago (2014-04-24 16:16:37 UTC) #38
bartfab (slow)
The CQ bit was checked by bartfab@chromium.org
6 years, 8 months ago (2014-04-24 16:31:07 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartfab@chromium.org/225403021/350001
6 years, 8 months ago (2014-04-24 16:31:43 UTC) #40
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-24 17:03:53 UTC) #41
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on win_chromium_rel
6 years, 8 months ago (2014-04-24 17:03:54 UTC) #42
bartfab (slow)
The CQ bit was checked by bartfab@chromium.org
6 years, 8 months ago (2014-04-24 18:45:12 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartfab@chromium.org/225403021/420001
6 years, 8 months ago (2014-04-24 21:12:00 UTC) #44
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-24 22:46:48 UTC) #45
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on chromium_presubmit
6 years, 8 months ago (2014-04-24 22:46:49 UTC) #46
bartfab (slow)
The CQ bit was checked by bartfab@chromium.org
6 years, 8 months ago (2014-04-25 07:59:04 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartfab@chromium.org/225403021/420001
6 years, 8 months ago (2014-04-25 08:31:01 UTC) #48
bartfab (slow)
6 years, 8 months ago (2014-04-25 15:37:03 UTC) #49
Message was sent while issue was closed.
Committed patchset #20 manually as r266197 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698