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

Issue 906973007: PasswordStore: Clean up expectations about rewriting vectors of forms (Closed)

Created:
5 years, 10 months ago by vabr (Chromium)
Modified:
5 years, 9 months ago
Reviewers:
engedy
CC:
chromium-reviews, gcasto+watchlist_chromium.org, mkwst+watchlist-passwords_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

PasswordStore: Clean up expectations about rewriting vectors of forms Many methods in PasswordStore and its backends have a ScopedVector of password forms as an out-argument, into which they put retrieved credentials. Ideally, those methods would return that vector instead, but that is often not possible, because they already return a bool flag of success. Keeping the out-argument has one bad consequence: it is not clear, if the retrieved credentials are appended to the vector, or if they replace the contents of the vector. It looks like those methods are fed empty vectors anyway, so it is natural to make that explicit. This CL adds comments stating that the vectors are erased before anything new is added to them, and also modifies the code to make sure that they are indeed erased, even in failure cases. The CL also contains some related clean-ups, like moving static methods to anonymous namespace etc. BUG=324291 Committed: https://crrev.com/c5c4d77323e8bff2028f9e43f52f0be4c3a93a77 Cr-Commit-Position: refs/heads/master@{#320721}

Patch Set 1 : #

Total comments: 1

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 59

Patch Set 5 : Just rebased + one whitespace fix #

Patch Set 6 : Comments addressed #

Patch Set 7 : Fix Mac and one #include #

Patch Set 8 : Mac fix No. 2 #

Patch Set 9 : More Mac fixes + ReadFromPasswordStore #

Patch Set 10 : Fix FillMatchingLogins + a typo #

Total comments: 12

Patch Set 11 : Just rebased #

Patch Set 12 : Comments addressed, except for dropping clear() (yet) #

Total comments: 7

Patch Set 13 : Remove clear() #

Total comments: 2

Patch Set 14 : Fix Linux compile #

Total comments: 19

Patch Set 15 : More comments addressed #

Total comments: 2

Patch Set 16 : Just rebased #

Patch Set 17 : Fix error in Get*LoginsImpl #

Patch Set 18 : Commented on clearing |forms_| #

Patch Set 19 : Just rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+537 lines, -584 lines) Patch
M chrome/browser/password_manager/native_backend_gnome_x.h View 1 2 3 4 5 6 3 chunks +10 lines, -7 lines 0 comments Download
M chrome/browser/password_manager/native_backend_gnome_x.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 15 chunks +46 lines, -55 lines 0 comments Download
M chrome/browser/password_manager/native_backend_gnome_x_unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -32 lines 0 comments Download
M chrome/browser/password_manager/native_backend_kwallet_x.h View 1 2 3 4 5 5 chunks +18 lines, -31 lines 0 comments Download
M chrome/browser/password_manager/native_backend_kwallet_x.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 13 chunks +198 lines, -174 lines 0 comments Download
M chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc View 1 2 8 chunks +14 lines, -56 lines 0 comments Download
M chrome/browser/password_manager/native_backend_libsecret.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +17 lines, -18 lines 0 comments Download
M chrome/browser/password_manager/native_backend_libsecret.cc View 1 2 3 4 5 6 7 8 9 10 11 12 10 chunks +26 lines, -29 lines 0 comments Download
M chrome/browser/password_manager/native_backend_libsecret_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +10 lines, -27 lines 0 comments Download
M chrome/browser/password_manager/password_store_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +19 lines, -15 lines 0 comments Download
M chrome/browser/password_manager/password_store_mac_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +5 lines, -10 lines 0 comments Download
M chrome/browser/password_manager/password_store_x.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +8 lines, -4 lines 0 comments Download
M chrome/browser/password_manager/password_store_x.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +10 lines, -6 lines 0 comments Download
M chrome/browser/password_manager/password_store_x_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +21 lines, -2 lines 0 comments Download
M components/password_manager/core/browser/login_database.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +36 lines, -24 lines 0 comments Download
M components/password_manager/core/browser/login_database.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +61 lines, -74 lines 0 comments Download
M components/password_manager/core/browser/login_database_mac.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M components/password_manager/core/browser/login_database_posix.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M components/password_manager/core/browser/login_database_win.cc View 1 chunk +4 lines, -2 lines 0 comments Download
M components/password_manager/core/browser/password_store_default.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +10 lines, -8 lines 0 comments Download
M components/password_manager/core/browser/password_store_sync.h View 1 2 3 4 5 2 chunks +8 lines, -5 lines 0 comments Download
M components/password_manager/core/browser/password_syncable_service.cc View 1 2 3 4 5 6 7 8 9 2 chunks +8 lines, -1 line 0 comments Download

Messages

Total messages: 23 (4 generated)
vabr (Chromium)
Hi Balázs, When you have time, please have a look. Thanks! Vaclav
5 years, 10 months ago (2015-02-11 16:39:33 UTC) #3
vabr (Chromium)
Balázs, To spare your time -- no need to look at this CL yet. I'll ...
5 years, 10 months ago (2015-02-11 17:19:14 UTC) #4
engedy
Let me know as soon as I can take a look at this. Seems like ...
5 years, 10 months ago (2015-02-12 16:37:43 UTC) #5
vabr (Chromium)
On 2015/02/12 16:37:43, engedy wrote: > Let me know as soon as I can take ...
5 years, 10 months ago (2015-02-12 18:56:18 UTC) #6
vabr (Chromium)
Hi Balázs, Patch set 4 should be OK to have a look at, PTAL. No ...
5 years, 10 months ago (2015-02-24 18:06:21 UTC) #7
engedy
As discussed offline, clearing the ScopedVector output parameter in error cases seems like quite a ...
5 years, 10 months ago (2015-02-25 15:17:49 UTC) #8
engedy
Also, we will need to update PasswordSyncableService::ReadFromPasswordStore(), which seems to rely on append behavior for ...
5 years, 10 months ago (2015-02-25 15:18:49 UTC) #9
vabr (Chromium)
Hi Balázs, I addressed your comments, including > PS: If we do make this change, ...
5 years, 9 months ago (2015-03-09 10:56:19 UTC) #10
engedy
LGTM % some nits. Quite frankly, I am not at all sure if the benefits ...
5 years, 9 months ago (2015-03-09 13:33:18 UTC) #11
engedy
In any case, thanks a lot for the cleanup!
5 years, 9 months ago (2015-03-09 13:33:43 UTC) #12
vabr (Chromium)
Hi Balázs, I addressed your comments. In particular, you convinced me that calling clear() too ...
5 years, 9 months ago (2015-03-09 17:44:15 UTC) #13
engedy
LGTM % comments. Please be aware that WARN_UNUSED_RESULT seems to be not working in clang ...
5 years, 9 months ago (2015-03-11 19:25:35 UTC) #14
vabr (Chromium)
Thanks, Balázs, For your very careful review, and for verifying WARN_UNUSED_RESULT for clang! :) I ...
5 years, 9 months ago (2015-03-12 15:30:52 UTC) #15
engedy
LGTM, with one nit. Thanks a lot for taking the time to do this, I ...
5 years, 9 months ago (2015-03-16 10:35:36 UTC) #16
engedy
Feel free to just land it once the comment is addressed.
5 years, 9 months ago (2015-03-16 10:36:18 UTC) #17
vabr (Chromium)
Thanks for your patient review! Comment addressed, sending to the CQ. Cheers, Vaclav https://codereview.chromium.org/906973007/diff/300001/chrome/browser/password_manager/native_backend_gnome_x.cc File ...
5 years, 9 months ago (2015-03-16 10:58:47 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/906973007/380001
5 years, 9 months ago (2015-03-16 13:10:33 UTC) #21
commit-bot: I haz the power
Committed patchset #19 (id:380001)
5 years, 9 months ago (2015-03-16 13:15:14 UTC) #22
commit-bot: I haz the power
5 years, 9 months ago (2015-03-16 13:15:52 UTC) #23
Message was sent while issue was closed.
Patchset 19 (id:??) landed as
https://crrev.com/c5c4d77323e8bff2028f9e43f52f0be4c3a93a77
Cr-Commit-Position: refs/heads/master@{#320721}

Powered by Google App Engine
This is Rietveld 408576698