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

Issue 1214903010: Make JSONParser a pure interface. (Closed)

Created:
5 years, 5 months ago by Bernhard Bauer
Modified:
5 years, 5 months ago
CC:
chromium-reviews, tapted, Matt Giuca, extensions-reviews_chromium.org, tfarina, pam+watch_chromium.org, chromium-apps-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make JSONParser a pure interface. This allows stubbing it out in tests, and using platform-specific implementations in the future. As a side effect, the fact that the default implementation is refcounted is not exposed to clients anymore. Instead, the (newly added) factory method returns a raw pointer, and the object will delete itself after either of the callbacks has been called. In practice, this should not make a difference, as no client currently requires the SafeJsonParser to live longer than that, and in one case it actually simplifies things for the client by breaking a reference cycle. TBR=benwells@chromium.org,brettw@chromium.org BUG=501333 Committed: https://crrev.com/64c5a3888f21acf96082e89764e5ee66cc3531b6 Cr-Commit-Position: refs/heads/master@{#337459}

Patch Set 1 #

Patch Set 2 : fix GN #

Patch Set 3 : cleanup #

Patch Set 4 : nullptr #

Total comments: 4

Patch Set 5 : review #

Patch Set 6 : review #

Total comments: 13

Patch Set 7 : review #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+253 lines, -264 lines) Patch
M chrome/browser/extensions/api/management/chrome_management_api_delegate.cc View 1 2 3 4 1 chunk +10 lines, -12 lines 0 comments Download
M chrome/browser/extensions/webstore_data_fetcher.cc View 1 2 3 4 5 6 1 chunk +4 lines, -6 lines 0 comments Download
M chrome/browser/extensions/webstore_install_helper.h View 1 2 3 4 5 6 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/extensions/webstore_install_helper.cc View 1 2 3 4 5 6 3 chunks +3 lines, -15 lines 0 comments Download
M chrome/browser/safe_json_parser_browsertest.cc View 1 2 3 4 1 chunk +1 line, -3 lines 0 comments Download
M chrome/browser/supervised_user/supervised_user_site_list.h View 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/browser/supervised_user/supervised_user_site_list.cc View 1 2 3 4 3 chunks +6 lines, -27 lines 0 comments Download
M chrome/browser/supervised_user/supervised_user_whitelist_service_unittest.cc View 3 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/ui/app_list/search/common/json_response_fetcher.cc View 1 2 3 4 1 chunk +5 lines, -7 lines 0 comments Download
M chrome/browser/web_resource/chrome_web_resource_service.cc View 1 2 3 4 1 chunk +1 line, -5 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M components/safe_json.gypi View 1 2 3 4 5 1 chunk +17 lines, -0 lines 0 comments Download
M components/safe_json/BUILD.gn View 1 2 3 4 5 2 chunks +17 lines, -0 lines 3 comments Download
M components/safe_json/safe_json_parser.h View 1 2 3 4 5 6 1 chunk +21 lines, -38 lines 0 comments Download
M components/safe_json/safe_json_parser.cc View 1 2 3 4 5 1 chunk +16 lines, -87 lines 0 comments Download
A + components/safe_json/safe_json_parser_impl.h View 1 2 3 4 5 6 3 chunks +17 lines, -21 lines 0 comments Download
A + components/safe_json/safe_json_parser_impl.cc View 1 2 3 4 5 6 6 chunks +24 lines, -31 lines 0 comments Download
A components/safe_json/testing_json_parser.h View 1 2 3 4 5 6 1 chunk +48 lines, -0 lines 0 comments Download
A components/safe_json/testing_json_parser.cc View 1 chunk +58 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (6 generated)
Bernhard Bauer
Please review.
5 years, 5 months ago (2015-07-01 10:16:05 UTC) #2
Robert Sesek
https://codereview.chromium.org/1214903010/diff/60001/components/safe_json/safe_json_parser.h File components/safe_json/safe_json_parser.h (right): https://codereview.chromium.org/1214903010/diff/60001/components/safe_json/safe_json_parser.h#newcode33 components/safe_json/safe_json_parser.h:33: static SafeJsonParser* Create(const std::string& unsafe_json, At minium, ditto the ...
5 years, 5 months ago (2015-07-01 22:19:04 UTC) #3
Bernhard Bauer
https://codereview.chromium.org/1214903010/diff/60001/components/safe_json/safe_json_parser.h File components/safe_json/safe_json_parser.h (right): https://codereview.chromium.org/1214903010/diff/60001/components/safe_json/safe_json_parser.h#newcode33 components/safe_json/safe_json_parser.h:33: static SafeJsonParser* Create(const std::string& unsafe_json, On 2015/07/01 22:19:04, Robert ...
5 years, 5 months ago (2015-07-02 14:16:01 UTC) #4
Robert Sesek
https://codereview.chromium.org/1214903010/diff/100001/chrome/browser/extensions/webstore_install_helper.h File chrome/browser/extensions/webstore_install_helper.h (right): https://codereview.chromium.org/1214903010/diff/100001/chrome/browser/extensions/webstore_install_helper.h#newcode99 chrome/browser/extensions/webstore_install_helper.h:99: bool started_; Needs a comment (and maybe a more ...
5 years, 5 months ago (2015-07-02 17:28:19 UTC) #5
Bernhard Bauer
https://codereview.chromium.org/1214903010/diff/100001/chrome/browser/extensions/webstore_install_helper.h File chrome/browser/extensions/webstore_install_helper.h (right): https://codereview.chromium.org/1214903010/diff/100001/chrome/browser/extensions/webstore_install_helper.h#newcode99 chrome/browser/extensions/webstore_install_helper.h:99: bool started_; On 2015/07/02 17:28:19, Robert Sesek wrote: > ...
5 years, 5 months ago (2015-07-02 22:38:24 UTC) #6
Robert Sesek
LGTM https://codereview.chromium.org/1214903010/diff/100001/components/safe_json/safe_json_parser.cc File components/safe_json/safe_json_parser.cc (right): https://codereview.chromium.org/1214903010/diff/100001/components/safe_json/safe_json_parser.cc#newcode28 components/safe_json/safe_json_parser.cc:28: : new SafeJsonParserImpl(unsafe_json, success_callback, On 2015/07/02 22:38:23, Bernhard ...
5 years, 5 months ago (2015-07-06 17:31:35 UTC) #7
Bernhard Bauer
Adding OWNERS TBR (Ben for extensions and app_list, Brett for remaining files): Build file changes ...
5 years, 5 months ago (2015-07-06 18:16:12 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1214903010/120001
5 years, 5 months ago (2015-07-06 18:18:48 UTC) #14
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 5 months ago (2015-07-06 20:09:03 UTC) #15
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/64c5a3888f21acf96082e89764e5ee66cc3531b6 Cr-Commit-Position: refs/heads/master@{#337459}
5 years, 5 months ago (2015-07-06 20:11:26 UTC) #16
benwells
nice change, lgtm
5 years, 5 months ago (2015-07-07 00:53:55 UTC) #17
brettw
I noticed some problems with this component (not added in this patch). Can an appropriate ...
5 years, 5 months ago (2015-07-07 22:17:21 UTC) #18
Bernhard Bauer
5 years, 5 months ago (2015-07-08 07:53:48 UTC) #19
Message was sent while issue was closed.
On 2015/07/07 22:17:21, brettw wrote:
> I noticed some problems with this component (not added in this patch). Can an
> appropriate person take a look?

Doing a followup in https://codereview.chromium.org/1211423004/.

FWIW, there are a *lot* of static_library targets in existing BUILD.gn files. Is
there a plan to a) get rid of all of them, and b) prevent hapless authors from
adding more?

Powered by Google App Engine
This is Rietveld 408576698