Check JSON value instead of error_code
Checking (result.error_code != JSON_NO_ERROR) is equivalent to checking result.value (which has a base::Optional type, convertible to bool). The error_code enum is really a private implementation detail. Callers don't care about it (other than it being an error or no error). Removing references (outside of //base/json) to that enum will let us more easily modify the //base/json implementation. Bug: 1070409 Change-Id: I54b8e787b5c1469efff77fda48d72a4d7251f7f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2147401Reviewed-by:Jia Meng <jiameng@chromium.org> Commit-Queue: Nigel Tao <nigeltao@chromium.org> Cr-Commit-Position: refs/heads/master@{#759060}
Showing
Please register or sign in to comment