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

Issue 254473002: Add support for int64 and uint64 in values.h's API. (Closed)

Created:
6 years, 8 months ago by gab
Modified:
6 years, 5 months ago
Reviewers:
Bernhard Bauer, Nico
CC:
chromium-reviews, erikwright+watch_chromium.org
Visibility:
Public.

Description

Add support for int64 and uint64 in values.h's API. A lot of callers -- including PrefService and PrefRegistry -- have custom code to handle (u)int64 inside DictionaryValue/ListValue. Introduce support directly in values.h's API to avoid code duplication at every call site. This CL cleans an example call site in PrefHashFilter (since it's also under the prefs/ umbrella), but doesn't clean up all other call sites (https://code.google.com/p/chromium/codesearch#search/&q=base::Int64ToString) those should be cleaned over time. Motivated by a request @ https://codereview.chromium.org/229763005/diff/150001/chrome/browser/search_engines/default_search_manager.cc#newcode73 BUG=None

Patch Set 1 : #

Patch Set 2 : fix compile #

Patch Set 3 : fix test compile #

Unified diffs Side-by-side diffs Delta from patch set Stats (+411 lines, -103 lines) Patch
M base/prefs/pref_registry_simple.h View 2 chunks +2 lines, -2 lines 0 comments Download
M base/prefs/pref_registry_simple.cc View 3 chunks +10 lines, -7 lines 0 comments Download
M base/prefs/pref_service.h View 2 chunks +3 lines, -9 lines 0 comments Download
M base/prefs/pref_service.cc View 3 chunks +34 lines, -39 lines 0 comments Download
M base/values.h View 10 chunks +40 lines, -0 lines 0 comments Download
M base/values.cc View 10 chunks +111 lines, -0 lines 0 comments Download
M base/values_unittest.cc View 1 2 30 chunks +204 lines, -23 lines 0 comments Download
M chrome/browser/prefs/pref_hash_filter.cc View 2 chunks +5 lines, -17 lines 0 comments Download
M components/user_prefs/pref_registry_syncable.cc View 1 2 chunks +2 lines, -6 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
gab
Bernhard, PTAL. Thanks! Gab
6 years, 8 months ago (2014-04-23 23:20:19 UTC) #1
Bernhard Bauer
I don't think this will fly. I'm not a base/ OWNER (I'm flattered that you ...
6 years, 8 months ago (2014-04-24 11:54:18 UTC) #2
gab
On 2014/04/24 11:54:18, Bernhard Bauer wrote: > I don't think this will fly. I'm not ...
6 years, 8 months ago (2014-04-24 12:35:49 UTC) #3
Bernhard Bauer
On 2014/04/24 12:35:49, gab wrote: > On 2014/04/24 11:54:18, Bernhard Bauer wrote: > > I ...
6 years, 8 months ago (2014-04-24 12:52:26 UTC) #4
gab
On 2014/04/24 12:35:49, gab wrote: > On 2014/04/24 11:54:18, Bernhard Bauer wrote: > > I ...
6 years, 8 months ago (2014-04-24 12:57:47 UTC) #5
gab
On 2014/04/24 12:52:26, Bernhard Bauer wrote: > On 2014/04/24 12:35:49, gab wrote: > > On ...
6 years, 8 months ago (2014-04-24 13:00:06 UTC) #6
Bernhard Bauer
On 2014/04/24 13:00:06, gab wrote: > On 2014/04/24 12:52:26, Bernhard Bauer wrote: > > On ...
6 years, 8 months ago (2014-04-24 13:13:22 UTC) #7
Nico
(Sounds like you don't need anything from me here? The usual answer to this proposal ...
6 years, 8 months ago (2014-04-24 19:10:02 UTC) #8
gab
On 2014/04/24 19:10:02, Nico wrote: > (Sounds like you don't need anything from me here? ...
6 years, 8 months ago (2014-04-24 19:14:40 UTC) #9
Nico
On Thu, Apr 24, 2014 at 12:14 PM, <gab@chromium.org> wrote: > On 2014/04/24 19:10:02, Nico ...
6 years, 8 months ago (2014-04-24 19:16:19 UTC) #10
gab
6 years, 8 months ago (2014-04-24 19:20:43 UTC) #11
On 2014/04/24 19:16:19, Nico wrote:
> On Thu, Apr 24, 2014 at 12:14 PM,
<https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=gab@chromium.org> wrote:
> 
> > On 2014/04/24 19:10:02, Nico wrote:
> >
> >> (Sounds like you don't need anything from me here?
> >>
> >
> >  The usual answer to this proposal is "values is supposed to be like json
> >> which is like javascript which requires 64bit numbers to be stored as ints
> >> as its numbers are doubles")
> >>
> >
> >
> > s/as ints/as strings ?
> >
> 
> Yes, sorry.

Okay, so my proposal doesn't break this (i.e. int64 are still stored as strings
internally); it just adds direct support for it to avoid code duplication all
over the place for this.

> 
> 
> >
> > It's currently stored as strings everywhere.
> >
> > My concern is mostly that it's possible to use PrefService::Get/SetInt64
> > for
> > registered int64 prefs, but there is no corresponding
> > DictionaryValue::Get/SetInt64 for int64 values inside registered dictionary
> > pref. This makes the API confusing as they're typically used in
> > conjunction.
> >
> > https://codereview.chromium.org/254473002/
> >
> 
> To unsubscribe from this group and stop receiving emails from it, send an
email
> to
https://mail.google.com/mail/?view=cm&fs=1&tf=1&to=chromium-reviews+unsubscri....

Powered by Google App Engine
This is Rietveld 408576698