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

Issue 2031603002: In PopularSites, parse (not sanitize) JSON safely. (Closed)

Created:
4 years, 6 months ago by sfiera
Modified:
4 years, 6 months ago
Reviewers:
Marc Treib
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

In PopularSites, parse (not sanitize) JSON safely. All that JSON sanitization does is to parse it safely and then reserialize it. For supporting unsafe JSON on iOS, it makes more sense to me to inject a JSON parser (as we do in ntp_snippets), rather than a JSON sanitizer. Then, we do the reserialization ourselves. (this doesn't yet make the parser injectable) BUG=603026 Committed: https://crrev.com/da97c63efbc08e4056c686e9ad6db8393749d9f7 Cr-Commit-Position: refs/heads/master@{#397394}

Patch Set 1 #

Total comments: 10

Patch Set 2 : #

Total comments: 10

Patch Set 3 : #

Total comments: 6

Patch Set 4 : #

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+69 lines, -65 lines) Patch
M chrome/browser/android/ntp/popular_sites.h View 1 2 3 4 2 chunks +8 lines, -5 lines 0 comments Download
M chrome/browser/android/ntp/popular_sites.cc View 1 2 3 4 6 chunks +61 lines, -60 lines 0 comments Download

Messages

Total messages: 29 (11 generated)
sfiera
4 years, 6 months ago (2016-06-01 16:09:58 UTC) #3
Marc Treib
https://codereview.chromium.org/2031603002/diff/1/chrome/browser/android/ntp/popular_sites.cc File chrome/browser/android/ntp/popular_sites.cc (right): https://codereview.chromium.org/2031603002/diff/1/chrome/browser/android/ntp/popular_sites.cc#newcode129 chrome/browser/android/ntp/popular_sites.cc:129: std::unique_ptr<std::vector<PopularSites::Site>> UnmarshalJson( IMO "unmarshal" isn't the right term here ...
4 years, 6 months ago (2016-06-02 08:32:11 UTC) #4
sfiera
Not about the review, but... https://codereview.chromium.org/2031603002/diff/1/chrome/browser/android/ntp/popular_sites.cc File chrome/browser/android/ntp/popular_sites.cc (right): https://codereview.chromium.org/2031603002/diff/1/chrome/browser/android/ntp/popular_sites.cc#newcode411 chrome/browser/android/ntp/popular_sites.cc:411: callback_.Run(!!sites); Whoa, wait, shouldn't ...
4 years, 6 months ago (2016-06-02 08:49:28 UTC) #5
sfiera
https://codereview.chromium.org/2031603002/diff/1/chrome/browser/android/ntp/popular_sites.cc File chrome/browser/android/ntp/popular_sites.cc (right): https://codereview.chromium.org/2031603002/diff/1/chrome/browser/android/ntp/popular_sites.cc#newcode129 chrome/browser/android/ntp/popular_sites.cc:129: std::unique_ptr<std::vector<PopularSites::Site>> UnmarshalJson( On 2016/06/02 08:32:11, Marc Treib wrote: > ...
4 years, 6 months ago (2016-06-02 11:08:00 UTC) #6
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2031603002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2031603002/20001
4 years, 6 months ago (2016-06-02 11:08:17 UTC) #8
Marc Treib
https://codereview.chromium.org/2031603002/diff/20001/chrome/browser/android/ntp/popular_sites.cc File chrome/browser/android/ntp/popular_sites.cc (right): https://codereview.chromium.org/2031603002/diff/20001/chrome/browser/android/ntp/popular_sites.cc#newcode130 chrome/browser/android/ntp/popular_sites.cc:130: bool WriteJson(const base::FilePath& local_path, const base::Value* json) { nit: ...
4 years, 6 months ago (2016-06-02 11:39:55 UTC) #9
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-02 11:52:36 UTC) #11
sfiera
https://codereview.chromium.org/2031603002/diff/20001/chrome/browser/android/ntp/popular_sites.cc File chrome/browser/android/ntp/popular_sites.cc (right): https://codereview.chromium.org/2031603002/diff/20001/chrome/browser/android/ntp/popular_sites.cc#newcode130 chrome/browser/android/ntp/popular_sites.cc:130: bool WriteJson(const base::FilePath& local_path, const base::Value* json) { On ...
4 years, 6 months ago (2016-06-02 12:44:19 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2031603002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2031603002/40001
4 years, 6 months ago (2016-06-02 12:44:37 UTC) #14
Marc Treib
https://codereview.chromium.org/2031603002/diff/20001/chrome/browser/android/ntp/popular_sites.cc File chrome/browser/android/ntp/popular_sites.cc (right): https://codereview.chromium.org/2031603002/diff/20001/chrome/browser/android/ntp/popular_sites.cc#newcode293 chrome/browser/android/ntp/popular_sites.cc:293: safe_json::SafeJsonParser::Parse( On 2016/06/02 12:44:19, sfiera wrote: > On 2016/06/02 ...
4 years, 6 months ago (2016-06-02 13:00:39 UTC) #15
sfiera
https://codereview.chromium.org/2031603002/diff/40001/chrome/browser/android/ntp/popular_sites.cc File chrome/browser/android/ntp/popular_sites.cc (right): https://codereview.chromium.org/2031603002/diff/40001/chrome/browser/android/ntp/popular_sites.cc#newcode297 chrome/browser/android/ntp/popular_sites.cc:297: base::PostTaskAndReplyWithResult( On 2016/06/02 13:00:39, Marc Treib wrote: > The ...
4 years, 6 months ago (2016-06-02 13:12:11 UTC) #16
Marc Treib
LGTM, thanks! (I'll leave it up to you whether to move ParseJson to the UI ...
4 years, 6 months ago (2016-06-02 13:25:20 UTC) #17
sfiera
https://codereview.chromium.org/2031603002/diff/40001/chrome/browser/android/ntp/popular_sites.cc File chrome/browser/android/ntp/popular_sites.cc (right): https://codereview.chromium.org/2031603002/diff/40001/chrome/browser/android/ntp/popular_sites.cc#newcode297 chrome/browser/android/ntp/popular_sites.cc:297: base::PostTaskAndReplyWithResult( On 2016/06/02 13:25:20, Marc Treib wrote: > On ...
4 years, 6 months ago (2016-06-02 13:31:05 UTC) #18
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2031603002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2031603002/80001
4 years, 6 months ago (2016-06-02 13:32:17 UTC) #20
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-02 14:23:35 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2031603002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2031603002/80001
4 years, 6 months ago (2016-06-02 14:25:11 UTC) #25
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 6 months ago (2016-06-02 14:29:41 UTC) #27
commit-bot: I haz the power
4 years, 6 months ago (2016-06-02 14:31:06 UTC) #29
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/da97c63efbc08e4056c686e9ad6db8393749d9f7
Cr-Commit-Position: refs/heads/master@{#397394}

Powered by Google App Engine
This is Rietveld 408576698