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

Unified Diff: chrome/test/webdriver/webdriver_session.cc

Issue 10834004: Correct const accessors in base/values.(h|cc) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Reverting webdriver:Command::parameters_ to const Created 8 years, 5 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/webdriver/webdriver_session.h ('k') | chromeos/dbus/flimflam_device_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/webdriver/webdriver_session.cc
diff --git a/chrome/test/webdriver/webdriver_session.cc b/chrome/test/webdriver/webdriver_session.cc
index ce0d2bed804aef7c3f8dd883d392a3306db13297..a47f90dbc1eb48f4f21965e0c4ae851e8a616faf 100644
--- a/chrome/test/webdriver/webdriver_session.cc
+++ b/chrome/test/webdriver/webdriver_session.cc
@@ -576,6 +576,9 @@ Error* Session::DeleteCookie(const std::string& url,
return error;
}
+// Note that when this is called from CookieCommand::ExecutePost then
+// |cookie_dict| is destroyed as soon as the caller finishes. Therefore
+// it is essential that RunSessionTask executes synchronously.
Error* Session::SetCookie(const std::string& url,
DictionaryValue* cookie_dict) {
Error* error = NULL;
@@ -1364,7 +1367,8 @@ Error* Session::RemoveStorageItem(StorageType type,
CreateDirectValueParser(value));
}
-Error* Session::GetGeolocation(scoped_ptr<base::DictionaryValue>* geolocation) {
+Error* Session::GetGeolocation(
+ scoped_ptr<base::DictionaryValue>* geolocation) {
Error* error = NULL;
RunSessionTask(base::Bind(
&Automation::GetGeolocation,
@@ -1374,7 +1378,7 @@ Error* Session::GetGeolocation(scoped_ptr<base::DictionaryValue>* geolocation) {
return error;
}
-Error* Session::OverrideGeolocation(base::DictionaryValue* geolocation) {
+Error* Session::OverrideGeolocation(const base::DictionaryValue* geolocation) {
Error* error = NULL;
RunSessionTask(base::Bind(
&Automation::OverrideGeolocation,
@@ -1431,6 +1435,7 @@ void Session::RunSessionTask(const base::Closure& task) {
base::Unretained(this),
task,
&done_event));
+ // See SetCookie for why it is essential that we wait here.
done_event.Wait();
}
« no previous file with comments | « chrome/test/webdriver/webdriver_session.h ('k') | chromeos/dbus/flimflam_device_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698