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

Unified Diff: chrome/test/nacl/nacl_browsertest_util.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/network_conditions.cc ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/nacl/nacl_browsertest_util.cc
diff --git a/chrome/test/nacl/nacl_browsertest_util.cc b/chrome/test/nacl/nacl_browsertest_util.cc
index 7d63c84a3a28e554e9c39b76906f80a522f43226..bd79bdf94d685cd3b620488cf92f6e8b0e1da1ec 100644
--- a/chrome/test/nacl/nacl_browsertest_util.cc
+++ b/chrome/test/nacl/nacl_browsertest_util.cc
@@ -24,12 +24,11 @@ typedef content::TestMessageHandler::MessageResponse MessageResponse;
MessageResponse StructuredMessageHandler::HandleMessage(
const std::string& json) {
- scoped_ptr<base::Value> value;
base::JSONReader reader(base::JSON_ALLOW_TRAILING_COMMAS);
// Automation messages are stringified before they are sent because the
// automation channel cannot handle arbitrary objects. This means we
// need to decode the json twice to get the original message.
- value.reset(reader.ReadToValue(json));
+ scoped_ptr<base::Value> value = reader.ReadToValue(json);
if (!value.get())
return InternalError("Could parse automation JSON: " + json +
" because " + reader.GetErrorMessage());
@@ -38,7 +37,7 @@ MessageResponse StructuredMessageHandler::HandleMessage(
if (!value->GetAsString(&temp))
return InternalError("Message was not a string: " + json);
- value.reset(reader.ReadToValue(temp));
+ value = reader.ReadToValue(temp);
if (!value.get())
return InternalError("Could not parse message JSON: " + temp +
" because " + reader.GetErrorMessage());
« no previous file with comments | « chrome/test/chromedriver/chrome/network_conditions.cc ('k') | content/public/test/browser_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698