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

Issue 895913004: JSONStringValueSerializer takes a StringPiece instead of std::string&. (Closed)

Created:
5 years, 10 months ago by Matt Giuca
Modified:
5 years, 10 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@json-nullstring
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

JSONStringValueSerializer takes a StringPiece instead of std::string&. This allows callers to pass a char* (string literal) or StringPiece (lightweight substring) without having to explicitly construct a string object. Refactored the implementation to avoid an ugly const_cast and Boolean to avoid mutating a const pointer. Updated tests to use char* literals, and added some new tests to test the new edge cases. BUG=455068 Committed: https://crrev.com/a82ce4efc2cfa3812b96e22b5d3a68f915c7fbfb Cr-Commit-Position: refs/heads/master@{#314728}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -30 lines) Patch
M base/json/json_string_value_serializer.h View 3 chunks +11 lines, -6 lines 0 comments Download
M base/json/json_string_value_serializer.cc View 3 chunks +6 lines, -7 lines 0 comments Download
M base/json/json_value_serializer_unittest.cc View 10 chunks +67 lines, -17 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
Matt Giuca
Hi again, This is based on top of https://codereview.chromium.org/889303004 which I also sent to you.
5 years, 10 months ago (2015-02-04 03:52:48 UTC) #2
rvargas (doing something else)
lgtm This is an improvement, but have you considered removing the deserialization method from this ...
5 years, 10 months ago (2015-02-04 21:04:49 UTC) #3
Matt Giuca
You mean splitting the class into JSONStringValueSerializer and JSONStringValueDeserializer? Sounds reasonable (I'm pretty sure no ...
5 years, 10 months ago (2015-02-04 23:12:18 UTC) #4
rvargas (doing something else)
On 2015/02/04 23:12:18, Matt Giuca wrote: > You mean splitting the class into JSONStringValueSerializer and ...
5 years, 10 months ago (2015-02-04 23:35:53 UTC) #5
Matt Giuca
Done: http://crbug.com/455453
5 years, 10 months ago (2015-02-04 23:47:33 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/895913004/1
5 years, 10 months ago (2015-02-05 01:49:28 UTC) #8
commit-bot: I haz the power
Committed patchset #1 (id:1)
5 years, 10 months ago (2015-02-05 03:03:11 UTC) #9
commit-bot: I haz the power
5 years, 10 months ago (2015-02-05 03:04:25 UTC) #10
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/a82ce4efc2cfa3812b96e22b5d3a68f915c7fbfb
Cr-Commit-Position: refs/heads/master@{#314728}

Powered by Google App Engine
This is Rietveld 408576698