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

Issue 9016024: Add option for not adding '.0' to the end of doubles that have no fractional (Closed)

Created:
9 years ago by kkania
Modified:
8 years, 9 months ago
Reviewers:
tony, brettw
CC:
chromium-reviews, Paweł Hajdan Jr., brettw-cc_chromium.org
Visibility:
Public.

Description

Add a new option to JSONWriter, which instructs it not to append '.0' or use exponential notation when writing doubles with no fractional part. This is needed so we can write an integer value larger than what a 32-bit int will hold using a double, and write the said double in such a way as to enable external JSON readers (that support int64) to convert it to an int64 instead of a double. The other alternative is to add support for int64 in the Value classes and clients. See http://codereview.chromium.org/8962042 BUG=none TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=125705

Patch Set 1 : ... #

Total comments: 4

Patch Set 2 : change name of option #

Total comments: 2

Patch Set 3 : remove excessive comments #

Patch Set 4 : rebase #

Patch Set 5 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -20 lines) Patch
M base/json/json_writer.h View 1 2 3 chunks +10 lines, -3 lines 0 comments Download
M base/json/json_writer.cc View 1 6 chunks +20 lines, -5 lines 0 comments Download
M base/json/json_writer_unittest.cc View 1 2 chunks +9 lines, -1 line 0 comments Download
M chrome/test/webdriver/commands/response.cc View 1 2 chunks +8 lines, -2 lines 0 comments Download
M chrome/test/webdriver/webdriver_logging.cc View 1 2 3 4 1 chunk +2 lines, -9 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
kkania
8 years, 11 months ago (2012-01-04 00:23:59 UTC) #1
Nico
Looks like I'm not in base/OWNERS anymore, so I can't review this.
8 years, 11 months ago (2012-01-04 16:37:41 UTC) #2
brettw
Can you elaborate on specifically why this is needed?
8 years, 11 months ago (2012-01-04 21:21:03 UTC) #3
kkania
This is for ChromeDriver (http://www.chromium.org/developers/testing/webdriver-for-chrome). In ChromeDriver, we need to return a timestamp (in JSON) ...
8 years, 11 months ago (2012-01-05 02:07:17 UTC) #4
brettw
+tc who has more experience with base/value.h. Over IM: In the past, I suggested people ...
8 years, 11 months ago (2012-01-05 17:56:10 UTC) #5
kkania
ping. Just a reminder, the three options are (in order of my preference): 1) Fork ...
8 years, 9 months ago (2012-03-05 21:52:21 UTC) #6
brettw
On Mon, Mar 5, 2012 at 1:52 PM, <kkania@chromium.org> wrote: > ping. Just a reminder, ...
8 years, 9 months ago (2012-03-05 21:54:44 UTC) #7
kkania
You're right, I didn't respond. ChromeDriver receives commands from external clients (which I don't have ...
8 years, 9 months ago (2012-03-06 01:29:08 UTC) #8
tony
On 2012/03/06 01:29:08, kkania wrote: > You're right, I didn't respond. ChromeDriver receives commands from ...
8 years, 9 months ago (2012-03-06 01:37:41 UTC) #9
kkania
On 2012/03/06 01:37:41, tony wrote: > On 2012/03/06 01:29:08, kkania wrote: > > You're right, ...
8 years, 9 months ago (2012-03-06 02:31:53 UTC) #10
tony
Does sending numbers with .0 break existing clients? JSON doesn't differentiate between doubles and ints, ...
8 years, 9 months ago (2012-03-06 17:57:25 UTC) #11
kkania
The JSON spec doesn't differentiate, but most implementations automatically assume a number with . or ...
8 years, 9 months ago (2012-03-06 21:26:09 UTC) #12
tony
On 2012/03/06 21:26:09, kkania wrote: > The JSON spec doesn't differentiate, but most implementations automatically ...
8 years, 9 months ago (2012-03-06 21:50:13 UTC) #13
kkania
http://codereview.chromium.org/9016024/diff/27001/base/json/json_writer.h File base/json/json_writer.h (right): http://codereview.chromium.org/9016024/diff/27001/base/json/json_writer.h#newcode36 base/json/json_writer.h:36: // 64-bit int. On 2012/03/06 21:50:13, tony wrote: > ...
8 years, 9 months ago (2012-03-06 22:41:57 UTC) #14
kkania
Just waiting for owner's approval now. No rush.
8 years, 9 months ago (2012-03-06 23:18:02 UTC) #15
brettw
Rubber stamp LGTM based on Tony's review.
8 years, 9 months ago (2012-03-06 23:24:05 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kkania@chromium.org/9016024/30001
8 years, 9 months ago (2012-03-08 19:39:43 UTC) #17
commit-bot: I haz the power
8 years, 9 months ago (2012-03-08 22:55:33 UTC) #18
Change committed as 125705

Powered by Google App Engine
This is Rietveld 408576698