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

Issue 1828103002: Extend net/base/parse_number.h for parsing of negative numbers, and determining if there was overflo (Closed)

Created:
4 years, 9 months ago by eroman
Modified:
4 years, 8 months ago
Reviewers:
mmenke, Ryan Sleevi
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@proxy_num
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Extend net/base/parse_number.h for parsing of negative numbers, and determining if there was overflow/underflow. BUG=596523 Committed: https://crrev.com/ae40d9bae35935b815cb651b2a79d32ee78707fa Cr-Commit-Position: refs/heads/master@{#386425}

Patch Set 1 #

Total comments: 2

Patch Set 2 : rebase onto origin/master #

Patch Set 3 : Add more generic version (used for saturating conversions) #

Patch Set 4 : rebase #

Patch Set 5 : remove http_response_headers changes (moving to other CL) #

Total comments: 2

Patch Set 6 : Change API to use 1 unified function called ParseIntegerBase10() #

Patch Set 7 : improve comments #

Total comments: 25

Patch Set 8 : update interface only (didn't address other comments yet) #

Total comments: 2

Patch Set 9 : Address remaining feedback #

Total comments: 22

Patch Set 10 : rebase #

Patch Set 11 : address comments #

Patch Set 12 : remove commentary on size_t... will shave that yak another time #

Total comments: 21

Patch Set 13 : refactor unittests #

Patch Set 14 : more comment re-works #

Total comments: 4

Patch Set 15 : comment fix #

Total comments: 4

Patch Set 16 : fix comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+430 lines, -101 lines) Patch
M net/base/host_port_pair.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M net/base/ip_address.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -5 lines 0 comments Download
M net/base/parse_number.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +82 lines, -35 lines 0 comments Download
M net/base/parse_number.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +110 lines, -7 lines 0 comments Download
M net/base/parse_number_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +228 lines, -48 lines 0 comments Download
M net/base/sdch_manager.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M net/cert/x509_cert_types.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
M net/proxy/proxy_bypass_rules.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 42 (13 generated)
eroman
https://codereview.chromium.org/1828103002/diff/1/net/base/parse_number_unittest.cc File net/base/parse_number_unittest.cc (right): https://codereview.chromium.org/1828103002/diff/1/net/base/parse_number_unittest.cc#newcode36 net/base/parse_number_unittest.cc:36: "", "-23", "+42", " 123", "123 ", "123\n", "0xFF", ...
4 years, 9 months ago (2016-03-24 01:24:19 UTC) #5
eroman
Actually hold off on this, I want to re-work the interfaces in light of other ...
4 years, 9 months ago (2016-03-24 15:38:27 UTC) #6
mmenke
On 2016/03/24 15:38:27, eroman wrote: > Actually hold off on this, I want to re-work ...
4 years, 9 months ago (2016-03-24 15:41:52 UTC) #7
eroman
You'll know when I publish the next patchset :) But yes, I imagine 1 enum ...
4 years, 9 months ago (2016-03-24 15:52:06 UTC) #8
mmenke
On 2016/03/24 15:52:06, eroman wrote: > You'll know when I publish the next patchset :) ...
4 years, 9 months ago (2016-03-24 15:53:28 UTC) #9
eroman
Please take another look! To help motivate the new API, see: https://codereview.chromium.org/1827243002/ Something similar is ...
4 years, 9 months ago (2016-03-24 21:29:16 UTC) #13
mmenke
https://codereview.chromium.org/1828103002/diff/80001/net/base/parse_number.h File net/base/parse_number.h (right): https://codereview.chromium.org/1828103002/diff/80001/net/base/parse_number.h#newcode57 net/base/parse_number.h:57: FAILED_PARSE, I'm a bit wary of these multiple-failure-value functions. ...
4 years, 9 months ago (2016-03-24 21:41:48 UTC) #14
eroman
https://codereview.chromium.org/1828103002/diff/80001/net/base/parse_number.h File net/base/parse_number.h (right): https://codereview.chromium.org/1828103002/diff/80001/net/base/parse_number.h#newcode57 net/base/parse_number.h:57: FAILED_PARSE, On 2016/03/24 21:41:48, mmenke wrote: > I'm a ...
4 years, 9 months ago (2016-03-24 22:12:16 UTC) #15
eroman
OK, in patchset 6 I have combined it into a single unified function: bool ParseIntegerBase10(input, ...
4 years, 9 months ago (2016-03-24 23:06:42 UTC) #17
mmenke
https://codereview.chromium.org/1828103002/diff/120001/net/base/parse_number.cc File net/base/parse_number.cc (right): https://codereview.chromium.org/1828103002/diff/120001/net/base/parse_number.cc#newcode62 net/base/parse_number.cc:62: } optional: Think this may be clearer as: if ...
4 years, 9 months ago (2016-03-25 15:31:50 UTC) #18
eroman
https://codereview.chromium.org/1828103002/diff/120001/net/base/parse_number.h File net/base/parse_number.h (right): https://codereview.chromium.org/1828103002/diff/120001/net/base/parse_number.h#newcode65 net/base/parse_number.h:65: // Whereas when allow_negative==false, accepted inputs may be optionally ...
4 years, 9 months ago (2016-03-25 17:08:09 UTC) #19
mmenke
https://codereview.chromium.org/1828103002/diff/120001/net/base/parse_number.h File net/base/parse_number.h (right): https://codereview.chromium.org/1828103002/diff/120001/net/base/parse_number.h#newcode105 net/base/parse_number.h:105: uint64_t* output, On 2016/03/25 17:08:09, eroman wrote: > On ...
4 years, 9 months ago (2016-03-25 17:36:32 UTC) #20
eroman
Thanks for all the feedback! I think the iterations on design nave definitely been for ...
4 years, 9 months ago (2016-03-25 19:04:30 UTC) #21
mmenke
A couple nits. I'll take another look at the tests on Monday, and that should ...
4 years, 9 months ago (2016-03-25 22:10:56 UTC) #22
eroman
> Note that you have a couple compile failures. :( Hmm weird. Looks like on ...
4 years, 9 months ago (2016-03-25 22:18:04 UTC) #23
Ryan Sleevi
https://codereview.chromium.org/1828103002/diff/160001/net/base/parse_number.h File net/base/parse_number.h (right): https://codereview.chromium.org/1828103002/diff/160001/net/base/parse_number.h#newcode22 net/base/parse_number.h:22: // code can lead to subtle bugs, as the ...
4 years, 9 months ago (2016-03-25 22:35:17 UTC) #25
mmenke
https://codereview.chromium.org/1828103002/diff/160001/net/base/parse_number.h File net/base/parse_number.h (right): https://codereview.chromium.org/1828103002/diff/160001/net/base/parse_number.h#newcode98 net/base/parse_number.h:98: WARN_UNUSED_RESULT; On 2016/03/25 22:35:17, Ryan Sleevi wrote: > I ...
4 years, 9 months ago (2016-03-25 22:49:59 UTC) #26
Ryan Sleevi
On 2016/03/25 22:49:59, mmenke wrote: > "Use overloaded functions (including constructors) only if a reader ...
4 years, 9 months ago (2016-03-25 22:54:05 UTC) #27
eroman
Thanks for the feedback Ryan. quick responses to the high-level comments first https://codereview.chromium.org/1828103002/diff/160001/net/base/parse_number.h File net/base/parse_number.h ...
4 years, 9 months ago (2016-03-25 23:02:23 UTC) #28
eroman
PTAL. I have renamed the stuff to include the type in the name, as in: ...
4 years, 8 months ago (2016-04-07 01:17:01 UTC) #29
mmenke
https://codereview.chromium.org/1828103002/diff/220001/net/base/parse_number.cc File net/base/parse_number.cc (right): https://codereview.chromium.org/1828103002/diff/220001/net/base/parse_number.cc#newcode76 net/base/parse_number.cc:76: // You would think these can be used here, ...
4 years, 8 months ago (2016-04-07 20:42:53 UTC) #30
eroman
https://codereview.chromium.org/1828103002/diff/220001/net/base/parse_number.cc File net/base/parse_number.cc (right): https://codereview.chromium.org/1828103002/diff/220001/net/base/parse_number.cc#newcode76 net/base/parse_number.cc:76: // You would think these can be used here, ...
4 years, 8 months ago (2016-04-08 18:57:33 UTC) #31
mmenke
LGTM https://codereview.chromium.org/1828103002/diff/260001/net/base/parse_number.h File net/base/parse_number.h (right): https://codereview.chromium.org/1828103002/diff/260001/net/base/parse_number.h#newcode102 net/base/parse_number.h:102: // ParseIntFormat::NON_NEGATIVE. (But defiend for unsigned output types). ...
4 years, 8 months ago (2016-04-08 19:11:06 UTC) #32
eroman
https://codereview.chromium.org/1828103002/diff/260001/net/base/parse_number.h File net/base/parse_number.h (right): https://codereview.chromium.org/1828103002/diff/260001/net/base/parse_number.h#newcode102 net/base/parse_number.h:102: // ParseIntFormat::NON_NEGATIVE. (But defiend for unsigned output types). On ...
4 years, 8 months ago (2016-04-08 19:27:05 UTC) #33
Ryan Sleevi
https://codereview.chromium.org/1828103002/diff/280001/net/base/parse_number.h File net/base/parse_number.h (right): https://codereview.chromium.org/1828103002/diff/280001/net/base/parse_number.h#newcode55 net/base/parse_number.h:55: // In other words, this accepts the same things ...
4 years, 8 months ago (2016-04-08 19:50:45 UTC) #34
eroman
https://codereview.chromium.org/1828103002/diff/280001/net/base/parse_number.h File net/base/parse_number.h (right): https://codereview.chromium.org/1828103002/diff/280001/net/base/parse_number.h#newcode55 net/base/parse_number.h:55: // In other words, this accepts the same things ...
4 years, 8 months ago (2016-04-08 20:53:07 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1828103002/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1828103002/300001
4 years, 8 months ago (2016-04-11 17:29:05 UTC) #38
commit-bot: I haz the power
Committed patchset #16 (id:300001)
4 years, 8 months ago (2016-04-11 18:40:48 UTC) #40
commit-bot: I haz the power
4 years, 8 months ago (2016-04-11 18:42:10 UTC) #42
Message was sent while issue was closed.
Patchset 16 (id:??) landed as
https://crrev.com/ae40d9bae35935b815cb651b2a79d32ee78707fa
Cr-Commit-Position: refs/heads/master@{#386425}

Powered by Google App Engine
This is Rietveld 408576698