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

Issue 2629343002: Password reuse look-up optimization (Closed)

Created:
3 years, 11 months ago by dvadym
Modified:
3 years, 11 months ago
Reviewers:
vasilii
CC:
chromium-reviews, gcasto+watchlist_chromium.org, vabr+watchlistpasswordmanager_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Password reuse look-up optimization. In the current implementation of the password reuse detection: 1.Passwords are stored in map<password, set<domains>> passwords_ 2.String |input| contains keystrokes from earliest till latest, and it needed to check any suffix of |input| for occurrence in |passwords_|.That requre m*n*log(n) operations, where m = len(input), n = len(passwords_). This optimization: 1.Paswords stored are in the same structure but, keys are ordered(i.e. passwords) are ordered lexicographical as reversed strings. 2.So now it's needed to find a key in |passwords_| which is a suffix of |input|. If a key in |passwords_| that is suffix of |input| exists then the longest such key is the largest key in reverse lexicographical order that not bigger that |input|. Usual map<> find method is used for finding such key. BUG=657041, 668155 Review-Url: https://codereview.chromium.org/2629343002 Cr-Commit-Position: refs/heads/master@{#443911} Committed: https://chromium.googlesource.com/chromium/src/+/ceaa547b121efaac5504b656826247b7b93259de

Patch Set 1 #

Patch Set 2 : Added tests #

Total comments: 12

Patch Set 3 : Rebase #

Patch Set 4 : Addressed reviewer comments #

Patch Set 5 : Comments updated #

Patch Set 6 : Comments #

Patch Set 7 : Small fix #

Total comments: 8

Patch Set 8 : Addressed comments and compilation fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+145 lines, -39 lines) Patch
M components/password_manager/core/browser/password_reuse_detector.h View 1 2 3 4 5 6 7 2 chunks +15 lines, -1 line 0 comments Download
M components/password_manager/core/browser/password_reuse_detector.cc View 1 2 3 4 5 6 7 3 chunks +60 lines, -20 lines 0 comments Download
M components/password_manager/core/browser/password_reuse_detector_unittest.cc View 1 2 3 7 chunks +70 lines, -18 lines 0 comments Download

Messages

Total messages: 22 (15 generated)
dvadym
Hi Vasilii, could you please review this CL? Regards, Vadym
3 years, 11 months ago (2017-01-13 11:18:07 UTC) #8
vasilii
I agree with that sort of optimization. But I disagree with the practice of reversing ...
3 years, 11 months ago (2017-01-13 15:32:57 UTC) #9
dvadym
Thanks Vasilii for comments! That's very good point that using reversed strings as arguments for ...
3 years, 11 months ago (2017-01-16 14:18:03 UTC) #10
vasilii
lgtm https://codereview.chromium.org/2629343002/diff/120001/components/password_manager/core/browser/password_reuse_detector.cc File components/password_manager/core/browser/password_reuse_detector.cc (right): https://codereview.chromium.org/2629343002/diff/120001/components/password_manager/core/browser/password_reuse_detector.cc#newcode21 components/password_manager/core/browser/password_reuse_detector.cc:21: // Returns true iff |prefix_candidate| is a prefix ...
3 years, 11 months ago (2017-01-16 15:48:59 UTC) #11
dvadym
Thanks Vasilii for review! https://codereview.chromium.org/2629343002/diff/120001/components/password_manager/core/browser/password_reuse_detector.cc File components/password_manager/core/browser/password_reuse_detector.cc (right): https://codereview.chromium.org/2629343002/diff/120001/components/password_manager/core/browser/password_reuse_detector.cc#newcode21 components/password_manager/core/browser/password_reuse_detector.cc:21: // Returns true iff |prefix_candidate| ...
3 years, 11 months ago (2017-01-16 16:18:49 UTC) #14
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/2629343002/140001
3 years, 11 months ago (2017-01-16 16:59:53 UTC) #19
commit-bot: I haz the power
3 years, 11 months ago (2017-01-16 17:04:38 UTC) #22
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://chromium.googlesource.com/chromium/src/+/ceaa547b121efaac5504b6568262...

Powered by Google App Engine
This is Rietveld 408576698