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: I1e026b4b8e1544823b07ce2c6da9f5bd56f6c708 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2145750Reviewed-by:Ahmed Fakhry <afakhry@chromium.org> Commit-Queue: Nigel Tao <nigeltao@chromium.org> Cr-Commit-Position: refs/heads/master@{#759056}
Showing
Please register or sign in to comment