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

Issue 2663783002: [Sync] Split encryption state and logic out of PSS and SBHI. (Closed)

Created:
3 years, 10 months ago by maxbogue
Modified:
3 years, 10 months ago
Reviewers:
Peter Kasting, skym, pavely
CC:
chromium-reviews, jdonnelly+watch_chromium.org, sync-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Sync] Split encryption state and logic out of PSS and SBHI. This change consolidates several pieces of state and logic regarding encryption on the UI thread from ProfileSyncService and SyncBackendHostImpl into a new class called SyncServiceCrypto. This unblocks the SyncEngine work by removing several synchronous calls from the SyncEngine interface, and removing logic from SBHI. The SyncEncryptionHandler::Observer interface is now used to proxy calls from the sync thread to the crypto object on the UI thread. SBHC therefore no longer needs to implement it, SBHI doesn't need weird other versions of the methods, and SyncEngineHost doesn't need duplicate versions of several of the methods. Other notes: - Added IsNigoriEnabled to DataTypeManager because it no longer made sense on SyncEngine and it seemed to fit there. - Moved ClearServerDataEvents to the SyncService header because I needed it in the new object. - NotifyObservers and friends have been moved to SyncServiceBase so they can be bound to the crypto object. - ProfileSyncService::GetEncryptionObserverForTest() was added to support the surprising amount of tests abusing the fact that those methods were technically public before. - The HasUnrecoverableError() check has been removed from OnPassphraseRequired() because it doesn't seem necessary. This change should hopefully have no functional changes. Potential followup CLs: - Make SyncServiceCrypto an interface that SyncService exposes so the encryption related methods can be removed from SyncService. - Provide SyncServiceCrypto a proxy object that talks directly to SyncEncryptionHandler instead of routing through the SyncEngine interface. - Have SyncServiceCrypto implement DataTypeEncryptionHandler. BUG=685337 TBR=pkasting Review-Url: https://codereview.chromium.org/2663783002 Cr-Commit-Position: refs/heads/master@{#447470} Committed: https://chromium.googlesource.com/chromium/src/+/f635e7f7a4d7e1f62bab36d230183e499627b9f7

Patch Set 1 #

Patch Set 2 : Self-review. #

Total comments: 8

Patch Set 3 : Tweak comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+807 lines, -738 lines) Patch
M chrome/browser/autocomplete/search_provider_unittest.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M components/browser_sync/profile_sync_service.h View 1 16 chunks +9 lines, -81 lines 0 comments Download
M components/browser_sync/profile_sync_service.cc View 1 28 chunks +41 lines, -255 lines 0 comments Download
M components/browser_sync/profile_sync_service_unittest.cc View 5 chunks +9 lines, -5 lines 0 comments Download
M components/sync/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M components/sync/driver/data_type_manager.h View 1 chunk +3 lines, -0 lines 0 comments Download
M components/sync/driver/data_type_manager_impl.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/sync/driver/data_type_manager_impl.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M components/sync/driver/data_type_manager_mock.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host_core.h View 3 chunks +1 line, -17 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host_core.cc View 1 3 chunks +8 lines, -60 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host_impl.h View 5 chunks +1 line, -71 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host_impl.cc View 4 chunks +1 line, -128 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host_impl_unittest.cc View 1 2 chunks +20 lines, -0 lines 0 comments Download
M components/sync/driver/sync_service.h View 1 chunk +18 lines, -0 lines 0 comments Download
M components/sync/driver/sync_service_base.h View 1 5 chunks +26 lines, -4 lines 0 comments Download
M components/sync/driver/sync_service_base.cc View 1 4 chunks +35 lines, -2 lines 0 comments Download
A components/sync/driver/sync_service_crypto.h View 1 2 1 chunk +180 lines, -0 lines 0 comments Download
A components/sync/driver/sync_service_crypto.cc View 1 1 chunk +434 lines, -0 lines 0 comments Download
M components/sync/engine/fake_sync_engine.h View 2 chunks +1 line, -7 lines 0 comments Download
M components/sync/engine/fake_sync_engine.cc View 2 chunks +1 line, -15 lines 0 comments Download
M components/sync/engine/sync_encryption_handler.h View 2 chunks +1 line, -3 lines 0 comments Download
M components/sync/engine/sync_engine.h View 3 chunks +6 lines, -19 lines 0 comments Download
M components/sync/engine/sync_engine_host.h View 3 chunks +0 lines, -46 lines 0 comments Download
M components/sync/engine/sync_engine_host_stub.h View 1 chunk +0 lines, -9 lines 0 comments Download
M components/sync/engine/sync_engine_host_stub.cc View 1 chunk +0 lines, -14 lines 0 comments Download

Messages

Total messages: 34 (24 generated)
maxbogue
Pavel and Sky, if you could both take a look I'd appreciate it! Sorry it's ...
3 years, 10 months ago (2017-01-30 19:46:35 UTC) #10
skym
lgtm https://codereview.chromium.org/2663783002/diff/20001/components/browser_sync/profile_sync_service.h File components/browser_sync/profile_sync_service.h (left): https://codereview.chromium.org/2663783002/diff/20001/components/browser_sync/profile_sync_service.h#oldcode506 components/browser_sync/profile_sync_service.h:506: // Note about setting passphrases: There are different ...
3 years, 10 months ago (2017-01-31 01:58:54 UTC) #13
maxbogue
https://codereview.chromium.org/2663783002/diff/20001/components/browser_sync/profile_sync_service.h File components/browser_sync/profile_sync_service.h (left): https://codereview.chromium.org/2663783002/diff/20001/components/browser_sync/profile_sync_service.h#oldcode506 components/browser_sync/profile_sync_service.h:506: // Note about setting passphrases: There are different scenarios ...
3 years, 10 months ago (2017-01-31 07:51:11 UTC) #16
pavely
lgtm
3 years, 10 months ago (2017-02-01 01:42:04 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2663783002/40001
3 years, 10 months ago (2017-02-01 01:51:48 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/354446)
3 years, 10 months ago (2017-02-01 02:00:56 UTC) #24
maxbogue
TBR pkasting for chrome/browser/autocomplete/
3 years, 10 months ago (2017-02-01 07:39:25 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2663783002/40001
3 years, 10 months ago (2017-02-01 07:39:42 UTC) #29
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/f635e7f7a4d7e1f62bab36d230183e499627b9f7
3 years, 10 months ago (2017-02-01 07:48:11 UTC) #33
Peter Kasting
3 years, 10 months ago (2017-02-01 09:12:23 UTC) #34
Message was sent while issue was closed.
LGTM

Powered by Google App Engine
This is Rietveld 408576698