Description was changed from
==========
Refactor CredentialManagerImpl::Get. It should use PasswordStore::GetLogins().
The decision to filter the Android federated credentials in PasswordStore was
taken in https://codereview.chromium.org/1385563007. It was wrong in the long
term.
BUG=666340
==========
to
==========
Refactor CredentialManagerImpl::Get. It should use PasswordStore::GetLogins().
The PSL matches are filtered out.
The decision to filter the Android federated credentials in PasswordStore was
taken in https://codereview.chromium.org/1385563007. It was wrong for the long
term.
BUG=666340
==========
Dry run: Try jobs failed on following builders: android_arm64_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_arm64_dbg_recipe/builds/168687)
Thanks, Vasilii. My main question is:
How do we make sure that the issue reported in http://crbug.com/539833 does not
happen again? Is there a test guarding that?
Cheers,
Vaclav
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
File
components/password_manager/content/browser/credential_manager_impl_unittest.cc
(left):
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
components/password_manager/content/browser/credential_manager_impl_unittest.cc:573:
form_.signon_realm = "this is a realm";
I'm curious why this needed to be removed. If I read the code correctly, the
signon_realm, unless overridden here, will be some web URL. If this is important
for the test, should we document it somehow (explicitly setting it, ASSERTing
its value, or just commenting on it)?
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
File
components/password_manager/core/browser/credential_manager_pending_request_task.cc
(right):
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
components/password_manager/core/browser/credential_manager_pending_request_task.cc:113:
std::vector<std::unique_ptr<autofill::PasswordForm>> psl_results;
The CL description says that the PSL results are filtered out, and indeed, the
code only pushes_back to |psl_results| but never uses what is stored there.
Why cannot we just keep those in |results| and execute continue; on line 132?
Alternatively, what about calling |psl_results| something like
|filtered_out_results| to make it clearer that it is a sink vector?
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
File
components/password_manager/core/browser/credential_manager_pending_request_task.h
(right):
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
components/password_manager/core/browser/credential_manager_pending_request_task.h:76:
std::vector<std::string> federations_;
I'm not sure I understand why you made this a vector instead of a set, when it
is used for lookups (forcing you to use sort and binary_search explicitly).
We should also comment here that the vector is kept sorted if we want to keep it
that way.
vasilii
The CQ bit was checked by vasilii@chromium.org to run a CQ dry run
What you asked is tested by FormFetcherImplTest.Federated and FormFetcherImplTest.Mixed https://codereview.chromium.org/2517993004/diff/40001/components/password_manager/content/browser/credential_manager_impl_unittest.cc File components/password_manager/content/browser/credential_manager_impl_unittest.cc (left): https://codereview.chromium.org/2517993004/diff/40001/components/password_manager/content/browser/credential_manager_impl_unittest.cc#oldcode573 components/password_manager/content/browser/credential_manager_impl_unittest.cc:573: ...
What you asked is tested by FormFetcherImplTest.Federated and
FormFetcherImplTest.Mixed
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
File
components/password_manager/content/browser/credential_manager_impl_unittest.cc
(left):
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
components/password_manager/content/browser/credential_manager_impl_unittest.cc:573:
form_.signon_realm = "this is a realm";
On 2016/11/23 08:57:56, vabr (Chromium) wrote:
> I'm curious why this needed to be removed. If I read the code correctly, the
> signon_realm, unless overridden here, will be some web URL. If this is
important
> for the test, should we document it somehow (explicitly setting it, ASSERTing
> its value, or just commenting on it)?
|form_| has already correct origin and signon_realm after SetUp(). The test
overwrites |origin| so that it's different from the current URL.
"this is a realm" is obviously incorrect and can't be used anywhere.
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
File
components/password_manager/core/browser/credential_manager_pending_request_task.cc
(right):
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
components/password_manager/core/browser/credential_manager_pending_request_task.cc:113:
std::vector<std::unique_ptr<autofill::PasswordForm>> psl_results;
On 2016/11/23 08:57:56, vabr (Chromium) wrote:
> The CL description says that the PSL results are filtered out, and indeed, the
> code only pushes_back to |psl_results| but never uses what is stored there.
>
> Why cannot we just keep those in |results| and execute continue; on line 132?
> Alternatively, what about calling |psl_results| something like
> |filtered_out_results| to make it clearer that it is a sink vector?
We can but it's not a refactoring on its own. It's a preparation for fixing the
bug. In the next CL today or tomorrow |psl_results| is to be used below.
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
File
components/password_manager/core/browser/credential_manager_pending_request_task.h
(right):
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
components/password_manager/core/browser/credential_manager_pending_request_task.h:76:
std::vector<std::string> federations_;
On 2016/11/23 08:57:56, vabr (Chromium) wrote:
> I'm not sure I understand why you made this a vector instead of a set, when it
> is used for lookups (forcing you to use sort and binary_search explicitly).
>
> We should also comment here that the vector is kept sorted if we want to keep
it
> that way.
sorted vector is faster than the set. An alternative would be unordered_set. For
0-2 values it also will be slower.
vabr (Chromium)
Thanks, Vasilii. Good point about the FormFetcherImplTests checking the handling of federated forms, that sounds ...
Thanks, Vasilii.
Good point about the FormFetcherImplTests checking the handling of federated
forms, that sounds good.
The CL LGTM, although I still have one point to discuss about the set vs. vector
below.
Cheers,
Vaclav
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
File
components/password_manager/core/browser/credential_manager_pending_request_task.cc
(right):
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
components/password_manager/core/browser/credential_manager_pending_request_task.cc:113:
std::vector<std::unique_ptr<autofill::PasswordForm>> psl_results;
On 2016/11/23 09:40:54, vasilii wrote:
> On 2016/11/23 08:57:56, vabr (Chromium) wrote:
> > The CL description says that the PSL results are filtered out, and indeed,
the
> > code only pushes_back to |psl_results| but never uses what is stored there.
> >
> > Why cannot we just keep those in |results| and execute continue; on line
132?
> > Alternatively, what about calling |psl_results| something like
> > |filtered_out_results| to make it clearer that it is a sink vector?
>
> We can but it's not a refactoring on its own. It's a preparation for fixing
the
> bug. In the next CL today or tomorrow |psl_results| is to be used below.
Acknowledged.
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
File
components/password_manager/core/browser/credential_manager_pending_request_task.h
(right):
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
components/password_manager/core/browser/credential_manager_pending_request_task.h:76:
std::vector<std::string> federations_;
On 2016/11/23 09:40:54, vasilii wrote:
> On 2016/11/23 08:57:56, vabr (Chromium) wrote:
> > I'm not sure I understand why you made this a vector instead of a set, when
it
> > is used for lookups (forcing you to use sort and binary_search explicitly).
> >
> > We should also comment here that the vector is kept sorted if we want to
keep
> it
> > that way.
>
> sorted vector is faster than the set. An alternative would be unordered_set.
For
> 0-2 values it also will be slower.
Thanks for explaining!
So this is the tradeoff for using vector:
Benefit -- better performance
Drawback -- increased fragility and verbosity of the code; if future changes
miss the requirement of keeping the vector sorted, the code will have bugs
Do we know how much performance gain we get from using vector? To me it seems
neither like a hotspot, nor like we expect large enough sizes to make a
difference here.
I'm happy to stand corrected on that observation, but until I do, I'd suggest to
have an unordered or just plain set to the vector.
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
File
components/password_manager/core/browser/credential_manager_pending_request_task.h
(right):
https://codereview.chromium.org/2517993004/diff/40001/components/password_man...
components/password_manager/core/browser/credential_manager_pending_request_task.h:76:
std::vector<std::string> federations_;
On 2016/11/23 09:51:03, vabr (Chromium) wrote:
> On 2016/11/23 09:40:54, vasilii wrote:
> > On 2016/11/23 08:57:56, vabr (Chromium) wrote:
> > > I'm not sure I understand why you made this a vector instead of a set,
when
> it
> > > is used for lookups (forcing you to use sort and binary_search
explicitly).
> > >
> > > We should also comment here that the vector is kept sorted if we want to
> keep
> > it
> > > that way.
> >
> > sorted vector is faster than the set. An alternative would be unordered_set.
> For
> > 0-2 values it also will be slower.
>
> Thanks for explaining!
>
> So this is the tradeoff for using vector:
> Benefit -- better performance
> Drawback -- increased fragility and verbosity of the code; if future changes
> miss the requirement of keeping the vector sorted, the code will have bugs
>
> Do we know how much performance gain we get from using vector? To me it seems
> neither like a hotspot, nor like we expect large enough sizes to make a
> difference here.
>
> I'm happy to stand corrected on that observation, but until I do, I'd suggest
to
> have an unordered or just plain set to the vector.
Reverted.
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/322650)
Description was changed from
==========
Refactor CredentialManagerImpl::Get. It should use PasswordStore::GetLogins().
The PSL matches are filtered out.
The decision to filter the Android federated credentials in PasswordStore was
taken in https://codereview.chromium.org/1385563007. It was wrong for the long
term.
BUG=666340
==========
to
==========
Refactor CredentialManagerImpl::Get. It should use PasswordStore::GetLogins().
The PSL matches are filtered out.
The decision to filter the Android federated credentials in PasswordStore was
taken in https://codereview.chromium.org/1385563007. It was wrong for the long
term.
BUG=666340
==========
Description was changed from
==========
Refactor CredentialManagerImpl::Get. It should use PasswordStore::GetLogins().
The PSL matches are filtered out.
The decision to filter the Android federated credentials in PasswordStore was
taken in https://codereview.chromium.org/1385563007. It was wrong for the long
term.
BUG=666340
==========
to
==========
Refactor CredentialManagerImpl::Get. It should use PasswordStore::GetLogins().
The PSL matches are filtered out.
The decision to filter the Android federated credentials in PasswordStore was
taken in https://codereview.chromium.org/1385563007. It was wrong for the long
term.
BUG=666340
Committed: https://crrev.com/abcf35aa714af18959364b626d5929975768f66a
Cr-Commit-Position: refs/heads/master@{#434147}
==========
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/abcf35aa714af18959364b626d5929975768f66a Cr-Commit-Position: refs/heads/master@{#434147}
Issue 2517993004: Refactor CredentialManagerImpl::Get. It should use PasswordStore::GetLogins().
(Closed)
Created 4 years, 1 month ago by vasilii
Modified 4 years ago
Reviewers: vabr (Chromium), jdoerrie
Base URL:
Comments: 9