diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-24 18:18:34 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-24 18:18:34 +0000 |
commit | c530c85aa67a10aac9a77d10970951633ff686d9 (patch) | |
tree | 5b0943bd7369f48053075a75db9cf6e5a0d1514d /content/browser | |
parent | b4c95f61571c24ea1fc15fed0eda1269fe75d94b (diff) | |
download | chromium_src-c530c85aa67a10aac9a77d10970951633ff686d9.zip chromium_src-c530c85aa67a10aac9a77d10970951633ff686d9.tar.gz chromium_src-c530c85aa67a10aac9a77d10970951633ff686d9.tar.bz2 |
Convert URLFetcher::Delegates to use an interface in content/public/common. Also remove the old URLFetcher delegate callback while I'm touching all of them.BUG=98716,83592
Review URL: http://codereview.chromium.org/8373021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106949 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
4 files changed, 14 insertions, 8 deletions
diff --git a/content/browser/geolocation/network_location_request.cc b/content/browser/geolocation/network_location_request.cc index d345192..7284b7f 100644 --- a/content/browser/geolocation/network_location_request.cc +++ b/content/browser/geolocation/network_location_request.cc @@ -12,6 +12,7 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "content/common/geoposition.h" +#include "content/common/net/url_fetcher.h" #include "net/base/escape.h" #include "net/base/load_flags.h" #include "net/url_request/url_request_context_getter.h" @@ -106,9 +107,11 @@ void NetworkLocationRequest::OnURLFetchComplete(const URLFetcher* source) { Geoposition position; string16 access_token; + std::string data; + source->GetResponseAsString(&data); GetLocationFromResponse(status.is_success(), response_code, - source->GetResponseStringRef(), + data, timestamp_, source->url(), &position, diff --git a/content/browser/geolocation/network_location_request.h b/content/browser/geolocation/network_location_request.h index 45f6806..649d4ff 100644 --- a/content/browser/geolocation/network_location_request.h +++ b/content/browser/geolocation/network_location_request.h @@ -13,7 +13,7 @@ #include "base/memory/scoped_ptr.h" #include "content/browser/geolocation/device_data_provider.h" #include "content/common/content_export.h" -#include "content/common/net/url_fetcher.h" +#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" class URLFetcher; @@ -27,7 +27,7 @@ struct Position; // Takes a set of device data and sends it to a server to get a position fix. // It performs formatting of the request and interpretation of the response. -class NetworkLocationRequest : private URLFetcher::Delegate { +class NetworkLocationRequest : private content::URLFetcherDelegate { public: // ID passed to URLFetcher::Create(). Used for testing. CONTENT_EXPORT static int url_fetcher_id_for_tests; @@ -65,7 +65,7 @@ class NetworkLocationRequest : private URLFetcher::Delegate { const GURL& url() const { return url_; } private: - // URLFetcher::Delegate + // content::URLFetcherDelegate virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE; scoped_refptr<net::URLRequestContextGetter> url_context_; diff --git a/content/browser/speech/speech_recognition_request.cc b/content/browser/speech/speech_recognition_request.cc index c61c134..e204b10 100644 --- a/content/browser/speech/speech_recognition_request.cc +++ b/content/browser/speech/speech_recognition_request.cc @@ -10,6 +10,7 @@ #include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/values.h" +#include "content/common/net/url_fetcher.h" #include "net/base/escape.h" #include "net/base/load_flags.h" #include "net/url_request/url_request_context.h" @@ -209,8 +210,10 @@ void SpeechRecognitionRequest::OnURLFetchComplete(const URLFetcher* source) { DCHECK_EQ(url_fetcher_.get(), source); SpeechInputResult result; + std::string data; if (!source->status().is_success() || source->response_code() != 200 || - !ParseServerResponse(source->GetResponseStringRef(), &result)) { + !source->GetResponseAsString(&data) || + !ParseServerResponse(data, &result)) { result.error = kErrorNetwork; } diff --git a/content/browser/speech/speech_recognition_request.h b/content/browser/speech/speech_recognition_request.h index 2382123..caab120 100644 --- a/content/browser/speech/speech_recognition_request.h +++ b/content/browser/speech/speech_recognition_request.h @@ -12,7 +12,7 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "content/common/content_export.h" -#include "content/common/net/url_fetcher.h" +#include "content/public/common/url_fetcher_delegate.h" #include "content/common/speech_input_result.h" #include "googleurl/src/gurl.h" @@ -26,7 +26,7 @@ namespace speech_input { // Provides a simple interface for sending recorded speech data to the server // and get back recognition results. -class SpeechRecognitionRequest : public URLFetcher::Delegate { +class SpeechRecognitionRequest : public content::URLFetcherDelegate { public: // ID passed to URLFetcher::Create(). Used for testing. CONTENT_EXPORT static int url_fetcher_id_for_tests; @@ -62,7 +62,7 @@ class SpeechRecognitionRequest : public URLFetcher::Delegate { CONTENT_EXPORT bool HasPendingRequest() { return url_fetcher_ != NULL; } - // URLFetcher::Delegate methods. + // content::URLFetcherDelegate methods. virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE; private: |