diff options
author | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-07 15:40:14 +0000 |
---|---|---|
committer | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-07 15:40:14 +0000 |
commit | ba020f959d7acdc1361d8148e77d2f4f855a667c (patch) | |
tree | afd5cc977d67dd9997cf5262b16fed04e3e4d8f0 /chrome/browser/geolocation/network_location_request.cc | |
parent | 3f4b2c10471c1d4a8202ba63e27438accf9548e6 (diff) | |
download | chromium_src-ba020f959d7acdc1361d8148e77d2f4f855a667c.zip chromium_src-ba020f959d7acdc1361d8148e77d2f4f855a667c.tar.gz chromium_src-ba020f959d7acdc1361d8148e77d2f4f855a667c.tar.bz2 |
Some simplifications, as a pre-step to http://crbug.com/40103
- simplify the y geolocation IPC protocol, by using the error code already in Geoposition
- convert Geoposition's error_message to UTF8 as this is easier alround
- simplify the dispatcher host render id set (as the process_id part is implicit from the dispatcher host instance)
BUG=40103
TEST=unit_tests --gtest_filter=*Geol*
Review URL: http://codereview.chromium.org/2648002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49060 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/geolocation/network_location_request.cc')
-rw-r--r-- | chrome/browser/geolocation/network_location_request.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/chrome/browser/geolocation/network_location_request.cc b/chrome/browser/geolocation/network_location_request.cc index 54018af..c278b74 100644 --- a/chrome/browser/geolocation/network_location_request.cc +++ b/chrome/browser/geolocation/network_location_request.cc @@ -170,14 +170,14 @@ void FormRequestBody(const std::string& host_name, } void FormatPositionError(const GURL& server_url, - const std::wstring& message, + const std::string& message, Geoposition* position) { position->error_code = Geoposition::ERROR_CODE_POSITION_UNAVAILABLE; - position->error_message = L"Network location provider at '"; - position->error_message += ASCIIToWide(server_url.possibly_invalid_spec()); - position->error_message += L"' : "; + position->error_message = "Network location provider at '"; + position->error_message += server_url.possibly_invalid_spec(); + position->error_message += "' : "; position->error_message += message; - position->error_message += L"."; + position->error_message += "."; LOG(INFO) << "NetworkLocationRequest::GetLocationFromResponse() : " << position->error_message; } @@ -195,12 +195,12 @@ void GetLocationFromResponse(bool http_post_result, // HttpPost can fail for a number of reasons. Most likely this is because // we're offline, or there was no response. if (!http_post_result) { - FormatPositionError(server_url, L"No response received", position); + FormatPositionError(server_url, "No response received", position); return; } if (status_code != 200) { // HTTP OK. - std::wstring message = L"Returned error code "; - message += IntToWString(status_code); + std::string message = "Returned error code "; + message += IntToString(status_code); FormatPositionError(server_url, message, position); return; } @@ -208,14 +208,14 @@ void GetLocationFromResponse(bool http_post_result, // this position fix. if (!ParseServerResponse(response_body, timestamp, position, access_token)) { // We failed to parse the repsonse. - FormatPositionError(server_url, L"Response was malformed", position); + FormatPositionError(server_url, "Response was malformed", position); return; } // The response was successfully parsed, but it may not be a valid // position fix. if (!position->IsValidFix()) { FormatPositionError(server_url, - L"Did not provide a good position fix", position); + "Did not provide a good position fix", position); return; } } |