Skip to content
Commit ce50ad19 authored by Nigel Tao's avatar Nigel Tao Committed by Commit Bot
Browse files

Move JSONParser-specific enums out of JSONReader

JSONReader is the API. JSONParser is *an* implementation, and we would
like to experiment (in future commits) with different implementations
(crbug.com/1069271). Doing so is easier if they don't also have to match
exact error code values for invalid JSON input. In practice, API callers
don't care about the error code value (if less than 1000).

Also swap the order of the JSON_SYNTAX_ERROR and JSON_INVALID_ESCAPE
enum values so that JSON_SYNTAX_ERROR takes the enum value 1, the same
as the new kErrorCodeInvalidFormat enum value.

Also update a switch statement in
components/policy/core/common/config_dir_policy_loader.cc to also catch
JSON_TOO_LARGE, JSON_UNREPRESENTABLE_NUMBER and any future enums added.

Bug: 1069271
Bug: 1070409
Change-Id: I786c5d7ffc77e4d7927614a133bf1e7aae7eda5d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2251561


Reviewed-by: default avatarJochen Eisinger <jochen@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Commit-Queue: Nigel Tao <nigeltao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#780827}
parent 2a2e0272
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment