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

Issue 6902101: Refactor sync passphrase setup flow and fix passphrase tests (Closed)

Created:
9 years, 8 months ago by Raghu Simha
Modified:
9 years, 7 months ago
CC:
chromium-reviews, ncarter (slow), Paweł Hajdan Jr., idana
Visibility:
Public.

Description

Refactor sync passphrase setup flow and fix passphrase tests The passphrase sync integration tests are in a state of disrepair due to several recent changes to the sync implementation. In particular, passphrase sync uses two similar methods called OnPassphraseRequired and OnPassphraseFailed to differentiate between cases where a passphrase is required for a first attempt at decryption and cases where decryption with a cached passphrase failed and the user needs to be prompted. This patch refactors the "for_decryption" boolean flag into an enum called PassphraseRequiredReason, thereby eliminating the need for OnPassphraseFailed. It also fixes the tests and updates the test framework to account for scenarios in which a client is waiting for a passphrase that has been set by one of its partners, and enables it to exit early when forward progress is impossible without a call to SetPassphrase. BUG=78840, 80180, 81018 TEST=sync_integration_tests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=83764

Patch Set 1 : "" #

Patch Set 2 : Fix unit test. #

Total comments: 4

Patch Set 3 : Replacing boolean state variables with a single enum. #

Patch Set 4 : Remove OnPassphraseFailed; Plumb enum all the way through; Shave yak. #

Total comments: 8

Patch Set 5 : CR feedback; self review. #

Patch Set 6 : Working version. #

Patch Set 7 : NO_REASON --> REASON_PASSPHRASE_NOT_REQUIRED #

Patch Set 8 : Rebase. #

Total comments: 14

Patch Set 9 : More CR Feedback. #

Patch Set 10 : de Morgan's law simplification. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+241 lines, -165 lines) Patch
M chrome/browser/resources/sync_internals/chrome_sync.js View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/resources/sync_internals/sync_log.js View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/engine/syncapi.h View 1 2 3 4 5 6 7 8 2 chunks +26 lines, -12 lines 0 comments Download
M chrome/browser/sync/engine/syncapi.cc View 1 2 3 4 5 6 7 4 chunks +22 lines, -4 lines 0 comments Download
M chrome/browser/sync/engine/syncapi_unittest.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.h View 1 2 3 4 chunks +11 lines, -18 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host.cc View 1 2 3 4 5 6 7 2 chunks +10 lines, -20 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host_unittest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/js_sync_manager_observer.h View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/sync/js_sync_manager_observer.cc View 1 2 3 1 chunk +5 lines, -6 lines 0 comments Download
M chrome/browser/sync/js_sync_manager_observer_unittest.cc View 1 2 3 4 5 6 3 chunks +32 lines, -13 lines 4 comments Download
M chrome/browser/sync/profile_sync_service.h View 1 2 3 4 5 6 7 8 3 chunks +10 lines, -11 lines 0 comments Download
M chrome/browser/sync/profile_sync_service.cc View 1 2 3 4 5 6 7 8 9 12 chunks +36 lines, -26 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_harness.h View 1 2 3 4 5 6 7 8 2 chunks +9 lines, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service_harness.cc View 1 2 3 4 5 6 7 8 8 chunks +46 lines, -20 lines 0 comments Download
M chrome/browser/sync/sync_setup_wizard_unittest.cc View 1 2 3 4 5 6 7 8 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/sync/sync_ui_util.cc View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -5 lines 0 comments Download
M chrome/browser/sync/test_profile_sync_service.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/live_sync/live_passwords_sync_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/live_sync/single_client_live_passwords_sync_test.cc View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/test/live_sync/two_client_live_passwords_sync_test.cc View 7 chunks +11 lines, -13 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
Raghu Simha
Lingesh, please review.
9 years, 8 months ago (2011-04-28 02:43:16 UTC) #1
Raghu Simha
+tim.
9 years, 7 months ago (2011-04-28 17:11:41 UTC) #2
tim (not reviewing)
http://codereview.chromium.org/6902101/diff/22/chrome/browser/sync/glue/sync_backend_host.h File chrome/browser/sync/glue/sync_backend_host.h (right): http://codereview.chromium.org/6902101/diff/22/chrome/browser/sync/glue/sync_backend_host.h#newcode97 chrome/browser/sync/glue/sync_backend_host.h:97: virtual void OnPassphraseFailed() = 0; This is what OnPassphraseRequired ...
9 years, 7 months ago (2011-04-28 17:13:53 UTC) #3
tim (not reviewing)
http://codereview.chromium.org/6902101/diff/22/chrome/browser/sync/profile_sync_service.cc File chrome/browser/sync/profile_sync_service.cc (right): http://codereview.chromium.org/6902101/diff/22/chrome/browser/sync/profile_sync_service.cc#newcode655 chrome/browser/sync/profile_sync_service.cc:655: OnPassphraseRequired(true); This seems like a step in the wrong ...
9 years, 7 months ago (2011-04-28 17:18:00 UTC) #4
Raghu Simha
A couple of wordy comments :) http://codereview.chromium.org/6902101/diff/22/chrome/browser/sync/glue/sync_backend_host.h File chrome/browser/sync/glue/sync_backend_host.h (right): http://codereview.chromium.org/6902101/diff/22/chrome/browser/sync/glue/sync_backend_host.h#newcode97 chrome/browser/sync/glue/sync_backend_host.h:97: virtual void OnPassphraseFailed() ...
9 years, 7 months ago (2011-04-28 17:44:21 UTC) #5
Raghu Simha
On 2011/04/28 17:13:53, timsteele wrote: > http://codereview.chromium.org/6902101/diff/22/chrome/browser/sync/glue/sync_backend_host.h > File chrome/browser/sync/glue/sync_backend_host.h (right): > > http://codereview.chromium.org/6902101/diff/22/chrome/browser/sync/glue/sync_backend_host.h#newcode97 > ...
9 years, 7 months ago (2011-04-28 17:57:32 UTC) #6
tim (not reviewing)
On 2011/04/28 17:57:32, rsimha wrote: > On 2011/04/28 17:13:53, timsteele wrote: > > > http://codereview.chromium.org/6902101/diff/22/chrome/browser/sync/glue/sync_backend_host.h ...
9 years, 7 months ago (2011-04-28 19:20:29 UTC) #7
Raghu Simha
On 2011/04/28 19:20:29, timsteele wrote: > Without fully groking, if there's a third state, then ...
9 years, 7 months ago (2011-04-28 19:28:30 UTC) #8
Raghu Simha
On 2011/04/28 19:20:29, timsteele wrote: > Without fully groking, if there's a third state, then ...
9 years, 7 months ago (2011-04-28 22:44:37 UTC) #9
tim (not reviewing)
http://codereview.chromium.org/6902101/diff/6015/chrome/browser/sync/engine/syncapi.h File chrome/browser/sync/engine/syncapi.h (right): http://codereview.chromium.org/6902101/diff/6015/chrome/browser/sync/engine/syncapi.h#newcode113 chrome/browser/sync/engine/syncapi.h:113: ENCRYPTION = 1, // The cryptographer requires a passphrase ...
9 years, 7 months ago (2011-04-29 01:21:48 UTC) #10
Raghu Simha
+zea as reviewer. Patch still in progress. http://codereview.chromium.org/6902101/diff/6015/chrome/browser/sync/engine/syncapi.h File chrome/browser/sync/engine/syncapi.h (right): http://codereview.chromium.org/6902101/diff/6015/chrome/browser/sync/engine/syncapi.h#newcode113 chrome/browser/sync/engine/syncapi.h:113: ENCRYPTION = ...
9 years, 7 months ago (2011-04-29 18:59:14 UTC) #11
Raghu Simha
This is now ready for a proper review. zea: Removal of OnPassphraseFailed. akalin: js changes. ...
9 years, 7 months ago (2011-04-29 20:38:23 UTC) #12
Nicolas Zea
http://codereview.chromium.org/6902101/diff/4060/chrome/browser/sync/engine/syncapi.h File chrome/browser/sync/engine/syncapi.h (right): http://codereview.chromium.org/6902101/diff/4060/chrome/browser/sync/engine/syncapi.h#newcode115 chrome/browser/sync/engine/syncapi.h:115: // encryption. Mention that this is the migration/upgrade case, ...
9 years, 7 months ago (2011-04-29 22:59:29 UTC) #13
tim (not reviewing)
I like this new enum. http://codereview.chromium.org/6902101/diff/4060/chrome/browser/sync/profile_sync_service.cc File chrome/browser/sync/profile_sync_service.cc (right): http://codereview.chromium.org/6902101/diff/4060/chrome/browser/sync/profile_sync_service.cc#newcode606 chrome/browser/sync/profile_sync_service.cc:606: observed_passphrase_required_ = true; can ...
9 years, 7 months ago (2011-04-29 23:02:12 UTC) #14
Raghu Simha
This might be the one :) http://codereview.chromium.org/6902101/diff/4060/chrome/browser/sync/engine/syncapi.h File chrome/browser/sync/engine/syncapi.h (right): http://codereview.chromium.org/6902101/diff/4060/chrome/browser/sync/engine/syncapi.h#newcode115 chrome/browser/sync/engine/syncapi.h:115: // encryption. On ...
9 years, 7 months ago (2011-04-30 00:43:05 UTC) #15
Nicolas Zea
LGTM
9 years, 7 months ago (2011-05-02 17:39:03 UTC) #16
akalin
On 2011/05/02 17:39:03, nzea wrote: > LGTM js changes LGTM
9 years, 7 months ago (2011-05-02 18:02:47 UTC) #17
akalin
http://codereview.chromium.org/6902101/diff/7025/chrome/browser/sync/js_sync_manager_observer_unittest.cc File chrome/browser/sync/js_sync_manager_observer_unittest.cc (right): http://codereview.chromium.org/6902101/diff/7025/chrome/browser/sync/js_sync_manager_observer_unittest.cc#newcode133 chrome/browser/sync/js_sync_manager_observer_unittest.cc:133: NULL)); indentation (NULL should line up with "OnPassphraseRequired"). http://codereview.chromium.org/6902101/diff/7025/chrome/browser/sync/js_sync_manager_observer_unittest.cc#newcode143 ...
9 years, 7 months ago (2011-05-02 18:02:53 UTC) #18
Raghu Simha
http://codereview.chromium.org/6902101/diff/7025/chrome/browser/sync/js_sync_manager_observer_unittest.cc File chrome/browser/sync/js_sync_manager_observer_unittest.cc (right): http://codereview.chromium.org/6902101/diff/7025/chrome/browser/sync/js_sync_manager_observer_unittest.cc#newcode133 chrome/browser/sync/js_sync_manager_observer_unittest.cc:133: NULL)); On 2011/05/02 18:02:53, akalin wrote: > indentation (NULL ...
9 years, 7 months ago (2011-05-02 18:20:05 UTC) #19
tim (not reviewing)
We should add a method (could be a static function taking a passphrase required reason, ...
9 years, 7 months ago (2011-05-02 19:37:36 UTC) #20
Raghu Simha
9 years, 7 months ago (2011-05-03 03:29:18 UTC) #21
On 2011/05/02 19:37:36, timsteele wrote:
> We should add a method (could be a static function taking a passphrase
required
> reason, or just a member of PSS) that returns true if the reason is DECRYPTION
> or SET_PASSPHRASE_FAILED.  It can be a separate patch, if you promise to do it
> :)

This is now out for review at http://codereview.chromium.org/6910012.

Powered by Google App Engine
This is Rietveld 408576698