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

Side by Side Diff: chrome/test/webdriver/commands/html5_location_commands.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, 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/test/webdriver/commands/html5_location_commands.h" 5 #include "chrome/test/webdriver/commands/html5_location_commands.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/test/webdriver/commands/response.h" 8 #include "chrome/test/webdriver/commands/response.h"
9 #include "chrome/test/webdriver/webdriver_error.h" 9 #include "chrome/test/webdriver/webdriver_error.h"
10 #include "chrome/test/webdriver/webdriver_session.h" 10 #include "chrome/test/webdriver/webdriver_session.h"
(...skipping 19 matching lines...) Expand all
30 scoped_ptr<base::DictionaryValue> geolocation; 30 scoped_ptr<base::DictionaryValue> geolocation;
31 Error* error = session_->GetGeolocation(&geolocation); 31 Error* error = session_->GetGeolocation(&geolocation);
32 if (error) { 32 if (error) {
33 response->SetError(error); 33 response->SetError(error);
34 return; 34 return;
35 } 35 }
36 response->SetValue(geolocation.release()); 36 response->SetValue(geolocation.release());
37 } 37 }
38 38
39 void HTML5LocationCommand::ExecutePost(Response* const response) { 39 void HTML5LocationCommand::ExecutePost(Response* const response) {
40 base::DictionaryValue* geolocation; 40 const base::DictionaryValue* geolocation;
41 if (!GetDictionaryParameter("location", &geolocation)) { 41 if (!GetDictionaryParameter("location", &geolocation)) {
42 response->SetError(new Error( 42 response->SetError(new Error(
43 kBadRequest, "Missing or invalid 'location'")); 43 kBadRequest, "Missing or invalid 'location'"));
44 return; 44 return;
45 } 45 }
46 Error* error = session_->OverrideGeolocation(geolocation); 46 Error* error = session_->OverrideGeolocation(geolocation);
47 if (error) 47 if (error)
48 response->SetError(error); 48 response->SetError(error);
49 } 49 }
50 50
51 } // namespace webdriver 51 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/commands/execute_command.cc ('k') | chrome/test/webdriver/commands/keys_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698