summaryrefslogtreecommitdiffstats
path: root/chromeos/network
diff options
context:
space:
mode:
authorestade <estade@chromium.org>2015-05-22 09:30:13 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-22 16:30:52 +0000
commitb09312bb5ad1bffaad8a09deea395f1aef2053df (patch)
treeea13602ed858503180cd725d1afe6a4ce73a2bd9 /chromeos/network
parent2d381b0799c9fbbd33fbfa5ccf6610794d454f71 (diff)
downloadchromium_src-b09312bb5ad1bffaad8a09deea395f1aef2053df.zip
chromium_src-b09312bb5ad1bffaad8a09deea395f1aef2053df.tar.gz
chromium_src-b09312bb5ad1bffaad8a09deea395f1aef2053df.tar.bz2
Use scoped_ptrs in JSONReader::Read functions.
There are many callers, so all could not be updated at once. The old version is renamed to JSONReader::DeprecatedRead, and a new version of JSONReader::Read that returns scoped_ptr takes its place. Much of this patch was generated with sed. Some callsites of the form scoped_ptr<Value> value(Read()); have been updated to scoped_ptr<Value> value = Read(); but most Read() calls are simply converted to DeprecatedRead. Actually updating them is a TODO. BUG=none Review URL: https://codereview.chromium.org/1136643005 Cr-Commit-Position: refs/heads/master@{#331120}
Diffstat (limited to 'chromeos/network')
-rw-r--r--chromeos/network/auto_connect_handler_unittest.cc7
-rw-r--r--chromeos/network/client_cert_resolver_unittest.cc5
-rw-r--r--chromeos/network/network_connection_handler_unittest.cc6
-rw-r--r--chromeos/network/onc/onc_translator_shill_to_onc.cc2
-rw-r--r--chromeos/network/onc/onc_utils.cc2
5 files changed, 12 insertions, 10 deletions
diff --git a/chromeos/network/auto_connect_handler_unittest.cc b/chromeos/network/auto_connect_handler_unittest.cc
index c3f7c2d..a52f60e 100644
--- a/chromeos/network/auto_connect_handler_unittest.cc
+++ b/chromeos/network/auto_connect_handler_unittest.cc
@@ -214,9 +214,10 @@ class AutoConnectHandlerTest : public testing::Test {
scoped_ptr<base::ListValue> network_configs(new base::ListValue);
if (!network_configs_json.empty()) {
std::string error;
- base::Value* network_configs_value = base::JSONReader::ReadAndReturnError(
- network_configs_json, base::JSON_ALLOW_TRAILING_COMMAS, nullptr,
- &error);
+ base::Value* network_configs_value =
+ base::JSONReader::DeprecatedReadAndReturnError(
+ network_configs_json, base::JSON_ALLOW_TRAILING_COMMAS, nullptr,
+ &error);
ASSERT_TRUE(network_configs_value) << error;
base::ListValue* network_configs_list = nullptr;
ASSERT_TRUE(network_configs_value->GetAsList(&network_configs_list));
diff --git a/chromeos/network/client_cert_resolver_unittest.cc b/chromeos/network/client_cert_resolver_unittest.cc
index 0604972..fb04d94 100644
--- a/chromeos/network/client_cert_resolver_unittest.cc
+++ b/chromeos/network/client_cert_resolver_unittest.cc
@@ -198,8 +198,9 @@ class ClientCertResolverTest : public testing::Test,
base::StringPrintf(kTestPolicyTemplate, test_ca_cert_pem_.c_str());
std::string error;
- scoped_ptr<base::Value> policy_value(base::JSONReader::ReadAndReturnError(
- policy_json, base::JSON_ALLOW_TRAILING_COMMAS, NULL, &error));
+ scoped_ptr<base::Value> policy_value(
+ base::JSONReader::DeprecatedReadAndReturnError(
+ policy_json, base::JSON_ALLOW_TRAILING_COMMAS, NULL, &error));
ASSERT_TRUE(policy_value) << error;
base::ListValue* policy = NULL;
diff --git a/chromeos/network/network_connection_handler_unittest.cc b/chromeos/network/network_connection_handler_unittest.cc
index 9efff32..c36cb1e 100644
--- a/chromeos/network/network_connection_handler_unittest.cc
+++ b/chromeos/network/network_connection_handler_unittest.cc
@@ -275,9 +275,9 @@ class NetworkConnectionHandlerTest : public testing::Test {
bool user_policy) {
std::string error;
scoped_ptr<base::Value> network_configs_value(
- base::JSONReader::ReadAndReturnError(network_configs_json,
- base::JSON_ALLOW_TRAILING_COMMAS,
- nullptr, &error));
+ base::JSONReader::DeprecatedReadAndReturnError(
+ network_configs_json, base::JSON_ALLOW_TRAILING_COMMAS, nullptr,
+ &error));
ASSERT_TRUE(network_configs_value) << error;
base::ListValue* network_configs = nullptr;
diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc
index aca9133..aca2df0 100644
--- a/chromeos/network/onc/onc_translator_shill_to_onc.cc
+++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc
@@ -34,7 +34,7 @@ scoped_ptr<base::Value> ConvertStringToValue(const std::string& str,
if (type == base::Value::TYPE_STRING) {
value = new base::StringValue(str);
} else {
- value = base::JSONReader::Read(str);
+ value = base::JSONReader::DeprecatedRead(str);
}
if (value == NULL || value->GetType() != type) {
diff --git a/chromeos/network/onc/onc_utils.cc b/chromeos/network/onc/onc_utils.cc
index 8749d5a..2123272 100644
--- a/chromeos/network/onc/onc_utils.cc
+++ b/chromeos/network/onc/onc_utils.cc
@@ -42,7 +42,7 @@ const char kEmptyUnencryptedConfiguration[] =
scoped_ptr<base::DictionaryValue> ReadDictionaryFromJson(
const std::string& json) {
std::string error;
- base::Value* root = base::JSONReader::ReadAndReturnError(
+ base::Value* root = base::JSONReader::DeprecatedReadAndReturnError(
json, base::JSON_ALLOW_TRAILING_COMMAS, nullptr, &error);
base::DictionaryValue* dict_ptr = nullptr;