Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: chrome/test/chromedriver/chrome/network_conditions.cc

Issue 1124223012: Change JSONReader::ReadToValue to return a scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: chromedriver Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/chromedriver/chrome/mobile_device.cc ('k') | chrome/test/nacl/nacl_browsertest_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/chrome/network_conditions.cc
diff --git a/chrome/test/chromedriver/chrome/network_conditions.cc b/chrome/test/chromedriver/chrome/network_conditions.cc
index cea692162ed8d55ced1e145af3607c512829155b..99092568e975caf28442c8e714f9a4707ec6a11c 100644
--- a/chrome/test/chromedriver/chrome/network_conditions.cc
+++ b/chrome/test/chromedriver/chrome/network_conditions.cc
@@ -24,9 +24,8 @@ NetworkConditions::~NetworkConditions() {}
Status FindPresetNetwork(std::string network_name,
NetworkConditions* network_conditions) {
base::JSONReader json_reader(base::JSON_ALLOW_TRAILING_COMMAS);
- scoped_ptr<base::Value> networks_value;
- networks_value.reset(json_reader.ReadToValue(kNetworks));
- if (!networks_value.get())
+ scoped_ptr<base::Value> networks_value = json_reader.ReadToValue(kNetworks);
+ if (!networks_value)
return Status(kUnknownError,
"could not parse network list because " +
json_reader.GetErrorMessage());
@@ -38,7 +37,6 @@ Status FindPresetNetwork(std::string network_name,
for (base::ListValue::iterator it = networks->begin();
it != networks->end();
++it) {
-
base::DictionaryValue* network = NULL;
if (!(*it)->GetAsDictionary(&network)) {
return Status(kUnknownError,
« no previous file with comments | « chrome/test/chromedriver/chrome/mobile_device.cc ('k') | chrome/test/nacl/nacl_browsertest_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698