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

Unified Diff: content/browser/geolocation/network_location_request.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 | « cloud_print/service/service_state.cc ('k') | content/browser/speech/google_one_shot_remote_engine.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/geolocation/network_location_request.cc
diff --git a/content/browser/geolocation/network_location_request.cc b/content/browser/geolocation/network_location_request.cc
index 145bba596f5832224e33ddcd654c627b549a785c..c0913711ebbded18d73f73adfedb872ad49edd95 100644
--- a/content/browser/geolocation/network_location_request.cc
+++ b/content/browser/geolocation/network_location_request.cc
@@ -293,7 +293,7 @@ bool GetAsDouble(const DictionaryValue& object,
const std::string& property_name,
double* out) {
DCHECK(out);
- Value* value = NULL;
+ const Value* value = NULL;
if (!object.Get(property_name, &value))
return false;
int value_as_int;
@@ -340,7 +340,7 @@ bool ParseServerResponse(const std::string& response_body,
static_cast<DictionaryValue*>(response_value.get());
// Check the status code.
- Value* status_value = NULL;
+ const Value* status_value = NULL;
if (!response_object->Get(kStatusString, &status_value)) {
VLOG(1) << "ParseServerResponse() : Missing status attribute.";
// The status attribute is required.
@@ -354,7 +354,8 @@ bool ParseServerResponse(const std::string& response_body,
// The status attribute is required to be a string.
return false;
}
- StringValue* status_object = static_cast<StringValue*>(status_value);
+ const StringValue* status_object =
+ static_cast<const StringValue*>(status_value);
std::string status;
if (!status_object->GetAsString(&status)) {
@@ -372,7 +373,7 @@ bool ParseServerResponse(const std::string& response_body,
response_object->GetString(kAccessTokenString, access_token);
// Get the location
- Value* location_value = NULL;
+ const Value* location_value = NULL;
if (!response_object->Get(kLocationString, &location_value)) {
VLOG(1) << "ParseServerResponse() : Missing location attribute.";
// GLS returns a response with no location property to represent
@@ -391,8 +392,8 @@ bool ParseServerResponse(const std::string& response_body,
}
return true; // Successfully parsed response containing no fix.
}
- DictionaryValue* location_object =
- static_cast<DictionaryValue*>(location_value);
+ const DictionaryValue* location_object =
+ static_cast<const DictionaryValue*>(location_value);
// latitude and longitude fields are always required.
double latitude, longitude;
« no previous file with comments | « cloud_print/service/service_state.cc ('k') | content/browser/speech/google_one_shot_remote_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698