|
|
Created:
5 years, 6 months ago by Deepak Modified:
5 years, 4 months ago CC:
chromium-reviews, estade+watch_chromium.org, browser-components-watch_chromium.org, rouslan+autofillwatch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionAvoiding Vectors usage while setting info in AutofillProfile.
As we are setting the first value that are getting fetched.
So no need of the vectors, we can directly set the info from the query coloums and set "LIMIT 1" to get only one row of data from sql query.
BUG=503055
Committed: https://crrev.com/38ab25d28eb5cda9b5e9398ff67b2b4c0e74087a
Cr-Commit-Position: refs/heads/master@{#336373}
Patch Set 1 #
Total comments: 4
Patch Set 2 : Changes as per review comments. #Patch Set 3 : Changes as per review comments. #
Total comments: 2
Patch Set 4 : Changes as per review comments. #
Total comments: 2
Patch Set 5 : Addressing nit. #
Total comments: 1
Messages
Total messages: 31 (8 generated)
deepak.m1@samsung.com changed reviewers: + ajith.v@chromium.org
PTAL for peer review.
https://codereview.chromium.org/1198013002/diff/1/components/autofill/core/br... File components/autofill/core/browser/webdata/autofill_table.cc (right): https://codereview.chromium.org/1198013002/diff/1/components/autofill/core/br... components/autofill/core/browser/webdata/autofill_table.cc:197: "WHERE guid=?")); Can we restrict the retrieval limit by 1 instead of getting all rows. So only one entry will be there in result set. https://codereview.chromium.org/1198013002/diff/1/components/autofill/core/br... components/autofill/core/browser/webdata/autofill_table.cc:208: profile->SetRawInfo(NAME_FULL, s.ColumnString16(4)); s.Succeded() needs to be checked whether Query forced SQL table in a valid state.
Changes done as suggested. PTAL https://codereview.chromium.org/1198013002/diff/1/components/autofill/core/br... File components/autofill/core/browser/webdata/autofill_table.cc (right): https://codereview.chromium.org/1198013002/diff/1/components/autofill/core/br... components/autofill/core/browser/webdata/autofill_table.cc:197: "WHERE guid=?")); On 2015/06/22 10:00:38, AKV wrote: > Can we restrict the retrieval limit by 1 instead of getting all rows. So only > one entry will be there in result set. Done. https://codereview.chromium.org/1198013002/diff/1/components/autofill/core/br... components/autofill/core/browser/webdata/autofill_table.cc:208: profile->SetRawInfo(NAME_FULL, s.ColumnString16(4)); On 2015/06/22 10:00:38, AKV wrote: > s.Succeded() needs to be checked whether Query forced SQL table in a valid > state. Done.
peer review looks good to me!
deepak.m1@samsung.com changed reviewers: + estade@chromium.org, vabr@chromium.org
PTAL
deepak.m1@samsung.com changed reviewers: + gcasto@chromium.org
@Garrett Please review. Thanks
gcasto@chromium.org changed reviewers: + isherman@chromium.org - estade@chromium.org, vabr@chromium.org
If you look at the OWNERS file, I only own password manager code in components/autofill. Re-routing to Ilya.
isherman@chromium.org changed reviewers: + estade@chromium.org
Thanks, but this is not the intention of the TODO. These fields used to be lists, but are now singletons; so what's desired is a database schema update.
On 2015/06/23 21:23:59, Ilya Sherman wrote: > Thanks, but this is not the intention of the TODO. These fields used to be > lists, but are now singletons; so what's desired is a database schema update. ok. I think now their will be only one name_first,name_middle,name_last,name_full will be there. and similar to that will be one email_address and phone_home_whole_number. so I tried by changing 'repeated string' to 'optional string' for email_address for understanding in autofill_specifies.proto file. But then I am getting some build errors like add_email_address() no present for specifies in autofill_profile_syncable_service.cc I think tables schema is fine, but the way data is inserted and retrieved need changes. please correct me if I misunderstand something.
ok. I think now their will be only one name_first,name_middle,name_last,name_full will be there, as you mentioned that these are singleton now. and similar to that will be one email_address and phone_home_whole_number. 1) I tried by changing 'repeated string' to 'optional string' for email_address for understanding in autofill_specifics.proto file. But then I am getting some build errors like add_email_address() no present for specifies in autofill_profile_syncable_service.cc I saw table schema for email in InitProfileEmailsTable() and appears fine to me. but the way data is inserted and retrieved need changes. 2) How generation of add_email_address() and other depends upon the datatype ? please correct me if I misunderstand something.
We currently have four tables: autofill_profiles, autofill_profile_names, autofill_profile_emails, and autofill_profile_phones. These should be combined into a single table; there is no longer a need to associate multiple names or emails or phone numbers per unique profile GUID.
On 2015/06/24 23:55:49, Ilya Sherman wrote: > We currently have four tables: autofill_profiles, autofill_profile_names, > autofill_profile_emails, and autofill_profile_phones. These should be combined > into a single table; there is no longer a need to associate multiple names or > emails or phone numbers per unique profile GUID. FWIW, I suspect that merging the tables back into a single table will involve a fairly large number of changes to the code, and very careful attention to testing. If you wish to pick up this work, I would not recommend thinking of it as a quick fix.
On 2015/06/24 23:57:27, Ilya Sherman wrote: > On 2015/06/24 23:55:49, Ilya Sherman wrote: > > We currently have four tables: autofill_profiles, autofill_profile_names, > > autofill_profile_emails, and autofill_profile_phones. These should be > combined > > into a single table; there is no longer a need to associate multiple names or > > emails or phone numbers per unique profile GUID. > > FWIW, I suspect that merging the tables back into a single table will involve a > fairly large number of changes to the code, and very careful attention to > testing. If you wish to pick up this work, I would not recommend thinking of it > as a quick fix. @llya Thanks for reply. How about improving the current code by doing clean up like changes in this CL and similar to this in autofill_profile_syncable_service.cc ?
On 2015/06/25 02:47:56, Deepak wrote: > On 2015/06/24 23:57:27, Ilya Sherman wrote: > > On 2015/06/24 23:55:49, Ilya Sherman wrote: > > > We currently have four tables: autofill_profiles, autofill_profile_names, > > > autofill_profile_emails, and autofill_profile_phones. These should be > > combined > > > into a single table; there is no longer a need to associate multiple names > or > > > emails or phone numbers per unique profile GUID. > > > > FWIW, I suspect that merging the tables back into a single table will involve > a > > fairly large number of changes to the code, and very careful attention to > > testing. If you wish to pick up this work, I would not recommend thinking of > it > > as a quick fix. > > @llya > Thanks for reply. > How about improving the current code by doing clean up like changes in this CL > and similar to this in autofill_profile_syncable_service.cc ? I'll defer to Evan's preference on that -- he should be back tomorrow, and might need a day or two to catch up on email backlog. I do think that at least the TODO should be preserved, since the schema change is still desired.
On 2015/06/25 03:09:52, Ilya Sherman wrote: > On 2015/06/25 02:47:56, Deepak wrote: > > On 2015/06/24 23:57:27, Ilya Sherman wrote: > > > On 2015/06/24 23:55:49, Ilya Sherman wrote: > > > > We currently have four tables: autofill_profiles, autofill_profile_names, > > > > autofill_profile_emails, and autofill_profile_phones. These should be > > > combined > > > > into a single table; there is no longer a need to associate multiple names > > or > > > > emails or phone numbers per unique profile GUID. > > > > > > FWIW, I suspect that merging the tables back into a single table will > involve > > a > > > fairly large number of changes to the code, and very careful attention to > > > testing. If you wish to pick up this work, I would not recommend thinking > of > > it > > > as a quick fix. > > > > @llya > > Thanks for reply. > > How about improving the current code by doing clean up like changes in this CL > > and similar to this in autofill_profile_syncable_service.cc ? > > I'll defer to Evan's preference on that -- he should be back tomorrow, and might > need a day or two to catch up on email backlog. I do think that at least the > TODO should be preserved, since the schema change is still desired. I agree with you regarding preserving TODO. and would like to know Evan's opinion.
https://codereview.chromium.org/1198013002/diff/40001/components/autofill/cor... File components/autofill/core/browser/webdata/autofill_table.cc (left): https://codereview.chromium.org/1198013002/diff/40001/components/autofill/cor... components/autofill/core/browser/webdata/autofill_table.cc:217: // TODO(estade): update schema so these aren't vectors. this change overall is ok, but you haven't really fixed this TODO --- the schema haven't been updated. Please restore some version of this comment and add a link to crbug.com/497934
@Evan Thanks for review. Changes done as suggested. PTAL. https://codereview.chromium.org/1198013002/diff/40001/components/autofill/cor... File components/autofill/core/browser/webdata/autofill_table.cc (left): https://codereview.chromium.org/1198013002/diff/40001/components/autofill/cor... components/autofill/core/browser/webdata/autofill_table.cc:217: // TODO(estade): update schema so these aren't vectors. On 2015/06/25 18:02:16, Evan Stade wrote: > this change overall is ok, but you haven't really fixed this TODO --- the schema > haven't been updated. Please restore some version of this comment and add a link > to crbug.com/497934 Done.
lgtm with nit fixed https://codereview.chromium.org/1198013002/diff/60001/components/autofill/cor... File components/autofill/core/browser/webdata/autofill_table.cc (right): https://codereview.chromium.org/1198013002/diff/60001/components/autofill/cor... components/autofill/core/browser/webdata/autofill_table.cc:205: // unique profile guid. Please refer https://crbug.com/497934. nit, move comment to above statement that has LIMIT 1, or to where the schema is defined.
Thanks for review. nit addressed. https://codereview.chromium.org/1198013002/diff/60001/components/autofill/cor... File components/autofill/core/browser/webdata/autofill_table.cc (right): https://codereview.chromium.org/1198013002/diff/60001/components/autofill/cor... components/autofill/core/browser/webdata/autofill_table.cc:205: // unique profile guid. Please refer https://crbug.com/497934. On 2015/06/26 14:31:14, Evan Stade wrote: > nit, move comment to above statement that has LIMIT 1, or to where the schema is > defined. Done.
The CQ bit was checked by deepak.m1@samsung.com
The patchset sent to the CQ was uploaded after l-g-t-m from estade@chromium.org Link to the patchset: https://codereview.chromium.org/1198013002/#ps80001 (title: "Addressing nit.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1198013002/80001
Message was sent while issue was closed.
Committed patchset #5 (id:80001)
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/38ab25d28eb5cda9b5e9398ff67b2b4c0e74087a Cr-Commit-Position: refs/heads/master@{#336373}
Message was sent while issue was closed.
shess@chromium.org changed reviewers: + shess@chromium.org
Message was sent while issue was closed.
https://codereview.chromium.org/1198013002/diff/80001/components/autofill/cor... File components/autofill/core/browser/webdata/autofill_table.cc (right): https://codereview.chromium.org/1198013002/diff/80001/components/autofill/cor... components/autofill/core/browser/webdata/autofill_table.cc:200: "LIMIT 1")); Note that if you have multiple items with the same GUID, without an ORDER BY clause there is no guarantee that the first result will be the same each time. In practice a given release of SQLite is likely to return results in the same implementation-defined order from run to run. This can lead to problems like bug 412968, where a new SQLite implementation did not return things in the same order as the old one (in fact, in some cases the GUID meant that the order was not stable between runs of the tests). Since the set of items matching GUID is probably tiny, I'd probably go with ORDER BY 2, 3, 4, 5 or something of the sort, just to make it the same each time. If the guid is indexed, the performance difference will probably not be measurable. Of course, this isn't really a problem with this CL, it was present in the earlier code. It's more of a hygiene consideration. |