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

Issue 2497853002: Create TemplateUrlData to base::Dictionary utility functions (Closed)

Created:
4 years, 1 month ago by Alexander Yashkin
Modified:
4 years ago
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Create TemplateUrlData to base::Dictionary utility functions This CL create utility functions that serialize TemplateURLData to and from base::DictionaryValue. This is useful to store TemplateURLData to preferences. Splitted from https://codereview.chromium.org/2479113002/. R=pkasting@chromium.org, stevet@chromium.org Committed: https://crrev.com/6028ec2fcc7ca0d036e903ff702de77f60a69071 Cr-Commit-Position: refs/heads/master@{#433955}

Patch Set 1 #

Patch Set 2 : Fixed after review, more utility functions created #

Patch Set 3 : Added deserialize from kSearchProviderOverrides in new dictionary format #

Patch Set 4 : Updates after review discussion, just rip out common functions #

Total comments: 26

Patch Set 5 : More fixes after review #

Total comments: 2

Patch Set 6 : Another round of review, mostly cosmetic changes #

Total comments: 1

Patch Set 7 : Minor fixes #

Patch Set 8 : Add forgotten TemplateURLDats fields initialization #

Patch Set 9 : Fixed android compilation #

Patch Set 10 : Fixed android compilation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+398 lines, -308 lines) Patch
M chrome/browser/android/locale/special_locale_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -6 lines 0 comments Download
M components/search_engines/BUILD.gn View 1 1 chunk +2 lines, -0 lines 0 comments Download
M components/search_engines/default_search_manager.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/search_engines/default_search_manager.cc View 1 2 3 4 4 chunks +8 lines, -141 lines 0 comments Download
M components/search_engines/default_search_manager_unittest.cc View 1 2 3 4 2 chunks +3 lines, -29 lines 0 comments Download
M components/search_engines/default_search_policy_handler_unittest.cc View 1 2 7 chunks +12 lines, -13 lines 0 comments Download
M components/search_engines/template_url_data.h View 1 2 3 4 5 6 1 chunk +28 lines, -0 lines 0 comments Download
M components/search_engines/template_url_data.cc View 1 2 3 4 5 6 7 2 chunks +49 lines, -0 lines 0 comments Download
A components/search_engines/template_url_data_util.h View 1 2 3 4 5 1 chunk +39 lines, -0 lines 0 comments Download
A components/search_engines/template_url_data_util.cc View 1 2 3 4 5 1 chunk +237 lines, -0 lines 0 comments Download
M components/search_engines/template_url_prepopulate_data.h View 1 1 chunk +0 lines, -4 lines 0 comments Download
M components/search_engines/template_url_prepopulate_data.cc View 1 2 3 4 4 chunks +6 lines, -113 lines 0 comments Download
M components/search_engines/template_url_prepopulate_data_unittest.cc View 1 2 3 4 4 chunks +8 lines, -2 lines 0 comments Download

Messages

Total messages: 56 (20 generated)
Alexander Yashkin
Where is another TemplateURLData serialization function GetPrepopulatedTemplateURLData in components/search_engines/template_url_prepopulate_data.cc. It restores TemplateURLData from kSearchProviderOverrides preference. ...
4 years, 1 month ago (2016-11-14 10:17:23 UTC) #1
Peter Kasting
On 2016/11/14 10:17:23, Alexander Yashkin wrote: > Where is another TemplateURLData serialization function > GetPrepopulatedTemplateURLData ...
4 years, 1 month ago (2016-11-14 18:08:53 UTC) #2
Alexander Yashkin
On 2016/11/14 at 18:08:53, pkasting wrote: > On 2016/11/14 10:17:23, Alexander Yashkin wrote: > > ...
4 years, 1 month ago (2016-11-16 11:05:32 UTC) #3
Alexander Yashkin
4 years, 1 month ago (2016-11-16 11:05:55 UTC) #4
Peter Kasting
I am definitely a fan of using the same names in both cases long-term. It ...
4 years, 1 month ago (2016-11-17 00:41:03 UTC) #5
Alexander Yashkin
On 2016/11/17 at 00:41:03, pkasting wrote: > I am definitely a fan of using the ...
4 years, 1 month ago (2016-11-17 20:19:08 UTC) #6
Alexander Yashkin
4 years, 1 month ago (2016-11-17 20:19:19 UTC) #7
Peter Kasting
On 2016/11/17 20:19:08, Alexander Yashkin wrote: > On 2016/11/17 at 00:41:03, pkasting wrote: > > ...
4 years, 1 month ago (2016-11-17 20:26:58 UTC) #8
Alexander Yashkin
On 2016/11/17 at 20:26:58, pkasting wrote: > On 2016/11/17 20:19:08, Alexander Yashkin wrote: > > ...
4 years, 1 month ago (2016-11-18 05:11:07 UTC) #9
Peter Kasting
On 2016/11/18 05:11:07, Alexander Yashkin wrote: > On 2016/11/17 at 20:26:58, pkasting wrote: > > ...
4 years, 1 month ago (2016-11-18 06:34:09 UTC) #10
Alexander Yashkin
On 2016/11/18 at 06:34:09, pkasting wrote: > On 2016/11/18 05:11:07, Alexander Yashkin wrote: > > ...
4 years, 1 month ago (2016-11-18 08:25:40 UTC) #11
Peter Kasting
https://codereview.chromium.org/2497853002/diff/60001/components/search_engines/default_search_manager.cc File components/search_engines/default_search_manager.cc (right): https://codereview.chromium.org/2497853002/diff/60001/components/search_engines/default_search_manager.cc#newcode165 components/search_engines/default_search_manager.cc:165: *TemplateURLDataToDictionary(data)); Nit: Args on subsequent lines must be indented ...
4 years, 1 month ago (2016-11-20 07:57:50 UTC) #12
Alexander Yashkin
https://codereview.chromium.org/2497853002/diff/60001/components/search_engines/default_search_manager.cc File components/search_engines/default_search_manager.cc (right): https://codereview.chromium.org/2497853002/diff/60001/components/search_engines/default_search_manager.cc#newcode165 components/search_engines/default_search_manager.cc:165: *TemplateURLDataToDictionary(data)); On 2016/11/20 at 07:57:50, Peter Kasting wrote: > ...
4 years ago (2016-11-20 20:24:05 UTC) #13
Peter Kasting
LGTM https://codereview.chromium.org/2497853002/diff/60001/components/search_engines/template_url_data_util.cc File components/search_engines/template_url_data_util.cc (right): https://codereview.chromium.org/2497853002/diff/60001/components/search_engines/template_url_data_util.cc#newcode21 components/search_engines/template_url_data_util.cc:21: std::string search_url; On 2016/11/20 20:24:05, Alexander Yashkin wrote: ...
4 years ago (2016-11-21 02:17:08 UTC) #14
Alexander Yashkin
On 2016/11/21 at 02:17:08, pkasting wrote: > LGTM > > https://codereview.chromium.org/2497853002/diff/60001/components/search_engines/template_url_data_util.cc > File components/search_engines/template_url_data_util.cc (right): ...
4 years ago (2016-11-21 13:43:53 UTC) #15
Peter Kasting
On 2016/11/21 13:43:53, Alexander Yashkin wrote: > last_modified field is compared in MergeDataAndStartSyncing and > ...
4 years ago (2016-11-21 20:12:36 UTC) #16
Peter Kasting
BTW, current code still LGTM, pending resolution of outstanding discussion points. https://codereview.chromium.org/2497853002/diff/100001/components/search_engines/template_url_data.h File components/search_engines/template_url_data.h (right): ...
4 years ago (2016-11-21 21:03:54 UTC) #17
Alexander Yashkin
On 2016/11/21 at 20:12:36, pkasting wrote: > On 2016/11/21 13:43:53, Alexander Yashkin wrote: > > ...
4 years ago (2016-11-22 06:29:27 UTC) #18
Alexander Yashkin
On 2016/11/21 at 21:03:54, pkasting wrote: > BTW, current code still LGTM, pending resolution of ...
4 years ago (2016-11-22 06:36:42 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2497853002/120001
4 years ago (2016-11-22 06:46:24 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/277596)
4 years ago (2016-11-22 07:04:39 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2497853002/140001
4 years ago (2016-11-22 12:59:32 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/72732)
4 years ago (2016-11-22 13:29:46 UTC) #29
Alexander Yashkin
On 2016/11/22 at 13:29:46, commit-bot wrote: > Try jobs failed on following builders: > android_n5x_swarming_rel ...
4 years ago (2016-11-22 13:43:58 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2497853002/160001
4 years ago (2016-11-22 13:44:28 UTC) #34
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/310421)
4 years ago (2016-11-22 13:50:04 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2497853002/180001
4 years ago (2016-11-22 17:33:40 UTC) #43
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/310613)
4 years ago (2016-11-22 17:43:26 UTC) #45
Ian Wen
lgtm
4 years ago (2016-11-22 18:52:46 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2497853002/180001
4 years ago (2016-11-22 19:41:50 UTC) #48
Peter Kasting
Note: Please try to leave replies on my comments themselves rather than replying via email ...
4 years ago (2016-11-22 19:57:24 UTC) #49
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years ago (2016-11-22 20:10:24 UTC) #51
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/6028ec2fcc7ca0d036e903ff702de77f60a69071 Cr-Commit-Position: refs/heads/master@{#433955}
4 years ago (2016-11-22 20:12:00 UTC) #53
Alexander Yashkin
On 2016/11/22 at 19:57:24, pkasting wrote: > Note: Please try to leave replies on my ...
4 years ago (2016-11-23 05:16:00 UTC) #54
Peter Kasting
On 2016/11/23 05:16:00, Alexander Yashkin wrote: > On 2016/11/22 at 19:57:24, pkasting wrote: > > ...
4 years ago (2016-11-23 05:53:59 UTC) #55
Alexander Yashkin
4 years ago (2016-11-23 05:58:18 UTC) #56
Message was sent while issue was closed.
On 2016/11/23 at 05:53:59, pkasting wrote:
> On 2016/11/23 05:16:00, Alexander Yashkin wrote:
> > On 2016/11/22 at 19:57:24, pkasting wrote:
> > > I didn't say to change it to std::string (which would violate the style
> > guide).  Leave it as char*, just use "" for empty strings instead of NULL. 
""
> > is a valid char*.
> > > 
> > > The thing we'd change to std::string is the constructor itself.
> > 
> > Do you mean to change autogeneration of structures in such way that they
will
> > contain "" instead of NULL for undefined fields?
> 
> Yes.
> 
> > This generation is done in json_to_struct/element_generator.py. It could be
> > done, but effect of such change could be very wide.
> 
> Looks like only fieldtrial_testing_config.* and prepopulated_engines.* use
this, so hopefully it would be fairly easy to check the effects of such a
change.
> 
> > Is it worth it if as result we can only use std::string instead of
StringPiece
> > when initializing from such fields?
> 
> In all cases, we'll be converting to a string later anyway, so when
initializing from these fields we'll save construction of a StringPiece, and
when converting from a string to call these, we'll save both the StringPiece and
later string constructions.  That seems worth doing to me.

Ok, I'll try to fix it.

Powered by Google App Engine
This is Rietveld 408576698