New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 621355 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
hobby only
Closed: Nov 19
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Task

Blocked on:
issue 413020
issue 739366

Blocking:
issue 717537
issue 639786



Sign in to add a comment

Separate PasswordStore handling from PasswordFormManager

Project Member Reported by vabr@chromium.org, Jun 19 2016

Issue description

Goals:
* Avoid duplicate queries to the PasswordStore done by PasswordFormManager (PFM) instances of a single PasswordManager
* Make writing unit tests related to PFM easier

Detailed design in https://docs.google.com/document/d/12CH_SV1gIJKaEIGTs7gWBiXrCMlBa3o32OyC2LRtPAo/edit
 

Comment 1 by vabr@chromium.org, Jun 20 2016

TODO for the improved tests: make sure that PasswordForm::times_used count is properly updated during saving (and the list of other possible usernames is cleared).

This is not tested currently, and was brought up during refactoring in https://codereview.chromium.org/2086483002/#msg4. It will be easier to do once PFM is a smaller class and one can mock FormSaver instead of the whole PasswordStore.
Project Member

Comment 2 by bugdroid1@chromium.org, Jun 20 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/848ab72cddf925c8554b0fd7713fa2c919807e2f

commit 848ab72cddf925c8554b0fd7713fa2c919807e2f
Author: vabr <vabr@chromium.org>
Date: Mon Jun 20 15:37:53 2016

Fix the signature of PasswordFormManager::UpdateMetadataForUsage

The method took a const reference for a PasswordForm, but never used it.
Instead it hard-coded using pending_credentials_, which was passed as the
argument all the times anyway. This CL changes the function to use its
argument, changes the argument from a const ref to a non-const pointer to allow
modification, and moves the function to the anonymous namespace, because it
does not need any state of PasswordFormManager.

R=kolos@chromium.org

BUG= 621355 

Review-Url: https://codereview.chromium.org/2086483002
Cr-Commit-Position: refs/heads/master@{#400683}

[modify] https://crrev.com/848ab72cddf925c8554b0fd7713fa2c919807e2f/components/password_manager/core/browser/password_form_manager.cc
[modify] https://crrev.com/848ab72cddf925c8554b0fd7713fa2c919807e2f/components/password_manager/core/browser/password_form_manager.h

Comment 3 by vabr@chromium.org, Jun 21 2016

Another TODO: Finally get rid of ssl_valid ( issue 413020 ), at least in PFM.
Project Member

Comment 4 by bugdroid1@chromium.org, Jun 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0637ae71c31807c3882293be5f23453dd2e80342

commit 0637ae71c31807c3882293be5f23453dd2e80342
Author: vabr <vabr@chromium.org>
Date: Thu Jun 23 17:43:32 2016

Introduce password_manager::FormSaver

The goal: outsource modifying calls to PasswordStore made in PasswordFormManager to a separate class.

This CL achieves that by:
 * Creating a FormSaver interface to provide the store-modifications needed by PFM. PFM is changed to require a FormSaver object on creation.
 * Separating the store-modifying code from PFM into FormSaverImpl, implementing FormSaver.
 * Adding tests for FormSaverImpl, reducing PFM tests accordingly, providing test support for stubbing FormSaver and using it in existing tests.

TODO for a future CL:
 * Moving WipeStoreCopyIfOutdated to FormSaver.

For more details see the design doc at
https://docs.google.com/document/d/12CH_SV1gIJKaEIGTs7gWBiXrCMlBa3o32OyC2LRtPAo/edit?usp=sharing

BUG= 621355 
R=dvadym@chromium.org

Review-Url: https://codereview.chromium.org/2090583003
Cr-Commit-Position: refs/heads/master@{#401647}

[modify] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/chrome/browser/password_manager/save_password_infobar_delegate_android_unittest.cc
[modify] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc
[modify] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/chrome/browser/ui/passwords/manage_passwords_test.cc
[modify] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc
[modify] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/components/components_tests.gyp
[modify] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/components/password_manager.gypi
[modify] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/components/password_manager/core/browser/BUILD.gn
[modify] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/components/password_manager/core/browser/credential_manager_password_form_manager.cc
[add] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/components/password_manager/core/browser/form_saver.h
[add] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/components/password_manager/core/browser/form_saver_impl.cc
[add] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/components/password_manager/core/browser/form_saver_impl.h
[add] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/components/password_manager/core/browser/form_saver_impl_unittest.cc
[modify] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/components/password_manager/core/browser/password_form_manager.cc
[modify] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/components/password_manager/core/browser/password_form_manager.h
[modify] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/components/password_manager/core/browser/password_form_manager_unittest.cc
[modify] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/components/password_manager/core/browser/password_manager.cc
[add] https://crrev.com/0637ae71c31807c3882293be5f23453dd2e80342/components/password_manager/core/browser/stub_form_saver.h

Project Member

Comment 5 by bugdroid1@chromium.org, Jun 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8afac70d8152dafd3a4e539a095c12324e34d63d

commit 8afac70d8152dafd3a4e539a095c12324e34d63d
Author: vabr <vabr@chromium.org>
Date: Wed Jun 29 07:21:06 2016

Implement PasswordFormManager::WipeStoreCopyIfOutdated in FormSaver

PasswordFormManager ensures that outdated sync credentials are deleted, to help eliminate the situation when the sync credential is stored in the password store it protects.

This CL moves the logic determining which forms to drop and the Remove call to PasswordStore from PasswordFormManager to FormSaver, the delegate supposed to be handling store operations for PFM. This leaves only reading calls to PasswordStore in PasswordFormManager. The CL also adds and removes tests and modifies test support as appropriate.

This addresses a TODO from https://codereview.chromium.org/2090583003/. It concludes the first transition step from the design https://docs.google.com/document/d/12CH_SV1gIJKaEIGTs7gWBiXrCMlBa3o32OyC2LRtPAo/edit?usp=sharing .

BUG= 621355 

Review-Url: https://codereview.chromium.org/2098573002
Cr-Commit-Position: refs/heads/master@{#402745}

[modify] https://crrev.com/8afac70d8152dafd3a4e539a095c12324e34d63d/components/password_manager/core/browser/form_saver.h
[modify] https://crrev.com/8afac70d8152dafd3a4e539a095c12324e34d63d/components/password_manager/core/browser/form_saver_impl.cc
[modify] https://crrev.com/8afac70d8152dafd3a4e539a095c12324e34d63d/components/password_manager/core/browser/form_saver_impl.h
[modify] https://crrev.com/8afac70d8152dafd3a4e539a095c12324e34d63d/components/password_manager/core/browser/form_saver_impl_unittest.cc
[modify] https://crrev.com/8afac70d8152dafd3a4e539a095c12324e34d63d/components/password_manager/core/browser/password_form_manager.cc
[modify] https://crrev.com/8afac70d8152dafd3a4e539a095c12324e34d63d/components/password_manager/core/browser/password_form_manager_unittest.cc
[modify] https://crrev.com/8afac70d8152dafd3a4e539a095c12324e34d63d/components/password_manager/core/browser/password_manager_unittest.cc
[modify] https://crrev.com/8afac70d8152dafd3a4e539a095c12324e34d63d/components/password_manager/core/browser/stub_form_saver.h

Project Member

Comment 6 by bugdroid1@chromium.org, Jun 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2a9cd2e10e39bab3fea3fe792984bbac5becd1f4

commit 2a9cd2e10e39bab3fea3fe792984bbac5becd1f4
Author: vabr <vabr@chromium.org>
Date: Wed Jun 29 07:33:16 2016

Use StringPiece in form_saver_impl_unittest.cc early on

This is a clean-up CL to replace const char* with StringPiece in a signature
of helper functions in a unittest.

R=vasilii@chromium.org
BUG= 621355 

Review-Url: https://codereview.chromium.org/2101943003
Cr-Commit-Position: refs/heads/master@{#402750}

[modify] https://crrev.com/2a9cd2e10e39bab3fea3fe792984bbac5becd1f4/components/password_manager/core/browser/form_saver_impl_unittest.cc

Comment 7 by vabr@chromium.org, Jul 5 2016

Blockedon: 413020
The next step in the design doc is to separate store reading from PFM to CredentialMatcher. I plan to do that in 3 steps:

(1) Remove PasswordForm::ssl_valid, as described in  bug 413020 . While not necessary for the other steps, it will make the refactoring simpler.

(2) Change PasswordStore::GetLogins to take just the PasswordForm::Scheme and signon_realm instead of the whole form. This is needed for the whole idea of this refactoring -- we can separate fetching credentials from PFMs, because the fetching does not actually depend on the whole form, just its origin (and whether it is an HTML form or not). The PasswordStore::GetLogins signature does not make that clear right now. I checked the use of the passed PasswordForm, and indeed just the scheme, signon_realm, ssl_valid and origin are used. The first two will still be passed. The third is removed in step (1) here. The origin is derived from signon_realm, so no need to pass that.

(3) Create CredentialMatcher as specified in the design doc https://docs.google.com/document/d/12CH_SV1gIJKaEIGTs7gWBiXrCMlBa3o32OyC2LRtPAo/edit?usp=sharing.

Comment 8 by vabr@chromium.org, Jul 21 2016

(1) got addressed in  bug 413020 , (2) got addressed in https://codereview.chromium.org/2133953002/ which landed recently. Next step = (3).
Project Member

Comment 9 by bugdroid1@chromium.org, Jul 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/40c87a312f8a900ae236d7329b0303b54f842150

commit 40c87a312f8a900ae236d7329b0303b54f842150
Author: vabr <vabr@chromium.org>
Date: Thu Jul 21 07:51:44 2016

PasswordForm -> FormDigest for GetLogins

This CL restricts the data passed to GetLogins and related methods. Instead of
passing the whole of a PasswordForm, it only passes the data relevant for the
credential retrieval -- the data contained in the newly introduced FormDigest
struct: scheme, realm and origin.

BUG= 621355 

Review-Url: https://codereview.chromium.org/2133953002
Cr-Commit-Position: refs/heads/master@{#406799}

[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/native_backend_gnome_x.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/native_backend_gnome_x.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/native_backend_kwallet_x.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/native_backend_kwallet_x.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/native_backend_libsecret.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/native_backend_libsecret.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/native_backend_libsecret_unittest.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/password_store_mac.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/password_store_mac.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/password_store_mac_unittest.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/password_store_proxy_mac.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/password_store_proxy_mac.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/password_store_proxy_mac_unittest.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/password_store_win.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/password_store_win.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/password_store_win_unittest.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/password_store_x.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/password_store_x.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/password_manager/password_store_x_unittest.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/chrome/browser/sync/test/integration/passwords_helper.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/content/browser/credential_manager_impl.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/content/browser/credential_manager_impl.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/content/browser/credential_manager_impl_unittest.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/affiliated_match_helper.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/affiliated_match_helper.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/affiliated_match_helper_unittest.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/credential_manager_pending_request_task.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/credential_manager_pending_request_task.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/credential_manager_pending_require_user_mediation_task.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/login_database.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/login_database.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/login_database_ios_unittest.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/login_database_unittest.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/mock_affiliated_match_helper.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/mock_affiliated_match_helper.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/mock_password_store.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/password_form_manager.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/password_form_manager_unittest.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/password_manager_unittest.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/password_store.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/password_store.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/password_store_default.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/password_store_default.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/password_store_default_unittest.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/password_store_unittest.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/test_password_store.cc
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/components/password_manager/core/browser/test_password_store.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/ios/chrome/browser/passwords/credential_manager.h
[modify] https://crrev.com/40c87a312f8a900ae236d7329b0303b54f842150/ios/chrome/browser/passwords/credential_manager.mm

Project Member

Comment 10 by bugdroid1@chromium.org, Jul 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d0297390345d61d57a39736f898362888a9aaf30

commit d0297390345d61d57a39736f898362888a9aaf30
Author: kolos <kolos@chromium.org>
Date: Thu Jul 21 14:10:22 2016

[Password Manager] Make expected the calls of FormSaver in password_form_manager_unittests.cc

Otherwise, unittests will show warnings 'unexpected calls'.

BUG= 621355 

Review-Url: https://codereview.chromium.org/2167003003
Cr-Commit-Position: refs/heads/master@{#406839}

[modify] https://crrev.com/d0297390345d61d57a39736f898362888a9aaf30/components/password_manager/core/browser/password_form_manager_unittest.cc

Project Member

Comment 11 by bugdroid1@chromium.org, Aug 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/71252e6d95d5660cde315afeaf23cbe91c42c046

commit 71252e6d95d5660cde315afeaf23cbe91c42c046
Author: vabr <vabr@chromium.org>
Date: Wed Aug 17 18:38:50 2016

Add pretty-printing for PasswordStore::FormDigest

This helps when printing FormDigest objects to logs during debugging.

autofill::PasswordForm has a similar operator but implemented through JSON
stringification for better flexibility. FormDigest does not need this, because
it only has 3 members and is unlikely to grow.

R=dvadym@chromium.org
BUG= 621355 

Review-Url: https://codereview.chromium.org/2252053002
Cr-Commit-Position: refs/heads/master@{#412595}

[modify] https://crrev.com/71252e6d95d5660cde315afeaf23cbe91c42c046/components/password_manager/core/browser/password_store.cc
[modify] https://crrev.com/71252e6d95d5660cde315afeaf23cbe91c42c046/components/password_manager/core/browser/password_store.h

Project Member

Comment 12 by bugdroid1@chromium.org, Aug 18 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/68d599d1defb2c1369cbcaa398b7164a40a41f02

commit 68d599d1defb2c1369cbcaa398b7164a40a41f02
Author: vabr <vabr@chromium.org>
Date: Thu Aug 18 09:17:58 2016

Call PasswordFormManager::FetchDataFromPasswordStore in constructor

Every time PasswordFormManager is constructed in production code,
FetchDataFromPasswordStore is called on it immediately after construction.
It makes sense to automate calling FetchDataFromPasswordStore.

Doing so will also help keep the change of fetching credentials in
FormFetcher instead of in PasswordStore smaller. (See the overall plan
in https://docs.google.com/document/d/12CH_SV1gIJKaEIGTs7gWBiXrCMlBa3o32OyC2LRtPAo/edit#bookmark=id.cbgso0v3oogv

This CL:
  * Adds a call to FetchDataFromPasswordStore at the end of PasswordFormManager
    constructor.
  * Removes the after-construction calls to FetchDataFromPasswordStore.
  * Adjusts tests.

BUG= 621355 
R=vasilii@chromium.org

Review-Url: https://codereview.chromium.org/2256703002
Cr-Commit-Position: refs/heads/master@{#412773}

[modify] https://crrev.com/68d599d1defb2c1369cbcaa398b7164a40a41f02/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc
[modify] https://crrev.com/68d599d1defb2c1369cbcaa398b7164a40a41f02/chrome/browser/ui/passwords/manage_passwords_test.cc
[modify] https://crrev.com/68d599d1defb2c1369cbcaa398b7164a40a41f02/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc
[modify] https://crrev.com/68d599d1defb2c1369cbcaa398b7164a40a41f02/components/password_manager/core/browser/credential_manager_password_form_manager.cc
[modify] https://crrev.com/68d599d1defb2c1369cbcaa398b7164a40a41f02/components/password_manager/core/browser/password_form_manager.cc
[modify] https://crrev.com/68d599d1defb2c1369cbcaa398b7164a40a41f02/components/password_manager/core/browser/password_form_manager.h
[modify] https://crrev.com/68d599d1defb2c1369cbcaa398b7164a40a41f02/components/password_manager/core/browser/password_form_manager_unittest.cc
[modify] https://crrev.com/68d599d1defb2c1369cbcaa398b7164a40a41f02/components/password_manager/core/browser/password_manager.cc
[modify] https://crrev.com/68d599d1defb2c1369cbcaa398b7164a40a41f02/components/password_manager/sync/browser/sync_credentials_filter_unittest.cc

Project Member

Comment 13 by bugdroid1@chromium.org, Aug 18 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/10eebf2b1a61983cd3e0ae67eb5d77b1dd3bb945

commit 10eebf2b1a61983cd3e0ae67eb5d77b1dd3bb945
Author: vabr <vabr@chromium.org>
Date: Thu Aug 18 10:47:01 2016

Simplify PasswordFormManagerState

PasswordFormManagerState has 3 states: pre-matching, matching and post-matching
phase. After https://codereview.chromium.org/2256703002, none of its public
methods can be called during the pre-matching phase.

Therefore only the matching and post-matching phase values are needed. This CL:
* Removes the "pre-matching phase" value
* Renames the remaining values to better describe what they mean
* Removes duplicity from the enum name, makes it an enum class and fixes its
  position in the class declaration

R=dvadym@chromium.org
BUG= 621355 

Review-Url: https://codereview.chromium.org/2250133003
Cr-Commit-Position: refs/heads/master@{#412792}

[modify] https://crrev.com/10eebf2b1a61983cd3e0ae67eb5d77b1dd3bb945/components/password_manager/core/browser/password_form_manager.cc
[modify] https://crrev.com/10eebf2b1a61983cd3e0ae67eb5d77b1dd3bb945/components/password_manager/core/browser/password_form_manager.h

Comment 14 by vabr@chromium.org, Aug 22 2016

Blocking: 639786
Project Member

Comment 15 by bugdroid1@chromium.org, Aug 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/df4325ec18d2f313f0d36903895c58f294418c58

commit df4325ec18d2f313f0d36903895c58f294418c58
Author: vabr <vabr@chromium.org>
Date: Mon Aug 22 13:24:02 2016

credentials_to_update should own its PasswordForms

Inside PasswordFormManager and FormSaver, the |credentials_to_update| argument is used to pass copies of non-best matches with a modified password, in order to be saved to PasswordStore.

Currently, the PasswordForm in |not_best_matches_| is changed directly, and a pointer to it is passed in |credentials_to_update|. However, |not_best_matches_| will need to become constant as its ownership transfers to the coming FormFetcher class, to avoid potential for surprising side-effects when multiple PasswordFormManager change the shared object inside one FormFetcher.

This CL makes that possible by changing the element type of |credentials_to_update| from a pointer to a PasswordForm to a PasswordForm itself. That way it is possible to modify just the copy inside |credentials_to_update| and not the original in |not_best_matches_|. The fact that |not_best_matches_| fall out of sync with the PasswordStore at that point does not matter: the current PasswordFormManager is currently saving a PasswordForm, so it will be destroyed soon and will not need |not_best_matches_|.

BUG= 621355 

Review-Url: https://codereview.chromium.org/2263683002
Cr-Commit-Position: refs/heads/master@{#413436}

[modify] https://crrev.com/df4325ec18d2f313f0d36903895c58f294418c58/components/password_manager/core/browser/form_saver.h
[modify] https://crrev.com/df4325ec18d2f313f0d36903895c58f294418c58/components/password_manager/core/browser/form_saver_impl.cc
[modify] https://crrev.com/df4325ec18d2f313f0d36903895c58f294418c58/components/password_manager/core/browser/form_saver_impl.h
[modify] https://crrev.com/df4325ec18d2f313f0d36903895c58f294418c58/components/password_manager/core/browser/form_saver_impl_unittest.cc
[modify] https://crrev.com/df4325ec18d2f313f0d36903895c58f294418c58/components/password_manager/core/browser/password_form_manager.cc
[modify] https://crrev.com/df4325ec18d2f313f0d36903895c58f294418c58/components/password_manager/core/browser/password_form_manager.h
[modify] https://crrev.com/df4325ec18d2f313f0d36903895c58f294418c58/components/password_manager/core/browser/password_form_manager_unittest.cc
[modify] https://crrev.com/df4325ec18d2f313f0d36903895c58f294418c58/components/password_manager/core/browser/stub_form_saver.h

Project Member

Comment 16 by bugdroid1@chromium.org, Aug 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f6c4d75aab7ba327efc8e6e05d414b446fa63ecd

commit f6c4d75aab7ba327efc8e6e05d414b446fa63ecd
Author: vabr <vabr@chromium.org>
Date: Mon Aug 22 14:54:15 2016

Copy PasswordForm in FormSaverImpl::UpdatePreferredLoginState

UpdatePreferredLoginState needs to update PasswordStore with a slightly
modified version of some of the forms in PasswordFormManager's |best_matches_|.
Currently it does so by modifying |best_matches_| directly, and then updating
the PasswordStore.

That has the advantage of keeping an up-to-date copy in |best_matches_| without
reloading from PasswordStore (and also sparing PasswordForm copies inside
UpdatePreferredLoginState.

It also has a disadvantage: |best_matches_| cannot be const. That will become
a problem once the ownership of |best_matches_| will be transferred from
PasswordFormManager to a new class, FormFetcher, shared by multiple
PasswordFormManager instances. While it is possible to let all
PasswordFormManager instances modify the forms owned by a FormFetcher, that
will make the code hard to understand and prone to unexpected side-effects.

The advantage seems limited -- at the point UpdatePreferredLoginState is called,
the PasswordFormManager is saving a password form, and will be deleted soon.
It will not need the |best_matches_|. Once FormFetcher starts owning them,
it will need to wait for a refresh from PasswordStore to get them updated.
But that's not worse than today, when different PasswordFormManager instances do
not share their |best_matches_| at all.

BUG= 621355 

Review-Url: https://codereview.chromium.org/2261723002
Cr-Commit-Position: refs/heads/master@{#413441}

[modify] https://crrev.com/f6c4d75aab7ba327efc8e6e05d414b446fa63ecd/components/password_manager/core/browser/form_saver_impl.cc

Project Member

Comment 17 by bugdroid1@chromium.org, Aug 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0cc50262a056391589a3a09515cbe67b9ebbe157

commit 0cc50262a056391589a3a09515cbe67b9ebbe157
Author: vabr <vabr@chromium.org>
Date: Mon Aug 22 16:39:39 2016

Create StubCredentialsFilter

Currently, there are three independent testing implementations of the
CredentialsFilter API, all providing similar no-op implementation. In a coming
CL there will be a fourth one.

This CL pulls the stub of the API into a separate file, simplifying the 3
(soon 4) places in code where it is needed.

BUG= 621355 

Review-Url: https://codereview.chromium.org/2260203004
Cr-Commit-Position: refs/heads/master@{#413455}

[modify] https://crrev.com/0cc50262a056391589a3a09515cbe67b9ebbe157/components/password_manager.gypi
[modify] https://crrev.com/0cc50262a056391589a3a09515cbe67b9ebbe157/components/password_manager/core/browser/BUILD.gn
[modify] https://crrev.com/0cc50262a056391589a3a09515cbe67b9ebbe157/components/password_manager/core/browser/credentials_filter.h
[modify] https://crrev.com/0cc50262a056391589a3a09515cbe67b9ebbe157/components/password_manager/core/browser/password_form_manager_unittest.cc
[modify] https://crrev.com/0cc50262a056391589a3a09515cbe67b9ebbe157/components/password_manager/core/browser/password_manager_unittest.cc
[add] https://crrev.com/0cc50262a056391589a3a09515cbe67b9ebbe157/components/password_manager/core/browser/stub_credentials_filter.cc
[add] https://crrev.com/0cc50262a056391589a3a09515cbe67b9ebbe157/components/password_manager/core/browser/stub_credentials_filter.h
[modify] https://crrev.com/0cc50262a056391589a3a09515cbe67b9ebbe157/components/password_manager/core/browser/stub_password_manager_client.cc
[modify] https://crrev.com/0cc50262a056391589a3a09515cbe67b9ebbe157/components/password_manager/core/browser/stub_password_manager_client.h

Project Member

Comment 18 by bugdroid1@chromium.org, Aug 24 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a5406f79261a94c55b0826fac05f73375ded7d15

commit a5406f79261a94c55b0826fac05f73375ded7d15
Author: vabr <vabr@chromium.org>
Date: Wed Aug 24 08:12:32 2016

Make PasswordFormManager::best_matches_ const

...and also the related lists of passwords from PasswordStore.
PasswordFormManager should not really modify them, and will not be able to do
so once their ownership will transfer to the coming FormFetcher, shared among
multiple PasswordFormManagers.

As a side-effect, this CL also gets rid of two aliases for maps involving
PasswordForm. While the map's signature is long, it is more helpful to spell it
out than to hide it behind a cryptic PasswordFormMap, or similar, which does
not hint on ownership involved in the map.

BUG= 621355 

Review-Url: https://codereview.chromium.org/2262843002
Cr-Commit-Position: refs/heads/master@{#414016}

[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/chrome/browser/password_manager/chrome_password_manager_client.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/chrome/browser/password_manager/chrome_password_manager_client.h
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/chrome/browser/ui/passwords/manage_passwords_bubble_model.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/chrome/browser/ui/passwords/manage_passwords_state.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/chrome/browser/ui/passwords/manage_passwords_state.h
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/chrome/browser/ui/passwords/manage_passwords_test.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/chrome/browser/ui/passwords/passwords_client_ui_delegate.h
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/chrome/browser/ui/passwords/passwords_model_delegate.h
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/autofill/core/common/password_form.h
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/autofill/core/common/password_form_fill_data.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/autofill/core/common/password_form_fill_data.h
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/autofill/core/common/password_form_fill_data_unittest.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/password_manager/core/browser/form_saver.h
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/password_manager/core/browser/form_saver_impl.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/password_manager/core/browser/form_saver_impl.h
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/password_manager/core/browser/form_saver_impl_unittest.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/password_manager/core/browser/password_form_manager.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/password_manager/core/browser/password_form_manager.h
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/password_manager/core/browser/password_form_manager_unittest.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/password_manager/core/browser/password_manager.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/password_manager/core/browser/password_manager.h
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/password_manager/core/browser/password_manager_client.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/password_manager/core/browser/password_manager_client.h
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/password_manager/core/browser/statistics_table.cc
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/password_manager/core/browser/statistics_table.h
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/components/password_manager/core/browser/stub_form_saver.h
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/ios/chrome/browser/passwords/ios_chrome_update_password_infobar_delegate.mm
[modify] https://crrev.com/a5406f79261a94c55b0826fac05f73375ded7d15/ios/chrome/browser/passwords/password_controller.mm

Project Member

Comment 19 by bugdroid1@chromium.org, Aug 24 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/859b5c46d834b8974188cb5fe037ecaa18748f5c

commit 859b5c46d834b8974188cb5fe037ecaa18748f5c
Author: vabr <vabr@chromium.org>
Date: Wed Aug 24 13:23:10 2016

Introduce password_manager::FormFetcher

This CL adds a partial implementation of FormFetcher.

Despite its name, the added FormFetcher does not fetch forms from the
PasswordStore yet, this will come in a follow-up CL (see [1] for more context).

The CL focuses on a single change: PasswordFormManager (PFM) should no longer
own the fetched forms, their ownership is transferred to FormFetcher.
Ultimately, FormFetcher instances will be shared among PFM instances and will
do fetching for them, at which point it will be important that PFMs don't own
the forms. Because transferring the ownership is a significant change, it has
been separated in its own CL.

BUG= 621355 

Review-Url: https://codereview.chromium.org/2252283005
Cr-Commit-Position: refs/heads/master@{#414061}

[modify] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/chrome/browser/ui/passwords/manage_passwords_state.cc
[modify] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc
[modify] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
[modify] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/components/autofill/core/common/save_password_progress_logger.cc
[modify] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/components/autofill/core/common/save_password_progress_logger.h
[modify] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/components/components_tests.gyp
[modify] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/components/password_manager.gypi
[modify] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/components/password_manager/content/browser/credential_manager_impl.cc
[modify] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/components/password_manager/core/browser/BUILD.gn
[add] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/components/password_manager/core/browser/form_fetcher.h
[add] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/components/password_manager/core/browser/form_fetcher_impl.cc
[add] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/components/password_manager/core/browser/form_fetcher_impl.h
[add] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/components/password_manager/core/browser/form_fetcher_impl_unittest.cc
[modify] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/components/password_manager/core/browser/password_form_manager.cc
[modify] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/components/password_manager/core/browser/password_form_manager.h
[modify] https://crrev.com/859b5c46d834b8974188cb5fe037ecaa18748f5c/components/password_manager/core/browser/password_form_manager_unittest.cc

Project Member

Comment 20 by bugdroid1@chromium.org, Dec 6 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/daecd125374ae8d6526b58e56e0429550f78aca4

commit daecd125374ae8d6526b58e56e0429550f78aca4
Author: vabr <vabr@chromium.org>
Date: Tue Dec 06 11:40:34 2016

Make FormFetcher a PasswordStoreConsumer

Instead of getting the new store results from PasswordFormManager, the
FormFetcher will now itself be a PasswordStoreConsumer, relieving the
PasswordFormManager from that duty.

The FormFetcher will still stay owned by a PasswordFormManager after this CL,
changing that is the task of a follow-up CL. However, in tests it will already
be possible to inject a mock version of the FormFetcher. This is used to
simplify and revise some tests, notably password_form_manager_unittest.cc.

BUG= 621355 

Review-Url: https://codereview.chromium.org/2263933002
Cr-Commit-Position: refs/heads/master@{#436571}

[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/chrome/browser/password_manager/save_password_infobar_delegate_android_unittest.cc
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/chrome/browser/ui/passwords/manage_passwords_test.cc
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/chrome/browser/ui/passwords/manage_passwords_test.h
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/autofill/core/common/save_password_progress_logger.cc
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/autofill/core/common/save_password_progress_logger.h
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/content/browser/credential_manager_impl_unittest.cc
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/BUILD.gn
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/credential_manager_password_form_manager.cc
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/credential_manager_password_form_manager.h
[add] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/fake_form_fetcher.cc
[add] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/fake_form_fetcher.h
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/form_fetcher.h
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/form_fetcher_impl.cc
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/form_fetcher_impl.h
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/form_fetcher_impl_unittest.cc
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/password_form_manager.cc
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/password_form_manager.h
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/password_form_manager_unittest.cc
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/password_manager.cc
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/password_manager.h
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/password_manager_unittest.cc
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/password_store.cc
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/core/browser/password_store.h
[modify] https://crrev.com/daecd125374ae8d6526b58e56e0429550f78aca4/components/password_manager/sync/browser/sync_credentials_filter_unittest.cc

Comment 21 by vabr@chromium.org, Dec 6 2016

r436571 separated fetching passwords from PasswordFormManager, into FormFetcherImpl. The FFI is currently still owned and created by PFM.

One last big step remaining is to move the creation and ownership to PasswordManager.
Project Member

Comment 22 by bugdroid1@chromium.org, Dec 7 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d2b56a83f852409c53119aa2604daf674d005b63

commit d2b56a83f852409c53119aa2604daf674d005b63
Author: vabr <vabr@chromium.org>
Date: Wed Dec 07 10:28:31 2016

Pass InteractionStats by value

The APIs related to PasswordStore currently pass vectors of unique_ptrs of
InteractionStats. Thanks to C++11 move semantics it is no performance hit to
pass around vectors of the stats themselves, leading to a simpler API. This CL
drops the unique_ptr part.

BUG= 621355 

Review-Url: https://codereview.chromium.org/2552263002
Cr-Commit-Position: refs/heads/master@{#436908}

[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/chrome/browser/password_manager/password_store_mac.cc
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/chrome/browser/password_manager/password_store_mac.h
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/chrome/browser/password_manager/password_store_proxy_mac.cc
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/chrome/browser/password_manager/password_store_proxy_mac.h
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/fake_form_fetcher.cc
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/fake_form_fetcher.h
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/form_fetcher.h
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/form_fetcher_impl.cc
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/form_fetcher_impl.h
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/form_fetcher_impl_unittest.cc
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/mock_password_store.cc
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/mock_password_store.h
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/password_manager_unittest.cc
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/password_store.cc
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/password_store.h
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/password_store_consumer.cc
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/password_store_consumer.h
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/password_store_default.cc
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/password_store_default.h
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/statistics_table.cc
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/statistics_table.h
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/statistics_table_unittest.cc
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/test_password_store.cc
[modify] https://crrev.com/d2b56a83f852409c53119aa2604daf674d005b63/components/password_manager/core/browser/test_password_store.h

Comment 23 by vabr@chromium.org, Dec 19 2016

Description: Show this description
Project Member

Comment 24 by bugdroid1@chromium.org, Dec 20 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a97b4417b06a86a4f006e4a06979817d3e552015

commit a97b4417b06a86a4f006e4a06979817d3e552015
Author: vabr <vabr@chromium.org>
Date: Tue Dec 20 14:22:27 2016

FormFetcherImpl: MakeWeakCopies no longer a template

MakeWeakCopies is a helper function inside the FormFetcherImpl implementation.
It transforms a vector of unique_ptrs into the result of calling get() on them.
It used to be used for pointers of different types, therefore it was a function
template. But after https://codereview.chromium.org/2552263002, MakeWeakCopies
is only used with PasswordForms.

This CL:
 * Converts MakeWeakCopies to a simple function.
 * Removes some unnecessary "autofill::" in the same file.

BUG= 621355 
R=vasilii@chromium.org

Review-Url: https://codereview.chromium.org/2587313002
Cr-Commit-Position: refs/heads/master@{#439795}

[modify] https://crrev.com/a97b4417b06a86a4f006e4a06979817d3e552015/components/password_manager/core/browser/form_fetcher_impl.cc

Project Member

Comment 25 by bugdroid1@chromium.org, Dec 21 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7d5047855d221120c1e79e0524f9b369327350d2

commit 7d5047855d221120c1e79e0524f9b369327350d2
Author: vabr <vabr@chromium.org>
Date: Wed Dec 21 15:24:52 2016

Avoid use-after-free in FormFetcherImpl

Currently, FormFetcherImpl can get deleted during processing results from the
PasswordStore, because the credential manager core code which owns it can hand
itself off to UI code and get dropped. Detailed description of the
use-after-free is in  https://crbug.com/675178#c8 .

This CL fixes this issue inside CredentialManagerPasswordFormManager by not
letting itself call a potentially self-deleting method inside
CredentialManagerPasswordFormManager::ProcessMatches.

BUG= 675178 , 621355 

Review-Url: https://codereview.chromium.org/2592653003
Cr-Commit-Position: refs/heads/master@{#440107}

[modify] https://crrev.com/7d5047855d221120c1e79e0524f9b369327350d2/components/password_manager/content/browser/credential_manager_impl.cc
[modify] https://crrev.com/7d5047855d221120c1e79e0524f9b369327350d2/components/password_manager/core/browser/BUILD.gn
[modify] https://crrev.com/7d5047855d221120c1e79e0524f9b369327350d2/components/password_manager/core/browser/credential_manager_password_form_manager.cc
[modify] https://crrev.com/7d5047855d221120c1e79e0524f9b369327350d2/components/password_manager/core/browser/credential_manager_password_form_manager.h
[add] https://crrev.com/7d5047855d221120c1e79e0524f9b369327350d2/components/password_manager/core/browser/credential_manager_password_form_manager_unittest.cc
[modify] https://crrev.com/7d5047855d221120c1e79e0524f9b369327350d2/ios/chrome/browser/passwords/credential_manager.mm

Project Member

Comment 26 by bugdroid1@chromium.org, Dec 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/aa0a47da3bea6e5455edb113f1f5682fbe34eb27

commit aa0a47da3bea6e5455edb113f1f5682fbe34eb27
Author: vabr <vabr@chromium.org>
Date: Tue Dec 27 11:55:59 2016

Remove PasswordFormManager::presaved_form_

Just a clean-up. Spotted an unused data member when looking at
PasswordFormManager, so this CL removes it.

BUG= 621355 

Review-Url: https://codereview.chromium.org/2606703003
Cr-Commit-Position: refs/heads/master@{#440749}

[modify] https://crrev.com/aa0a47da3bea6e5455edb113f1f5682fbe34eb27/components/password_manager/core/browser/password_form_manager.h

Comment 27 by vabr@chromium.org, Dec 27 2016

The last big step referenced in #21 is still a TODO. https://docs.google.com/document/d/12CH_SV1gIJKaEIGTs7gWBiXrCMlBa3o32OyC2LRtPAo/edit#heading=h.jz2q52kebs7k now contains a detailed description of what is needed to be done and why.

Comment 28 by vabr@chromium.org, Mar 7 2017

As always, the big step is complicated enough to make a couple of smaller steps. I just updated the design [1] with a detailed plan, and will start implementing it next week.


[1] https://docs.google.com/document/d/12CH_SV1gIJKaEIGTs7gWBiXrCMlBa3o32OyC2LRtPAo/edit#heading=h.jz2q52kebs7k
Project Member

Comment 31 by bugdroid1@chromium.org, Mar 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8bf230c56d5144b2f11a2371ac9c92158f0a4e4a

commit 8bf230c56d5144b2f11a2371ac9c92158f0a4e4a
Author: vabr <vabr@chromium.org>
Date: Fri Mar 17 15:36:23 2017

PasswordFormManager::form_fetcher_impl_ -> owned_form_fetcher_

This CL renames PasswordFormManager::form_fetcher_impl_ -> owned_form_fetcher_
and, more importantly, changes its type from (a unique_ptr to) FormFetcherImpl
to just FormFetcher. The PasswordFormManager does not use the "Impl" part
anyway, and the more general type is necessary for coming changes.

BUG= 621355 

Review-Url: https://codereview.chromium.org/2750363004
Cr-Commit-Position: refs/heads/master@{#457776}

[modify] https://crrev.com/8bf230c56d5144b2f11a2371ac9c92158f0a4e4a/components/password_manager/core/browser/password_form_manager.cc
[modify] https://crrev.com/8bf230c56d5144b2f11a2371ac9c92158f0a4e4a/components/password_manager/core/browser/password_form_manager.h
[modify] https://crrev.com/8bf230c56d5144b2f11a2371ac9c92158f0a4e4a/components/password_manager/core/browser/password_manager_unittest.cc

Project Member

Comment 32 by bugdroid1@chromium.org, Mar 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1506f35e2a82f1b50ba2aa51e61c60891dc8cbcc

commit 1506f35e2a82f1b50ba2aa51e61c60891dc8cbcc
Author: vabr <vabr@chromium.org>
Date: Mon Mar 20 20:08:29 2017

Introduce restricted PasswordFormManager::GrabFetcher

This CL introduces a version of PasswordFormManager::GrabFetcher where
the attached FormFetcher must be the same which was already associated
to the PasswordFormManager.

The CL also uses that new method to get rid of the redundant
CredentialManagerPasswordFormManager::form_fetcher_ in favour of
PasswordFormManager::owned_form_fetcher_.

While ultimately the restriction on GrabFetcher will be lifted in
https://codereview.chromium.org/2758773002/, the restricted form of
GrabFetcher is a pre-requisite for ensuring the correct lifetime of the owned
FormFetcher in CredentialManagerPasswordFormManager in
https://codereview.chromium.org/2760653002/, which itself is a pre-requisite
of the unrestricted version of GrabFetcher.

See
https://docs.google.com/document/d/12CH_SV1gIJKaEIGTs7gWBiXrCMlBa3o32OyC2LRtPAo/edit#heading=h.jz2q52kebs7k
for more details.

BUG= 621355 

Review-Url: https://codereview.chromium.org/2754273003
Cr-Commit-Position: refs/heads/master@{#458157}

[modify] https://crrev.com/1506f35e2a82f1b50ba2aa51e61c60891dc8cbcc/components/password_manager/core/browser/credential_manager_password_form_manager.cc
[modify] https://crrev.com/1506f35e2a82f1b50ba2aa51e61c60891dc8cbcc/components/password_manager/core/browser/credential_manager_password_form_manager.h
[modify] https://crrev.com/1506f35e2a82f1b50ba2aa51e61c60891dc8cbcc/components/password_manager/core/browser/password_form_manager.cc
[modify] https://crrev.com/1506f35e2a82f1b50ba2aa51e61c60891dc8cbcc/components/password_manager/core/browser/password_form_manager.h
[modify] https://crrev.com/1506f35e2a82f1b50ba2aa51e61c60891dc8cbcc/components/password_manager/core/browser/password_form_manager_unittest.cc

Project Member

Comment 33 by bugdroid1@chromium.org, Mar 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5ed0e12d08834914062752a7508658e121de214f

commit 5ed0e12d08834914062752a7508658e121de214f
Author: vabr <vabr@chromium.org>
Date: Mon Mar 20 20:23:30 2017

Add FormFetcher::RemoveConsumer

This allows to detach a consumer from a FormFetcher, the opposite of
AddConsumer. It will be needed for two use-cases which will come in future CLs:

(1) When multiple PasswordFormManagers (PFM) will share one FormFetcher, which
    will thus need to outlive the PFMs. Keeping dangling Consumers
    would result in use after free.
(2) When implementing PasswordFormManager::GrabFetcher the PFM will need to
    stop listening to the old FormFetcher.

More details in https://docs.google.com/document/d/12CH_SV1gIJKaEIGTs7gWBiXrCMlBa3o32OyC2LRtPAo/edit#heading=h.jz2q52kebs7k

BUG= 621355 

Review-Url: https://codereview.chromium.org/2760653002
Cr-Commit-Position: refs/heads/master@{#458166}

[modify] https://crrev.com/5ed0e12d08834914062752a7508658e121de214f/components/password_manager/core/browser/fake_form_fetcher.cc
[modify] https://crrev.com/5ed0e12d08834914062752a7508658e121de214f/components/password_manager/core/browser/fake_form_fetcher.h
[modify] https://crrev.com/5ed0e12d08834914062752a7508658e121de214f/components/password_manager/core/browser/form_fetcher.h
[modify] https://crrev.com/5ed0e12d08834914062752a7508658e121de214f/components/password_manager/core/browser/form_fetcher_impl.cc
[modify] https://crrev.com/5ed0e12d08834914062752a7508658e121de214f/components/password_manager/core/browser/form_fetcher_impl.h
[modify] https://crrev.com/5ed0e12d08834914062752a7508658e121de214f/components/password_manager/core/browser/form_fetcher_impl_unittest.cc
[modify] https://crrev.com/5ed0e12d08834914062752a7508658e121de214f/components/password_manager/core/browser/password_form_manager.cc
[modify] https://crrev.com/5ed0e12d08834914062752a7508658e121de214f/components/password_manager/core/browser/password_form_manager.h
[modify] https://crrev.com/5ed0e12d08834914062752a7508658e121de214f/components/password_manager/core/browser/password_form_manager_unittest.cc

Project Member

Comment 34 by bugdroid1@chromium.org, Mar 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/38465cdc3c25e919951c20eaae77de26ea2ccf9d

commit 38465cdc3c25e919951c20eaae77de26ea2ccf9d
Author: vabr <vabr@chromium.org>
Date: Mon Mar 20 20:42:37 2017

Introduce PasswordFormManager::GrabFetcher

This allows to attach a FormFetcher instance to a PasswordFormManager (PFM).
Normally, when multiple PFM are sharing one FormFetcher, neither of them owns
it. But when a single PFM is getting passed across multiple classes, such as
during saving a password via the bubble UI, it is more practical to have the
FormFetcher attached to the PFM. See
https://docs.google.com/document/d/12CH_SV1gIJKaEIGTs7gWBiXrCMlBa3o32OyC2LRtPAo/edit#heading=h.jz2q52kebs7k
for more details.

BUG= 621355 

Review-Url: https://codereview.chromium.org/2758773002
Cr-Commit-Position: refs/heads/master@{#458173}

[modify] https://crrev.com/38465cdc3c25e919951c20eaae77de26ea2ccf9d/components/password_manager/core/browser/password_form_manager.cc
[modify] https://crrev.com/38465cdc3c25e919951c20eaae77de26ea2ccf9d/components/password_manager/core/browser/password_form_manager.h
[modify] https://crrev.com/38465cdc3c25e919951c20eaae77de26ea2ccf9d/components/password_manager/core/browser/password_form_manager_unittest.cc

Comment 35 by vabr@chromium.org, May 2 2017

Labels: -Type-Bug Type-Task

Comment 36 by vabr@chromium.org, May 2 2017

Blocking: 717537

Comment 37 by vabr@chromium.org, Jun 7 2017

Cc: msrchandra@chromium.org smokana@chromium.org dvadym@chromium.org
 Issue 599812  has been merged into this issue.

Comment 38 by vabr@chromium.org, Jul 5 2017

Blockedon: 739366
Status: Fixed (was: Started)
The only unfinished part here was the plan to share the FormFetcher among PasswordFormManagers.
There has not been enough problems caused by the lack of sharing so far to warrant further refactoring. Depending on the potential future issues, there also might be other ways around it (e.g., PasswordStore cache).

Sign in to add a comment