Commit d5267478 authored by Nigel Tao's avatar Nigel Tao Committed by Commit Bot

Upgrade extensions from deprecated base::JSONReader API

Bug: 1070409
Change-Id: I239951e64680698954f97583255382227c2bde3c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2228631Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Commit-Queue: Nigel Tao <nigeltao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#775051}
parent eb0cfff6
...@@ -68,8 +68,8 @@ class BackgroundHeaderTest : public ExtensionBrowserTest { ...@@ -68,8 +68,8 @@ class BackgroundHeaderTest : public ExtensionBrowserTest {
content::JsReplace("executeFetch($1);", url)); content::JsReplace("executeFetch($1);", url));
std::string json; std::string json;
EXPECT_TRUE(message_queue.WaitForMessage(&json)); EXPECT_TRUE(message_queue.WaitForMessage(&json));
base::JSONReader reader(base::JSON_ALLOW_TRAILING_COMMAS); base::Optional<base::Value> value =
base::Optional<base::Value> value = reader.ReadToValue(json); base::JSONReader::Read(json, base::JSON_ALLOW_TRAILING_COMMAS);
std::string result; std::string result;
if (!value) { if (!value) {
ADD_FAILURE() << "Received invalid response: " << json; ADD_FAILURE() << "Received invalid response: " << json;
......
...@@ -102,7 +102,7 @@ ValueStore::Status LazyLevelDb::Read(const std::string& key, ...@@ -102,7 +102,7 @@ ValueStore::Status LazyLevelDb::Read(const std::string& key,
return ToValueStoreError(s); return ToValueStoreError(s);
base::Optional<base::Value> read_value = base::Optional<base::Value> read_value =
base::JSONReader().ReadToValue(value_as_json); base::JSONReader::Read(value_as_json);
if (!read_value) { if (!read_value) {
return ValueStore::Status(ValueStore::CORRUPTION, FixCorruption(&key), return ValueStore::Status(ValueStore::CORRUPTION, FixCorruption(&key),
kInvalidJson); kInvalidJson);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment