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

Issue 2475583002: Adds option for JSON reader to allow invalid utf characters (Closed)

Created:
4 years, 1 month ago by sky
Modified:
3 years, 7 months ago
Reviewers:
brettw, sabbakumov
CC:
chromium-reviews, tfarina
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Adds option for JSON reader to allow invalid utf characters This way reading in bookmarks files won't throw out everything if a bogus utf8 character was written. BUG=656115 TEST=covered by test R=brettw@chromium.org, stevenjb@chromium.org TBR=stevenjb@chromium.org Committed: https://crrev.com/cc7f72dcbc3953587ffe9706601f8d09e8d81481 Cr-Commit-Position: refs/heads/master@{#431433}

Patch Set 1 #

Patch Set 2 : includes #

Patch Set 3 : cleanup #

Patch Set 4 : cleanup #

Total comments: 4

Patch Set 5 : replace #

Total comments: 3

Patch Set 6 : unicode #

Total comments: 2

Patch Set 7 : remove dcheck #

Patch Set 8 : comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -55 lines) Patch
M base/json/json_file_value_serializer.h View 1 2 3 chunks +4 lines, -7 lines 0 comments Download
M base/json/json_file_value_serializer.cc View 1 2 2 chunks +4 lines, -7 lines 0 comments Download
M base/json/json_parser.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M base/json/json_parser.cc View 1 2 3 4 5 6 2 chunks +12 lines, -2 lines 0 comments Download
M base/json/json_parser_unittest.cc View 1 2 3 4 2 chunks +16 lines, -2 lines 0 comments Download
M base/json/json_reader.h View 1 2 3 4 5 6 7 1 chunk +5 lines, -0 lines 0 comments Download
M base/json/json_string_value_serializer.h View 1 2 2 chunks +5 lines, -8 lines 0 comments Download
M base/json/json_string_value_serializer.cc View 1 2 1 chunk +5 lines, -8 lines 0 comments Download
M base/json/json_value_serializer_unittest.cc View 1 2 3 chunks +10 lines, -8 lines 0 comments Download
M chrome/browser/ui/app_list/start_page_service.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M chromeos/network/onc/onc_test_utils.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M chromeos/network/onc/onc_utils_unittest.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M chromeos/tools/onc_validator/onc_validator.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M components/bookmarks/browser/bookmark_storage.cc View 1 2 3 4 2 chunks +5 lines, -1 line 0 comments Download
M components/omnibox/browser/search_suggestion_parser.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M components/policy/core/common/config_dir_policy_loader.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 49 (30 generated)
sky
https://codereview.chromium.org/2475583002/diff/60001/base/json/json_parser.cc File base/json/json_parser.cc (right): https://codereview.chromium.org/2475583002/diff/60001/base/json/json_parser.cc#newcode629 base/json/json_parser.cc:629: const int start_index = index_; It may be possible ...
4 years, 1 month ago (2016-11-03 19:14:14 UTC) #11
brettw
https://codereview.chromium.org/2475583002/diff/60001/base/json/json_parser.cc File base/json/json_parser.cc (right): https://codereview.chromium.org/2475583002/diff/60001/base/json/json_parser.cc#newcode639 base/json/json_parser.cc:639: memcpy(&invalid_string.front(), pos_, index_ - start_index); Personally, I would prefer ...
4 years, 1 month ago (2016-11-04 23:17:13 UTC) #12
sky
https://codereview.chromium.org/2475583002/diff/60001/base/json/json_parser.cc File base/json/json_parser.cc (right): https://codereview.chromium.org/2475583002/diff/60001/base/json/json_parser.cc#newcode639 base/json/json_parser.cc:639: memcpy(&invalid_string.front(), pos_, index_ - start_index); On 2016/11/04 23:17:13, brettw ...
4 years, 1 month ago (2016-11-08 01:02:20 UTC) #14
brettw
https://codereview.chromium.org/2475583002/diff/80001/base/json/json_parser.cc File base/json/json_parser.cc (right): https://codereview.chromium.org/2475583002/diff/80001/base/json/json_parser.cc#newcode191 base/json/json_parser.cc:191: const char kUnicodeReplacementString[] = "\xFF\xDF"; I'm not sure where ...
4 years, 1 month ago (2016-11-08 19:21:19 UTC) #18
brettw
https://codereview.chromium.org/2475583002/diff/80001/base/json/json_parser.cc File base/json/json_parser.cc (right): https://codereview.chromium.org/2475583002/diff/80001/base/json/json_parser.cc#newcode191 base/json/json_parser.cc:191: const char kUnicodeReplacementString[] = "\xFF\xDF"; On 2016/11/08 19:21:19, brettw ...
4 years, 1 month ago (2016-11-08 20:26:56 UTC) #19
sky
https://codereview.chromium.org/2475583002/diff/80001/base/json/json_parser.cc File base/json/json_parser.cc (right): https://codereview.chromium.org/2475583002/diff/80001/base/json/json_parser.cc#newcode191 base/json/json_parser.cc:191: const char kUnicodeReplacementString[] = "\xFF\xDF"; On 2016/11/08 20:26:56, brettw ...
4 years, 1 month ago (2016-11-08 23:55:36 UTC) #20
sky
As discussed I removed the DCHECK.
4 years, 1 month ago (2016-11-10 19:22:53 UTC) #26
brettw
lgtm https://codereview.chromium.org/2475583002/diff/100001/base/json/json_reader.h File base/json/json_reader.h (right): https://codereview.chromium.org/2475583002/diff/100001/base/json/json_reader.h#newcode60 base/json/json_reader.h:60: // kUnicodeReplacementString. If not set, invalid characters trigger ...
4 years, 1 month ago (2016-11-10 20:35:40 UTC) #30
sky
https://codereview.chromium.org/2475583002/diff/100001/base/json/json_reader.h File base/json/json_reader.h (right): https://codereview.chromium.org/2475583002/diff/100001/base/json/json_reader.h#newcode60 base/json/json_reader.h:60: // kUnicodeReplacementString. If not set, invalid characters trigger a ...
4 years, 1 month ago (2016-11-10 23:01:48 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2475583002/140001
4 years, 1 month ago (2016-11-10 23:03:09 UTC) #34
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/301810)
4 years, 1 month ago (2016-11-10 23:14:50 UTC) #36
sky
TBR stevenjb for changes in chromeos
4 years, 1 month ago (2016-11-10 23:29:58 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2475583002/140001
4 years, 1 month ago (2016-11-10 23:30:46 UTC) #40
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 1 month ago (2016-11-11 01:13:31 UTC) #42
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/cc7f72dcbc3953587ffe9706601f8d09e8d81481 Cr-Commit-Position: refs/heads/master@{#431433}
4 years, 1 month ago (2016-11-11 01:18:26 UTC) #44
sabbakumov
It's stated https://cs.chromium.org/chromium/src/base/json/string_escape.h?sq&l=17 that the JSONWriter should already escape bad unicode symbols. Why does that ...
3 years, 7 months ago (2017-05-23 13:47:56 UTC) #46
sky
On 2017/05/23 13:47:56, sabbakumov wrote: > It's stated > https://cs.chromium.org/chromium/src/base/json/string_escape.h?sq&l=17 that the > JSONWriter should ...
3 years, 7 months ago (2017-05-23 16:44:27 UTC) #47
sabbakumov
On 2017/05/23 16:44:27, sky wrote: > On 2017/05/23 13:47:56, sabbakumov wrote: > > It's stated ...
3 years, 7 months ago (2017-05-24 05:32:07 UTC) #48
sky
3 years, 7 months ago (2017-05-24 16:51:03 UTC) #49
Message was sent while issue was closed.
At this point folks could have the bogus utf in their bookmarks file. So,
we need to ensure we don't drop all the bookmarks in that case.

On Tue, May 23, 2017 at 10:32 PM, <sabbakumov@yandex-team.ru> wrote:

> On 2017/05/23 16:44:27, sky wrote:
> > On 2017/05/23 13:47:56, sabbakumov wrote:
> > > It's stated
> > > https://cs.chromium.org/chromium/src/base/json/string_escape.h?sq&l=17
> that
> > the
> > > JSONWriter should already escape bad unicode symbols. Why does that fix
> work?
> >
> > Maybe that was changing after this patch?
>
> I've made a patch https://codereview.chromium.org/2903773003/. It replaces
> invalid
> Unicode code points when you use JSONWriter, so probably this patch is no
> longer
> needed except cases where JSON to be loaded isn't made by us.
>
> https://codereview.chromium.org/2475583002/
>

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698