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

Issue 10844005: [Sync] Refactor GetEncryptedTypes usage. (Closed)

Created:
8 years, 4 months ago by Nicolas Zea
Modified:
8 years, 4 months ago
CC:
chromium-reviews, Raghu Simha, ncarter (slow), akalin, tim (not reviewing)
Visibility:
Public.

Description

[Sync] Refactor GetEncryptedTypes usage. The cryptographer is now owned by the SyncEncryptionHandlerImpl, and no longer needs any connection to the nigori handler or encrypted types. Those are accessed via the directory, which now has a GetNigoriHandler method. Because of this, we can now clean up the thread safety guarantees in the sync encryption handler impl, enforcing that everything except GetEncryptedTypes (and IsUsingExplicitPassphrase, which will be fixed in a followup patch) are invoked on the syncer thread. This lets us not have to open unnecessary transactions. At the chrome layer, encrypted types are accessed via BaseTransaction:: GetEncryptedTypes(). At the syncer layer, they're accessed via directory:: GetNigoriHandler()->GetEncryptedTypes(BaseTransaction* trans const). BUG=142476, 139848 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=153335

Patch Set 1 #

Patch Set 2 : Self review #

Patch Set 3 : Add thread safety helper and read encrypted types from local state #

Patch Set 4 : Always trigger OnEncryptedTypesChanged on init #

Total comments: 4

Patch Set 5 : Implement vault #

Patch Set 6 : Rebase + add dcheck #

Unified diffs Side-by-side diffs Delta from patch set Stats (+568 lines, -416 lines) Patch
M chrome/browser/sync/DEPS View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/sync/glue/bookmark_change_processor.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/bookmark_model_associator.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/sync/glue/generic_change_processor.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/session_model_associator.cc View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/sync/glue/theme_model_associator.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/sync/glue/typed_url_change_processor.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/typed_url_model_associator.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_bookmark_unittest.cc View 3 chunks +0 lines, -9 lines 0 comments Download
M sync/engine/apply_updates_command_unittest.cc View 14 chunks +32 lines, -27 lines 0 comments Download
M sync/engine/conflict_resolver.cc View 1 2 chunks +4 lines, -1 line 0 comments Download
M sync/engine/download_updates_command.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M sync/engine/get_commit_ids_command.cc View 1 2 chunks +3 lines, -1 line 0 comments Download
M sync/engine/syncer_unittest.cc View 1 2 3 4 5 8 chunks +10 lines, -12 lines 0 comments Download
M sync/engine/syncer_util.cc View 1 3 chunks +3 lines, -2 lines 0 comments Download
M sync/internal_api/base_transaction.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M sync/internal_api/public/base_transaction.h View 3 chunks +2 lines, -2 lines 0 comments Download
M sync/internal_api/public/test/test_user_share.h View 2 chunks +6 lines, -0 lines 0 comments Download
M sync/internal_api/sync_encryption_handler_impl.h View 1 2 3 4 8 chunks +52 lines, -17 lines 0 comments Download
M sync/internal_api/sync_encryption_handler_impl.cc View 1 2 3 4 5 17 chunks +165 lines, -92 lines 0 comments Download
M sync/internal_api/sync_encryption_handler_impl_unittest.cc View 1 2 3 4 17 chunks +85 lines, -49 lines 0 comments Download
M sync/internal_api/sync_manager_impl.cc View 1 2 3 4 5 3 chunks +13 lines, -13 lines 0 comments Download
M sync/internal_api/sync_manager_impl_unittest.cc View 1 2 3 4 5 17 chunks +26 lines, -34 lines 0 comments Download
M sync/internal_api/test/test_user_share.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M sync/internal_api/write_node.cc View 1 3 chunks +4 lines, -4 lines 0 comments Download
M sync/syncable/directory.h View 1 5 chunks +17 lines, -12 lines 0 comments Download
M sync/syncable/directory.cc View 1 2 3 4 5 2 chunks +11 lines, -5 lines 0 comments Download
M sync/syncable/nigori_handler.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M sync/syncable/nigori_util.h View 3 chunks +2 lines, -4 lines 0 comments Download
M sync/syncable/nigori_util.cc View 1 2 5 chunks +13 lines, -11 lines 0 comments Download
M sync/syncable/syncable_mock.h View 2 chunks +0 lines, -2 lines 0 comments Download
M sync/syncable/syncable_mock.cc View 1 chunk +5 lines, -2 lines 0 comments Download
M sync/syncable/syncable_unittest.cc View 1 2 3 4 5 13 chunks +63 lines, -24 lines 0 comments Download
M sync/test/engine/test_directory_setter_upper.h View 3 chunks +4 lines, -2 lines 0 comments Download
M sync/test/engine/test_directory_setter_upper.cc View 1 chunk +6 lines, -2 lines 0 comments Download
M sync/test/fake_sync_encryption_handler.h View 4 chunks +8 lines, -8 lines 0 comments Download
M sync/test/fake_sync_encryption_handler.cc View 5 chunks +13 lines, -16 lines 0 comments Download
M sync/util/cryptographer.h View 4 chunks +0 lines, -23 lines 0 comments Download
M sync/util/cryptographer.cc View 3 chunks +2 lines, -23 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Nicolas Zea
PTAL. Most of this is just call site changes and test related stuff.
8 years, 4 months ago (2012-08-21 01:13:18 UTC) #1
tim (not reviewing)
https://chromiumcodereview.appspot.com/10844005/diff/12001/sync/internal_api/sync_encryption_handler_impl.cc File sync/internal_api/sync_encryption_handler_impl.cc (right): https://chromiumcodereview.appspot.com/10844005/diff/12001/sync/internal_api/sync_encryption_handler_impl.cc#newcode424 sync/internal_api/sync_encryption_handler_impl.cc:424: OnCryptographerStateChanged( Should we bubble the trans up through this ...
8 years, 4 months ago (2012-08-23 18:38:09 UTC) #2
Nicolas Zea
PTAL http://codereview.chromium.org/10844005/diff/12001/sync/internal_api/sync_encryption_handler_impl.cc File sync/internal_api/sync_encryption_handler_impl.cc (right): http://codereview.chromium.org/10844005/diff/12001/sync/internal_api/sync_encryption_handler_impl.cc#newcode424 sync/internal_api/sync_encryption_handler_impl.cc:424: OnCryptographerStateChanged( On 2012/08/23 18:38:10, timsteele wrote: > Should ...
8 years, 4 months ago (2012-08-23 22:49:32 UTC) #3
tim (not reviewing)
Make sure you add the DCHECK to UnlockVaultMutable as well (and get a green test ...
8 years, 4 months ago (2012-08-24 19:07:03 UTC) #4
Nicolas Zea
Done! Committing.
8 years, 4 months ago (2012-08-24 20:27:38 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/zea@chromium.org/10844005/13040
8 years, 4 months ago (2012-08-24 20:27:58 UTC) #6
commit-bot: I haz the power
8 years, 4 months ago (2012-08-24 22:54:21 UTC) #7
Change committed as 153335

Powered by Google App Engine
This is Rietveld 408576698