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

Unified Diff: chrome/test/automation/automation_json_requests.cc

Issue 21030009: Make element removal methods in DictionaryValue and ListValue take scoped_ptr's as outparams. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 7 years, 4 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
Index: chrome/test/automation/automation_json_requests.cc
diff --git a/chrome/test/automation/automation_json_requests.cc b/chrome/test/automation/automation_json_requests.cc
index 28d24af7d50877f40bf768d6c5b117fcb5116592..4c0ad42580d675a012d65d89364e84b203c947e9 100644
--- a/chrome/test/automation/automation_json_requests.cc
+++ b/chrome/test/automation/automation_json_requests.cc
@@ -284,7 +284,7 @@ bool SendExecuteJavascriptJSONRequest(
const WebViewLocator& locator,
const std::string& frame_xpath,
const std::string& javascript,
- Value** result,
+ scoped_ptr<Value>* result,
Error* error) {
DictionaryValue dict;
dict.SetString("command", "ExecuteJavascript");
@@ -382,7 +382,7 @@ bool SendHeapProfilerDumpJSONRequestDeprecated(
bool SendGetCookiesJSONRequest(
AutomationMessageSender* sender,
const std::string& url,
- ListValue** cookies,
+ scoped_ptr<ListValue>* cookies,
Error* error) {
DictionaryValue dict;
dict.SetString("command", "GetCookies");
@@ -390,13 +390,12 @@ bool SendGetCookiesJSONRequest(
DictionaryValue reply_dict;
if (!SendAutomationJSONRequest(sender, dict, &reply_dict, error))
return false;
- Value* cookies_unscoped_value;
- if (!reply_dict.Remove("cookies", &cookies_unscoped_value))
+ scoped_ptr<Value> cookies_value;
+ if (!reply_dict.Remove("cookies", &cookies_value))
return false;
- scoped_ptr<Value> cookies_value(cookies_unscoped_value);
if (!cookies_value->IsType(Value::TYPE_LIST))
return false;
- *cookies = static_cast<ListValue*>(cookies_value.release());
+ cookies->reset(static_cast<ListValue*>(cookies_value.release()));
return true;
}
« no previous file with comments | « chrome/test/automation/automation_json_requests.h ('k') | chrome/test/webdriver/commands/cookie_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698