diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-22 22:52:59 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-22 22:52:59 +0000 |
commit | 15fb2aadeb85e93964d5c34bb52ad94f35fc01cb (patch) | |
tree | 7b66c4fd1b9ba70f081f93c1692618d4a65b03bc /chrome/browser | |
parent | 3d6dfd5dd689a33c77f9032194616f75e59be1be (diff) | |
download | chromium_src-15fb2aadeb85e93964d5c34bb52ad94f35fc01cb.zip chromium_src-15fb2aadeb85e93964d5c34bb52ad94f35fc01cb.tar.gz chromium_src-15fb2aadeb85e93964d5c34bb52ad94f35fc01cb.tar.bz2 |
Remove content::URLFetcherDelegate
Change all references to net::URLFetcherDelegate.
Change some instances of content::URLFetcher to net::URLFetcher as
needed.
Remove unused files auth_response_handler.*.
BUG=118220
TEST=
TBR=sky@chromium.org,joi@chromium.org,mnissler@chromium.org,rlp@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10392192
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138384 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
68 files changed, 303 insertions, 278 deletions
diff --git a/chrome/browser/alternate_nav_url_fetcher.h b/chrome/browser/alternate_nav_url_fetcher.h index e9467f0..6e2755e 100644 --- a/chrome/browser/alternate_nav_url_fetcher.h +++ b/chrome/browser/alternate_nav_url_fetcher.h @@ -11,14 +11,15 @@ #include "base/memory/scoped_ptr.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_fetcher_delegate.h" namespace content { class NavigationController; } namespace net { +class URLFetcher; class URLRequestStatus; } @@ -39,7 +40,7 @@ class URLRequestStatus; // * The intranet fetch fails // * None of the above apply, so we successfully show an infobar class AlternateNavURLFetcher : public content::NotificationObserver, - public content::URLFetcherDelegate { + public net::URLFetcherDelegate { public: enum State { NOT_STARTED, @@ -59,7 +60,7 @@ class AlternateNavURLFetcher : public content::NotificationObserver, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; - // content::URLFetcherDelegate + // net::URLFetcherDelegate virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // Sets |controller_| to the supplied pointer and begins fetching @@ -79,7 +80,7 @@ class AlternateNavURLFetcher : public content::NotificationObserver, void ShowInfobarIfPossible(); GURL alternate_nav_url_; - scoped_ptr<content::URLFetcher> fetcher_; + scoped_ptr<net::URLFetcher> fetcher_; content::NavigationController* controller_; State state_; bool navigated_to_entry_; diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc index a18e2be3..0b99f09 100644 --- a/chrome/browser/autocomplete/search_provider.cc +++ b/chrome/browser/autocomplete/search_provider.cc @@ -530,7 +530,7 @@ void SearchProvider::ClearResults() { have_suggest_results_ = false; } -content::URLFetcher* SearchProvider::CreateSuggestFetcher( +net::URLFetcher* SearchProvider::CreateSuggestFetcher( int id, const TemplateURLRef& suggestions_url, const string16& text) { diff --git a/chrome/browser/autocomplete/search_provider.h b/chrome/browser/autocomplete/search_provider.h index 5c22c53..aa66ca5 100644 --- a/chrome/browser/autocomplete/search_provider.h +++ b/chrome/browser/autocomplete/search_provider.h @@ -27,7 +27,7 @@ #include "chrome/browser/history/history_types.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/search_engines/template_url_id.h" -#include "content/public/common/url_fetcher_delegate.h" +#include "net/url_request/url_fetcher_delegate.h" class Profile; class TemplateURLService; @@ -36,6 +36,10 @@ namespace base { class Value; } +namespace net { +class URLFetcher; +} + // Autocomplete provider for searches and suggestions from a search engine. // // After construction, the autocomplete controller repeatedly calls Start() @@ -47,7 +51,7 @@ class Value; // comes back, the provider creates and returns matches for the best // suggestions. class SearchProvider : public AutocompleteProvider, - public content::URLFetcherDelegate { + public net::URLFetcherDelegate { public: SearchProvider(ACProviderListener* listener, Profile* profile); @@ -75,7 +79,7 @@ class SearchProvider : public AutocompleteProvider, // Adds search-provider-specific information to omnibox event logs. virtual void AddProviderInfo(ProvidersInfo* provider_info) const OVERRIDE; - // content::URLFetcherDelegate + // net::URLFetcherDelegate virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // ID used in creating URLFetcher for default provider's suggest results. @@ -220,7 +224,7 @@ class SearchProvider : public AutocompleteProvider, // Creates a URLFetcher requesting suggest results from the specified // |suggestions_url|. The caller owns the returned URLFetcher. - content::URLFetcher* CreateSuggestFetcher( + net::URLFetcher* CreateSuggestFetcher( int id, const TemplateURLRef& suggestions_url, const string16& text); @@ -326,11 +330,11 @@ class SearchProvider : public AutocompleteProvider, base::TimeTicks time_suggest_request_sent_; // The fetcher that retrieves suggest results for the keyword from the server. - scoped_ptr<content::URLFetcher> keyword_fetcher_; + scoped_ptr<net::URLFetcher> keyword_fetcher_; // The fetcher that retrieves suggest results for the default engine from the // server. - scoped_ptr<content::URLFetcher> default_fetcher_; + scoped_ptr<net::URLFetcher> default_fetcher_; // Suggestions returned by the Suggest server for the input text. SuggestResults keyword_suggest_results_; diff --git a/chrome/browser/autofill/autofill_download.h b/chrome/browser/autofill/autofill_download.h index 4a85d66..69f0107 100644 --- a/chrome/browser/autofill/autofill_download.h +++ b/chrome/browser/autofill/autofill_download.h @@ -17,7 +17,7 @@ #include "base/gtest_prod_util.h" #include "base/time.h" #include "chrome/browser/autofill/autofill_type.h" -#include "content/public/common/url_fetcher_delegate.h" +#include "net/url_request/url_fetcher_delegate.h" class AutofillMetrics; class FormStructure; @@ -28,7 +28,7 @@ class URLFetcher; } // namespace net // Handles getting and updating Autofill heuristics. -class AutofillDownloadManager : public content::URLFetcherDelegate { +class AutofillDownloadManager : public net::URLFetcherDelegate { public: enum AutofillRequestType { REQUEST_QUERY, @@ -114,7 +114,7 @@ class AutofillDownloadManager : public content::URLFetcherDelegate { std::string GetCombinedSignature( const std::vector<std::string>& forms_in_query) const; - // content::URLFetcherDelegate implementation: + // net::URLFetcherDelegate implementation: virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // Probability of the form upload. Between 0 (no upload) and 1 (upload all). diff --git a/chrome/browser/captive_portal/captive_portal_service.h b/chrome/browser/captive_portal/captive_portal_service.h index f211afe..eedfd31 100644 --- a/chrome/browser/captive_portal/captive_portal_service.h +++ b/chrome/browser/captive_portal/captive_portal_service.h @@ -14,9 +14,9 @@ #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/profiles/profile_keyed_service.h" #include "content/public/browser/notification_observer.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" #include "net/base/backoff_entry.h" +#include "net/url_request/url_fetcher_delegate.h" class Profile; @@ -46,7 +46,7 @@ enum Result { // be accessed on the UI thread. // Design doc: https://docs.google.com/document/d/1k-gP2sswzYNvryu9NcgN7q5XrsMlUdlUdoW9WRaEmfM/edit class CaptivePortalService : public ProfileKeyedService, - public content::URLFetcherDelegate, + public net::URLFetcherDelegate, public content::NotificationObserver, public base::NonThreadSafe { public: @@ -115,7 +115,7 @@ class CaptivePortalService : public ProfileKeyedService, // is disabled, just acts like there's an Internet connection. void DetectCaptivePortalInternal(); - // content::URLFetcherDelegate: + // net::URLFetcherDelegate: virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // content::NotificationObserver: diff --git a/chrome/browser/chrome_to_mobile_service.cc b/chrome/browser/chrome_to_mobile_service.cc index 2009cdf..9b1eb23 100644 --- a/chrome/browser/chrome_to_mobile_service.cc +++ b/chrome/browser/chrome_to_mobile_service.cc @@ -135,7 +135,7 @@ void CreateSnapshotFile(CreateSnapshotFileCallback callback) { // Send snapshot file contents as POST data in a job submit request. // Call this as a BlockingPoolSequencedTask (before posting DeleteSnapshotFile). -void SubmitSnapshotFile(content::URLFetcher* request, +void SubmitSnapshotFile(net::URLFetcher* request, const ChromeToMobileService::RequestData& data) { std::string file; if (file_util::ReadFileToString(data.snapshot_path, &file) && !file.empty()) { @@ -253,7 +253,7 @@ void ChromeToMobileService::SendToMobile(const string16& mobile_id, data.snapshot_id = send_snapshot ? guid::GenerateGUID() : std::string(); data.type = send_snapshot ? DELAYED_SNAPSHOT : URL; - content::URLFetcher* submit_url = CreateRequest(data); + net::URLFetcher* submit_url = CreateRequest(data); request_observer_map_[submit_url] = observer; submit_url->Start(); @@ -261,7 +261,7 @@ void ChromeToMobileService::SendToMobile(const string16& mobile_id, LogMetric(SENDING_SNAPSHOT); data.type = SNAPSHOT; - content::URLFetcher* submit_snapshot = CreateRequest(data); + net::URLFetcher* submit_snapshot = CreateRequest(data); request_observer_map_[submit_snapshot] = observer; content::BrowserThread::PostBlockingPoolSequencedTask( data.snapshot_path.AsUTF8Unsafe(), FROM_HERE, @@ -342,11 +342,11 @@ void ChromeToMobileService::SnapshotFileCreated( } } -content::URLFetcher* ChromeToMobileService::CreateRequest( +net::URLFetcher* ChromeToMobileService::CreateRequest( const RequestData& data) { bool get = data.type != SNAPSHOT; GURL service_url(cloud_print_url_->GetCloudPrintServiceURL()); - content::URLFetcher* request = content::URLFetcher::Create( + net::URLFetcher* request = content::URLFetcher::Create( data.type == SEARCH ? GetSearchURL(service_url) : GetSubmitURL(service_url, data), get ? content::URLFetcher::GET : content::URLFetcher::POST, this); diff --git a/chrome/browser/chrome_to_mobile_service.h b/chrome/browser/chrome_to_mobile_service.h index 329244c..3ca631b 100644 --- a/chrome/browser/chrome_to_mobile_service.h +++ b/chrome/browser/chrome_to_mobile_service.h @@ -20,8 +20,8 @@ #include "chrome/common/net/gaia/oauth2_access_token_consumer.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_fetcher_delegate.h" class OAuth2AccessTokenFetcher; class CloudPrintURL; @@ -32,10 +32,14 @@ namespace base { class DictionaryValue; } +namespace net { +class URLFetcher; +} + // ChromeToMobileService connects to the cloud print service to enumerate // compatible mobiles owned by its profile and send URLs and MHTML snapshots. class ChromeToMobileService : public ProfileKeyedService, - public content::URLFetcherDelegate, + public net::URLFetcherDelegate, public content::NotificationObserver, public OAuth2AccessTokenConsumer { public: @@ -119,7 +123,7 @@ class ChromeToMobileService : public ProfileKeyedService, // Virtual for unit test mocking. virtual void LogMetric(Metric metric); - // content::URLFetcherDelegate method. + // net::URLFetcherDelegate method. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // content::NotificationObserver method. @@ -141,7 +145,7 @@ class ChromeToMobileService : public ProfileKeyedService, bool success); // Utility function to create URLFetcher requests. - content::URLFetcher* CreateRequest(const RequestData& data); + net::URLFetcher* CreateRequest(const RequestData& data); // Send the OAuth2AccessTokenFetcher request. // Virtual for unit test mocking. @@ -184,11 +188,11 @@ class ChromeToMobileService : public ProfileKeyedService, base::OneShotTimer<ChromeToMobileService> auth_retry_timer_; // The pending account information request and the cloud print access flag. - scoped_ptr<content::URLFetcher> account_info_request_; + scoped_ptr<net::URLFetcher> account_info_request_; bool cloud_print_accessible_; // The pending mobile device search request; and the time of the last request. - scoped_ptr<content::URLFetcher> search_request_; + scoped_ptr<net::URLFetcher> search_request_; base::TimeTicks previous_search_time_; DISALLOW_COPY_AND_ASSIGN(ChromeToMobileService); diff --git a/chrome/browser/chromeos/customization_document.h b/chrome/browser/chromeos/customization_document.h index aef946c..37bddd6 100644 --- a/chrome/browser/chromeos/customization_document.h +++ b/chrome/browser/chromeos/customization_document.h @@ -14,8 +14,8 @@ #include "base/memory/singleton.h" #include "base/timer.h" #include "base/values.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_fetcher_delegate.h" class FilePath; class PrefService; @@ -24,6 +24,10 @@ namespace base { class DictionaryValue; } +namespace net { +class URLFetcher; +} + namespace chromeos { namespace system { @@ -111,7 +115,7 @@ class StartupCustomizationDocument : public CustomizationDocument { // the manifest should be initiated outside this class by calling // StartFetching() method. User of the file should check IsReady before use it. class ServicesCustomizationDocument : public CustomizationDocument, - private content::URLFetcherDelegate { + private net::URLFetcherDelegate { public: static ServicesCustomizationDocument* GetInstance(); @@ -148,7 +152,7 @@ class ServicesCustomizationDocument : public CustomizationDocument, // Save applied state in machine settings. static void SetApplied(bool val); - // Overriden from content::URLFetcherDelegate: + // Overriden from net::URLFetcherDelegate: virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // Initiate file fetching. @@ -161,7 +165,7 @@ class ServicesCustomizationDocument : public CustomizationDocument, GURL url_; // URLFetcher instance. - scoped_ptr<content::URLFetcher> url_fetcher_; + scoped_ptr<net::URLFetcher> url_fetcher_; // Timer to retry fetching file if network is not available. base::OneShotTimer<ServicesCustomizationDocument> retry_timer_; diff --git a/chrome/browser/chromeos/gdata/gdata_auth_service.h b/chrome/browser/chromeos/gdata/gdata_auth_service.h index 310c678..e7f62a2 100644 --- a/chrome/browser/chromeos/gdata/gdata_auth_service.h +++ b/chrome/browser/chromeos/gdata/gdata_auth_service.h @@ -8,9 +8,10 @@ #include <string> -#include "base/observer_list.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" +#include "base/message_loop_proxy.h" +#include "base/observer_list.h" #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" #include "chrome/browser/chromeos/gdata/gdata_params.h" #include "chrome/common/net/gaia/oauth2_access_token_fetcher.h" diff --git a/chrome/browser/chromeos/gdata/gdata_operations.cc b/chrome/browser/chromeos/gdata/gdata_operations.cc index 4a54d15..66c9100 100644 --- a/chrome/browser/chromeos/gdata/gdata_operations.cc +++ b/chrome/browser/chromeos/gdata/gdata_operations.cc @@ -15,12 +15,13 @@ #include "chrome/common/net/gaia/gaia_urls.h" #include "chrome/common/net/gaia/google_service_auth_error.h" #include "chrome/common/net/url_util.h" +#include "content/public/common/url_fetcher.h" #include "net/base/escape.h" #include "net/http/http_util.h" #include "third_party/libxml/chromium/libxml_utils.h" using content::BrowserThread; -using content::URLFetcher; +using net::URLFetcher; namespace { @@ -259,7 +260,8 @@ void UrlFetchOperationBase::Start(const std::string& auth_token) { DCHECK(!url.is_empty()); DVLOG(1) << "URL: " << url.spec(); - url_fetcher_.reset(URLFetcher::Create(url, GetRequestType(), this)); + url_fetcher_.reset( + content::URLFetcher::Create(url, GetRequestType(), this)); url_fetcher_->SetRequestContext(g_browser_process->system_request_context()); // Always set flags to neither send nor save cookies. url_fetcher_->SetLoadFlags( diff --git a/chrome/browser/chromeos/gdata/gdata_operations.h b/chrome/browser/chromeos/gdata/gdata_operations.h index c87af73..8152a03 100644 --- a/chrome/browser/chromeos/gdata/gdata_operations.h +++ b/chrome/browser/chromeos/gdata/gdata_operations.h @@ -21,6 +21,7 @@ #include "content/public/browser/browser_thread.h" #include "net/base/load_flags.h" #include "net/http/http_response_headers.h" +#include "net/url_request/url_fetcher.h" namespace gdata { @@ -82,7 +83,7 @@ class GDataOperationInterface { // Base class for operations that are fetching URLs. class UrlFetchOperationBase : public GDataOperationInterface, public GDataOperationRegistry::Operation, - public content::URLFetcherDelegate { + public net::URLFetcherDelegate { public: // Overridden from GDataOperationInterface. virtual void Start(const std::string& auth_token) OVERRIDE; @@ -103,7 +104,7 @@ class UrlFetchOperationBase : public GDataOperationInterface, virtual GURL GetURL() const = 0; // Returns the request type. A derived class should override this method // for a request type other than HTTP GET. - virtual content::URLFetcher::RequestType GetRequestType() const; + virtual net::URLFetcher::RequestType GetRequestType() const; // Returns the extra HTTP headers for the request. A derived class should // override this method to specify any extra headers needed for the request. virtual std::vector<std::string> GetExtraRequestHeaders() const; @@ -144,7 +145,7 @@ class UrlFetchOperationBase : public GDataOperationInterface, int re_authenticate_count_; bool save_temp_file_; FilePath output_file_path_; - scoped_ptr<content::URLFetcher> url_fetcher_; + scoped_ptr<net::URLFetcher> url_fetcher_; bool started_; }; @@ -270,7 +271,7 @@ class DownloadFileOperation : public UrlFetchOperationBase { OVERRIDE; virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE; - // Overridden from content::URLFetcherDelegate. + // Overridden from net::URLFetcherDelegate. virtual void OnURLFetchDownloadProgress(const net::URLFetcher* source, int64 current, int64 total) OVERRIDE; virtual bool ShouldSendDownloadData() OVERRIDE; @@ -299,7 +300,7 @@ class DeleteDocumentOperation : public EntryActionOperation { protected: // Overridden from EntryActionOperation. - virtual content::URLFetcher::RequestType GetRequestType() const OVERRIDE; + virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; private: @@ -322,7 +323,7 @@ class CreateDirectoryOperation : public GetDataOperation { protected: // Overridden from UrlFetchOperationBase. virtual GURL GetURL() const OVERRIDE; - virtual content::URLFetcher::RequestType GetRequestType() const OVERRIDE; + virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; // Overridden from UrlFetchOperationBase. virtual bool GetContentData(std::string* upload_content_type, @@ -349,7 +350,7 @@ class CopyDocumentOperation : public GetDataOperation { protected: // Overridden from GetDataOperation. - virtual content::URLFetcher::RequestType GetRequestType() const OVERRIDE; + virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; // Overridden from UrlFetchOperationBase. virtual GURL GetURL() const OVERRIDE; @@ -377,7 +378,7 @@ class RenameResourceOperation : public EntryActionOperation { protected: // Overridden from EntryActionOperation. - virtual content::URLFetcher::RequestType GetRequestType() const OVERRIDE; + virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; // Overridden from UrlFetchOperationBase. @@ -408,7 +409,7 @@ class AddResourceToDirectoryOperation : public EntryActionOperation { virtual GURL GetURL() const OVERRIDE; // Overridden from UrlFetchOperationBase. - virtual content::URLFetcher::RequestType GetRequestType() const OVERRIDE; + virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; virtual bool GetContentData(std::string* upload_content_type, std::string* upload_content) OVERRIDE; @@ -437,7 +438,7 @@ class RemoveResourceFromDirectoryOperation : public EntryActionOperation { virtual GURL GetURL() const OVERRIDE; // Overridden from UrlFetchOperationBase. - virtual content::URLFetcher::RequestType GetRequestType() const OVERRIDE; + virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; private: @@ -467,7 +468,7 @@ class InitiateUploadOperation : public UrlFetchOperationBase { virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE; // Overridden from UrlFetchOperationBase. - virtual content::URLFetcher::RequestType GetRequestType() const OVERRIDE; + virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; virtual bool GetContentData(std::string* upload_content_type, std::string* upload_content) OVERRIDE; @@ -501,7 +502,7 @@ class ResumeUploadOperation : public UrlFetchOperationBase { virtual void RunCallbackOnPrematureFailure(GDataErrorCode code) OVERRIDE; // Overridden from UrlFetchOperationBase. - virtual content::URLFetcher::RequestType GetRequestType() const OVERRIDE; + virtual net::URLFetcher::RequestType GetRequestType() const OVERRIDE; virtual std::vector<std::string> GetExtraRequestHeaders() const OVERRIDE; virtual bool GetContentData(std::string* upload_content_type, std::string* upload_content) OVERRIDE; diff --git a/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc b/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc index 99019c6..2c4258a 100644 --- a/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc +++ b/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc @@ -16,12 +16,12 @@ #include "base/string_util.h" #include "base/threading/sequenced_worker_pool.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/chromeos/gdata/gdata_files.h" #include "chrome/browser/chromeos/gdata/gdata_file_system.h" +#include "chrome/browser/chromeos/gdata/gdata_files.h" #include "chrome/browser/chromeos/gdata/gdata_system_service.h" #include "chrome/browser/chromeos/gdata/gdata_util.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/url_constants.h" #include "content/public/browser/browser_thread.h" #include "net/base/escape.h" @@ -236,9 +236,9 @@ void GDataURLRequestJob::Start() { // 7.1) Whenever content::URLFetcherCore::OnReadCompleted() receives a part // of the response, it invokes // constent::URLFetcherDelegate::OnURLFetchDownloadData() if - // content::URLFetcherDelegate::ShouldSendDownloadData() is true. + // net::URLFetcherDelegate::ShouldSendDownloadData() is true. // 7.2) gdata::DownloadFileOperation overrides the default implementations - // of the following methods of content::URLFetcherDelegate: + // of the following methods of net::URLFetcherDelegate: // - ShouldSendDownloadData(): returns true for non-null // GetDownloadDataCallback. // - OnURLFetchDownloadData(): invokes non-null diff --git a/chrome/browser/chromeos/imageburner/burn_manager.cc b/chrome/browser/chromeos/imageburner/burn_manager.cc index 5b0a61d..775a2e0 100644 --- a/chrome/browser/chromeos/imageburner/burn_manager.cc +++ b/chrome/browser/chromeos/imageburner/burn_manager.cc @@ -282,7 +282,7 @@ void BurnManager::FetchConfigFile(Delegate* delegate) { return; config_fetcher_.reset(content::URLFetcher::Create( - config_file_url_, content::URLFetcher::GET, this)); + config_file_url_, net::URLFetcher::GET, this)); config_fetcher_->SetRequestContext( g_browser_process->system_request_context()); config_fetcher_->Start(); @@ -292,7 +292,7 @@ void BurnManager::FetchImage(const GURL& image_url, const FilePath& file_path) { tick_image_download_start_ = base::TimeTicks::Now(); bytes_image_download_progress_last_reported_ = 0; image_fetcher_.reset(content::URLFetcher::Create(image_url, - content::URLFetcher::GET, + net::URLFetcher::GET, this)); image_fetcher_->SetRequestContext( g_browser_process->system_request_context()); diff --git a/chrome/browser/chromeos/imageburner/burn_manager.h b/chrome/browser/chromeos/imageburner/burn_manager.h index 8b79979..cebed12 100644 --- a/chrome/browser/chromeos/imageburner/burn_manager.h +++ b/chrome/browser/chromeos/imageburner/burn_manager.h @@ -15,8 +15,12 @@ #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/time.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_fetcher_delegate.h" + +namespace net { +class URLFetcher; +} // namespace net namespace chromeos { namespace imageburner { @@ -154,7 +158,7 @@ class StateMachine { DISALLOW_COPY_AND_ASSIGN(StateMachine); }; -class BurnManager : content::URLFetcherDelegate { +class BurnManager : net::URLFetcherDelegate { public: class Delegate : public base::SupportsWeakPtr<Delegate> { @@ -252,8 +256,8 @@ class BurnManager : content::URLFetcherDelegate { scoped_ptr<StateMachine> state_machine_; - scoped_ptr<content::URLFetcher> config_fetcher_; - scoped_ptr<content::URLFetcher> image_fetcher_; + scoped_ptr<net::URLFetcher> config_fetcher_; + scoped_ptr<net::URLFetcher> image_fetcher_; base::TimeTicks tick_image_download_start_; int64 bytes_image_download_progress_last_reported_; diff --git a/chrome/browser/chromeos/login/auth_response_handler.cc b/chrome/browser/chromeos/login/auth_response_handler.cc deleted file mode 100644 index 02364e8..0000000 --- a/chrome/browser/chromeos/login/auth_response_handler.cc +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/chromeos/login/auth_response_handler.h" - -namespace chromeos { - -const int kHttpSuccess = 200; - -} // namespace chromeos diff --git a/chrome/browser/chromeos/login/auth_response_handler.h b/chrome/browser/chromeos/login/auth_response_handler.h deleted file mode 100644 index 5ffab96..0000000 --- a/chrome/browser/chromeos/login/auth_response_handler.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_RESPONSE_HANDLER_H_ -#define CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_RESPONSE_HANDLER_H_ -#pragma once - -#include <string> - -#include "content/public/common/url_fetcher_delegate.h" - -class GURL; - -namespace chromeos { - -// The success code specified by the HTTP spec. -extern const int kHttpSuccess; - -class AuthResponseHandler { - public: - AuthResponseHandler() {} - virtual ~AuthResponseHandler() {} - - // True if this object can handle responses from |url|, false otherwise. - virtual bool CanHandle(const GURL& url) = 0; - - // Caller takes ownership of return value. - // Takes in |to_process|, creates an appropriate URLFetcher to handle - // the next step, sets |catcher| to get called back when that fetcher is done. - // Starts the fetch and returns the fetcher, so the the caller can handle - // the object lifetime. - virtual content::URLFetcher* Handle(const std::string& to_process, - content::URLFetcherDelegate* catcher) = 0; -}; - -} // namespace chromeos - -#endif // CHROME_BROWSER_CHROMEOS_LOGIN_AUTH_RESPONSE_HANDLER_H_ diff --git a/chrome/browser/chromeos/login/login_utils_browsertest.cc b/chrome/browser/chromeos/login/login_utils_browsertest.cc index 4c84443..a5f68e6 100644 --- a/chrome/browser/chromeos/login/login_utils_browsertest.cc +++ b/chrome/browser/chromeos/login/login_utils_browsertest.cc @@ -35,9 +35,9 @@ #include "chromeos/dbus/mock_dbus_thread_manager.h" #include "chromeos/dbus/mock_session_manager_client.h" #include "content/public/browser/browser_thread.h" -#include "content/public/common/url_fetcher_delegate.h" #include "content/test/test_browser_thread.h" #include "content/test/test_url_fetcher_factory.h" +#include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_status.h" #include "testing/gmock/include/gmock/gmock.h" diff --git a/chrome/browser/chromeos/login/mock_url_fetchers.cc b/chrome/browser/chromeos/login/mock_url_fetchers.cc index 440d827..f0e455d 100644 --- a/chrome/browser/chromeos/login/mock_url_fetchers.cc +++ b/chrome/browser/chromeos/login/mock_url_fetchers.cc @@ -11,9 +11,9 @@ #include "base/stringprintf.h" #include "content/public/browser/browser_thread.h" #include "content/public/common/url_fetcher.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" #include "net/http/http_status_code.h" +#include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_request_status.h" #include "testing/gtest/include/gtest/gtest.h" @@ -24,7 +24,7 @@ ExpectCanceledFetcher::ExpectCanceledFetcher( const GURL& url, const std::string& results, content::URLFetcher::RequestType request_type, - content::URLFetcherDelegate* d) + net::URLFetcherDelegate* d) : TestURLFetcher(0, url, d), ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { } @@ -50,7 +50,7 @@ GotCanceledFetcher::GotCanceledFetcher( const GURL& url, const std::string& results, content::URLFetcher::RequestType request_type, - content::URLFetcherDelegate* d) + net::URLFetcherDelegate* d) : TestURLFetcher(0, url, d) { set_url(url); set_status(net::URLRequestStatus(net::URLRequestStatus::CANCELED, 0)); @@ -67,7 +67,7 @@ SuccessFetcher::SuccessFetcher(bool success, const GURL& url, const std::string& results, content::URLFetcher::RequestType request_type, - content::URLFetcherDelegate* d) + net::URLFetcherDelegate* d) : TestURLFetcher(0, url, d) { set_url(url); set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0)); @@ -84,7 +84,7 @@ FailFetcher::FailFetcher(bool success, const GURL& url, const std::string& results, content::URLFetcher::RequestType request_type, - content::URLFetcherDelegate* d) + net::URLFetcherDelegate* d) : TestURLFetcher(0, url, d) { set_url(url); set_status(net::URLRequestStatus(net::URLRequestStatus::FAILED, ECONNRESET)); @@ -111,7 +111,7 @@ CaptchaFetcher::CaptchaFetcher(bool success, const GURL& url, const std::string& results, content::URLFetcher::RequestType request_type, - content::URLFetcherDelegate* d) + net::URLFetcherDelegate* d) : TestURLFetcher(0, url, d) { set_url(url); set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0)); @@ -151,7 +151,7 @@ HostedFetcher::HostedFetcher(bool success, const GURL& url, const std::string& results, content::URLFetcher::RequestType request_type, - content::URLFetcherDelegate* d) + net::URLFetcherDelegate* d) : TestURLFetcher(0, url, d) { set_url(url); set_status(net::URLRequestStatus(net::URLRequestStatus::SUCCESS, 0)); diff --git a/chrome/browser/chromeos/login/mock_url_fetchers.h b/chrome/browser/chromeos/login/mock_url_fetchers.h index 02a33a0..c028a75 100644 --- a/chrome/browser/chromeos/login/mock_url_fetchers.h +++ b/chrome/browser/chromeos/login/mock_url_fetchers.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,8 +8,8 @@ #include <string> -#include "base/memory/weak_ptr.h" #include "base/compiler_specific.h" +#include "base/memory/weak_ptr.h" #include "base/message_loop.h" #include "content/test/test_url_fetcher_factory.h" #include "googleurl/src/gurl.h" @@ -29,7 +29,7 @@ class ExpectCanceledFetcher : public TestURLFetcher { const GURL& url, const std::string& results, content::URLFetcher::RequestType request_type, - content::URLFetcherDelegate* d); + net::URLFetcherDelegate* d); virtual ~ExpectCanceledFetcher(); virtual void Start() OVERRIDE; @@ -47,7 +47,7 @@ class GotCanceledFetcher : public TestURLFetcher { const GURL& url, const std::string& results, content::URLFetcher::RequestType request_type, - content::URLFetcherDelegate* d); + net::URLFetcherDelegate* d); virtual ~GotCanceledFetcher(); virtual void Start() OVERRIDE; @@ -62,7 +62,7 @@ class SuccessFetcher : public TestURLFetcher { const GURL& url, const std::string& results, content::URLFetcher::RequestType request_type, - content::URLFetcherDelegate* d); + net::URLFetcherDelegate* d); virtual ~SuccessFetcher(); virtual void Start() OVERRIDE; @@ -77,7 +77,7 @@ class FailFetcher : public TestURLFetcher { const GURL& url, const std::string& results, content::URLFetcher::RequestType request_type, - content::URLFetcherDelegate* d); + net::URLFetcherDelegate* d); virtual ~FailFetcher(); virtual void Start() OVERRIDE; @@ -92,7 +92,7 @@ class CaptchaFetcher : public TestURLFetcher { const GURL& url, const std::string& results, content::URLFetcher::RequestType request_type, - content::URLFetcherDelegate* d); + net::URLFetcherDelegate* d); virtual ~CaptchaFetcher(); static std::string GetCaptchaToken(); @@ -115,7 +115,7 @@ class HostedFetcher : public TestURLFetcher { const GURL& url, const std::string& results, content::URLFetcher::RequestType request_type, - content::URLFetcherDelegate* d); + net::URLFetcherDelegate* d); virtual ~HostedFetcher(); virtual void Start() OVERRIDE; diff --git a/chrome/browser/component_updater/component_updater_service.cc b/chrome/browser/component_updater/component_updater_service.cc index 33e08ec..f1bdaa8 100644 --- a/chrome/browser/component_updater/component_updater_service.cc +++ b/chrome/browser/component_updater/component_updater_service.cc @@ -29,10 +29,10 @@ #include "content/public/browser/utility_process_host.h" #include "content/public/browser/utility_process_host_client.h" #include "content/public/common/url_fetcher.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" #include "net/base/escape.h" #include "net/base/load_flags.h" +#include "net/url_request/url_fetcher_delegate.h" using content::BrowserThread; using content::UtilityProcessHost; @@ -113,7 +113,7 @@ bool IsVersionNewer(const Version& current, const std::string& proposed) { // OnURLFetchComplete() callbacks for different types of url requests // they are differentiated by the |Ctx| type. template <typename Del, typename Ctx> -class DelegateWithContext : public content::URLFetcherDelegate { +class DelegateWithContext : public net::URLFetcherDelegate { public: DelegateWithContext(Del* delegate, Ctx* context) : delegate_(delegate), context_(context) {} @@ -131,7 +131,7 @@ class DelegateWithContext : public content::URLFetcherDelegate { }; // This function creates the right DelegateWithContext using template inference. template <typename Del, typename Ctx> -content::URLFetcherDelegate* MakeContextDelegate(Del* delegate, Ctx* context) { +net::URLFetcherDelegate* MakeContextDelegate(Del* delegate, Ctx* context) { return new DelegateWithContext<Del, Ctx>(delegate, context); } diff --git a/chrome/browser/extensions/app_notify_channel_setup.h b/chrome/browser/extensions/app_notify_channel_setup.h index e83420b..cd3f5a0 100644 --- a/chrome/browser/extensions/app_notify_channel_setup.h +++ b/chrome/browser/extensions/app_notify_channel_setup.h @@ -14,8 +14,8 @@ #include "chrome/common/net/gaia/oauth2_access_token_consumer.h" #include "chrome/common/net/gaia/oauth2_access_token_fetcher.h" #include "content/public/common/url_fetcher.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_fetcher_delegate.h" class AppNotifyChannelSetupTest; class Profile; @@ -30,7 +30,7 @@ class Profile; // 4. Call the delegate passed in to the constructor with the results of // the above steps. class AppNotifyChannelSetup - : public content::URLFetcherDelegate, + : public net::URLFetcherDelegate, public AppNotifyChannelUI::Delegate, public OAuth2AccessTokenConsumer, public base::RefCountedThreadSafe<AppNotifyChannelSetup> { @@ -97,7 +97,7 @@ class AppNotifyChannelSetup int callback_id() const { return callback_id_; } protected: - // content::URLFetcherDelegate. + // net::URLFetcherDelegate. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // AppNotifyChannelUI::Delegate. diff --git a/chrome/browser/extensions/apps_promo.h b/chrome/browser/extensions/apps_promo.h index 3b25f5f..2fad19b 100644 --- a/chrome/browser/extensions/apps_promo.h +++ b/chrome/browser/extensions/apps_promo.h @@ -11,11 +11,15 @@ #include "base/gtest_prod_util.h" #include "chrome/common/extensions/extension.h" -#include "content/public/common/url_fetcher_delegate.h" +#include "net/url_request/url_fetcher_delegate.h" class PrefService; class Profile; +namespace net { +class URLFetcher; +} // namespace net + // This encapsulates business logic for: // - Whether to show the apps promo in the launcher // - Whether to expire existing default apps @@ -143,7 +147,7 @@ class AppsPromo { // Fetches logos over HTTPS, making sure we don't send cookies and that we // cache the image until its source URL changes. -class AppsPromoLogoFetcher : public content::URLFetcherDelegate { +class AppsPromoLogoFetcher : public net::URLFetcherDelegate { public: AppsPromoLogoFetcher(Profile* profile, const AppsPromo::PromoData& promo_data); @@ -167,7 +171,7 @@ class AppsPromoLogoFetcher : public content::URLFetcherDelegate { Profile* profile_; AppsPromo::PromoData promo_data_; - scoped_ptr<content::URLFetcher> url_fetcher_; + scoped_ptr<net::URLFetcher> url_fetcher_; }; #endif // CHROME_BROWSER_EXTENSIONS_APPS_PROMO_H_ diff --git a/chrome/browser/extensions/updater/extension_downloader.h b/chrome/browser/extensions/updater/extension_downloader.h index bd885d1..a95423b 100644 --- a/chrome/browser/extensions/updater/extension_downloader.h +++ b/chrome/browser/extensions/updater/extension_downloader.h @@ -20,12 +20,13 @@ #include "chrome/browser/extensions/updater/manifest_fetch_data.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/update_manifest.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_fetcher_delegate.h" class Version; namespace net { +class URLFetcher; class URLRequestContextGetter; class URLRequestStatus; } @@ -38,7 +39,7 @@ class ExtensionUpdaterTest; // the crx file when updates are found. It uses a |ExtensionDownloaderDelegate| // that takes ownership of the downloaded crx files, and handles events during // the update check. -class ExtensionDownloader : public content::URLFetcherDelegate { +class ExtensionDownloader : public net::URLFetcherDelegate { public: // |delegate| is stored as a raw pointer and must outlive the // ExtensionDownloader. @@ -118,7 +119,7 @@ class ExtensionDownloader : public content::URLFetcherDelegate { // Begins an update check. Takes ownership of |fetch_data|. void StartUpdateCheck(ManifestFetchData* fetch_data); - // content::URLFetcherDelegate implementation. + // net::URLFetcherDelegate implementation. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // Handles the result of a manifest fetch. @@ -180,8 +181,8 @@ class ExtensionDownloader : public content::URLFetcherDelegate { FetchMap fetches_preparing_; // Outstanding url fetch requests for manifests and updates. - scoped_ptr<content::URLFetcher> manifest_fetcher_; - scoped_ptr<content::URLFetcher> extension_fetcher_; + scoped_ptr<net::URLFetcher> manifest_fetcher_; + scoped_ptr<net::URLFetcher> extension_fetcher_; // Pending manifests and extensions to be fetched when the appropriate fetcher // is available. diff --git a/chrome/browser/extensions/webstore_inline_installer.h b/chrome/browser/extensions/webstore_inline_installer.h index bd35456..4076209 100644 --- a/chrome/browser/extensions/webstore_inline_installer.h +++ b/chrome/browser/extensions/webstore_inline_installer.h @@ -15,8 +15,8 @@ #include "chrome/browser/extensions/webstore_install_helper.h" #include "chrome/browser/extensions/webstore_installer.h" #include "content/public/browser/web_contents_observer.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_fetcher_delegate.h" #include "third_party/skia/include/core/SkBitmap.h" class SafeWebstoreResponseParser; @@ -25,6 +25,10 @@ namespace extensions { class Extension; } +namespace net { +class URLFetcher; +} + // Manages inline installs requested by a page (downloads and parses metadata // from the webstore, shows the install UI, starts the download once the user // confirms). Clients must implement the WebstoreInlineInstaller::Delegate @@ -35,7 +39,7 @@ class WebstoreInlineInstaller : public base::RefCountedThreadSafe<WebstoreInlineInstaller>, public ExtensionInstallUI::Delegate, public content::WebContentsObserver, - public content::URLFetcherDelegate, + public net::URLFetcherDelegate, public WebstoreInstaller::Delegate, public WebstoreInstallHelper::Delegate { public: @@ -76,7 +80,7 @@ class WebstoreInlineInstaller // All flows (whether successful or not) end up in CompleteInstall, which // informs our delegate of success/failure. - // content::URLFetcherDelegate interface implementation. + // net::URLFetcherDelegate interface implementation. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // Client callbacks for SafeWebstoreResponseParser when parsing is complete. @@ -121,7 +125,7 @@ class WebstoreInlineInstaller scoped_ptr<ExtensionInstallUI> install_ui_; // For fetching webstore JSON data. - scoped_ptr<content::URLFetcher> webstore_data_url_fetcher_; + scoped_ptr<net::URLFetcher> webstore_data_url_fetcher_; // Extracted from the webstore JSON data response. std::string localized_name_; diff --git a/chrome/browser/extensions/webstore_install_helper.h b/chrome/browser/extensions/webstore_install_helper.h index 06a1440..ff57a73 100644 --- a/chrome/browser/extensions/webstore_install_helper.h +++ b/chrome/browser/extensions/webstore_install_helper.h @@ -11,8 +11,8 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "content/public/browser/utility_process_host_client.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_fetcher_delegate.h" #include "third_party/skia/include/core/SkBitmap.h" class SkBitmap; @@ -27,6 +27,7 @@ class UtilityProcessHost; } namespace net { +class URLFetcher; class URLRequestContextGetter; } @@ -35,7 +36,7 @@ class URLRequestContextGetter; // fetching/decoding icon data. Clients must implement the // WebstoreInstallHelper::Delegate interface to receive the parsed data. class WebstoreInstallHelper : public content::UtilityProcessHostClient, - public content::URLFetcherDelegate { + public net::URLFetcherDelegate { public: class Delegate { public: @@ -78,7 +79,7 @@ class WebstoreInstallHelper : public content::UtilityProcessHostClient, void ReportResultsIfComplete(); void ReportResultFromUIThread(); - // Implementing the content::URLFetcherDelegate interface. + // Implementing the net::URLFetcherDelegate interface. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // Implementing pieces of the UtilityProcessHostClient interface. @@ -108,7 +109,7 @@ class WebstoreInstallHelper : public content::UtilityProcessHostClient, std::vector<unsigned char> fetched_icon_data_; // For fetching the icon, if needed. - scoped_ptr<content::URLFetcher> url_fetcher_; + scoped_ptr<net::URLFetcher> url_fetcher_; net::URLRequestContextGetter* context_getter_; // Only usable on UI thread. base::WeakPtr<content::UtilityProcessHost> utility_host_; diff --git a/chrome/browser/feedback/feedback_util.cc b/chrome/browser/feedback/feedback_util.cc index 633f95b..320c5f6 100644 --- a/chrome/browser/feedback/feedback_util.cc +++ b/chrome/browser/feedback/feedback_util.cc @@ -27,12 +27,12 @@ #include "content/public/browser/navigation_controller.h" #include "content/public/browser/web_contents.h" #include "content/public/common/url_fetcher.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/theme_resources.h" #include "net/base/load_flags.h" +#include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_request_status.h" #include "ui/base/l10n/l10n_util.h" #include "unicode/locid.h" @@ -88,14 +88,14 @@ const int64 kRetryDelayLimit = 14400000; // 4 hours } // namespace -// Simple content::URLFetcherDelegate to clean up URLFetcher on completion. -class FeedbackUtil::PostCleanup : public content::URLFetcherDelegate { +// Simple net::URLFetcherDelegate to clean up URLFetcher on completion. +class FeedbackUtil::PostCleanup : public net::URLFetcherDelegate { public: PostCleanup(Profile* profile, std::string* post_body, int64 previous_delay) : profile_(profile), post_body_(post_body), previous_delay_(previous_delay) { } - // Overridden from content::URLFetcherDelegate. + // Overridden from net::URLFetcherDelegate. virtual void OnURLFetchComplete(const net::URLFetcher* source); protected: diff --git a/chrome/browser/google/google_url_tracker.h b/chrome/browser/google/google_url_tracker.h index 6b4a113..b3f340d 100644 --- a/chrome/browser/google/google_url_tracker.h +++ b/chrome/browser/google/google_url_tracker.h @@ -17,9 +17,9 @@ #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" #include "content/public/common/url_fetcher.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" #include "net/base/network_change_notifier.h" +#include "net/url_request/url_fetcher_delegate.h" class GoogleURLTrackerInfoBarDelegate; class PrefService; @@ -43,7 +43,7 @@ class WebContents; // To protect users' privacy and reduce server load, no updates will be // performed (ever) unless at least one consumer registers interest by calling // RequestServerCheck(). -class GoogleURLTracker : public content::URLFetcherDelegate, +class GoogleURLTracker : public net::URLFetcherDelegate, public content::NotificationObserver, public net::NetworkChangeNotifier::IPAddressObserver, public ProfileKeyedService { @@ -117,7 +117,7 @@ class GoogleURLTracker : public content::URLFetcherDelegate, // it and can currently do so. void StartFetchIfDesirable(); - // content::URLFetcherDelegate: + // net::URLFetcherDelegate: virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // content::NotificationObserver: diff --git a/chrome/browser/importer/toolbar_importer.h b/chrome/browser/importer/toolbar_importer.h index 6ca3a0c..0527b9e 100644 --- a/chrome/browser/importer/toolbar_importer.h +++ b/chrome/browser/importer/toolbar_importer.h @@ -19,19 +19,23 @@ #include "base/string16.h" #include "chrome/browser/importer/importer.h" #include "chrome/browser/importer/profile_writer.h" -#include "content/public/common/url_fetcher_delegate.h" +#include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_request_context_getter.h" class ImporterBridge; class XmlReader; +namespace net { +class URLFetcher; +} // namespace net + // Toolbar5Importer is a class which exposes the functionality needed to // communicate with the Google Toolbar v5 front-end, negotiate the download of // Toolbar bookmarks, parse them, and install them on the client. // Toolbar5Importer should not have StartImport called more than once. Futher // if StartImport is called, then the class must not be destroyed until it has // either completed or Toolbar5Importer->Cancel() has been called. -class Toolbar5Importer : public content::URLFetcherDelegate, public Importer { +class Toolbar5Importer : public net::URLFetcherDelegate, public Importer { public: Toolbar5Importer(); @@ -48,7 +52,7 @@ class Toolbar5Importer : public content::URLFetcherDelegate, public Importer { // to cancel network retrieval. virtual void Cancel() OVERRIDE; - // content::URLFetcherDelegate method called back from the URLFetcher object. + // net::URLFetcherDelegate method called back from the URLFetcher object. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; private: @@ -155,8 +159,8 @@ class Toolbar5Importer : public content::URLFetcherDelegate, public Importer { // The fetchers need to be available to cancel the network call on user cancel // hence they are stored as member variables. - content::URLFetcher* token_fetcher_; - content::URLFetcher* data_fetcher_; + net::URLFetcher* token_fetcher_; + net::URLFetcher* data_fetcher_; // Used to get correct login data for the toolbar server. scoped_refptr<net::URLRequestContextGetter> request_context_getter_; diff --git a/chrome/browser/intents/cws_intents_registry.h b/chrome/browser/intents/cws_intents_registry.h index caf3649..be02f79 100644 --- a/chrome/browser/intents/cws_intents_registry.h +++ b/chrome/browser/intents/cws_intents_registry.h @@ -11,8 +11,8 @@ #include "base/hash_tables.h" #include "base/memory/ref_counted.h" #include "chrome/browser/profiles/profile_keyed_service.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_fetcher_delegate.h" namespace net { class URLRequestContextGetter; @@ -21,7 +21,7 @@ class URLRequestContextGetter; // Handles storing and retrieving of web intents in the web database. // The registry provides filtering logic to retrieve specific types of intents. class CWSIntentsRegistry : public ProfileKeyedService, - public content::URLFetcherDelegate { + public net::URLFetcherDelegate { public: // Data returned from CWS for a single service. struct IntentExtensionInfo { @@ -72,7 +72,7 @@ class CWSIntentsRegistry : public ProfileKeyedService, explicit CWSIntentsRegistry(net::URLRequestContextGetter* context); virtual ~CWSIntentsRegistry(); - // content::URLFetcherDelegate implementation. + // net::URLFetcherDelegate implementation. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // Map for all in-flight web data requests/intent queries. diff --git a/chrome/browser/intranet_redirect_detector.h b/chrome/browser/intranet_redirect_detector.h index 5f14c67..677a638 100644 --- a/chrome/browser/intranet_redirect_detector.h +++ b/chrome/browser/intranet_redirect_detector.h @@ -13,10 +13,10 @@ #include "base/memory/weak_ptr.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" #include "net/base/host_resolver_proc.h" #include "net/base/network_change_notifier.h" +#include "net/url_request/url_fetcher_delegate.h" class PrefService; @@ -37,7 +37,7 @@ class PrefService; // return a value at all times (even during startup or in unittest mode). If no // redirection is in place, the returned GURL will be empty. class IntranetRedirectDetector - : public content::URLFetcherDelegate, + : public net::URLFetcherDelegate, public net::NetworkChangeNotifier::IPAddressObserver { public: // Only the main browser process loop should call this, when setting up @@ -66,7 +66,7 @@ class IntranetRedirectDetector // switch sleep has finished. Runs any pending fetch. void FinishSleep(); - // content::URLFetcherDelegate + // net::URLFetcherDelegate virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // NetworkChangeNotifier::IPAddressObserver diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc index ff85f90..6427496 100644 --- a/chrome/browser/metrics/metrics_service.cc +++ b/chrome/browser/metrics/metrics_service.cc @@ -1262,7 +1262,7 @@ void MetricsService::OnURLFetchComplete(const net::URLFetcher* source) { // We're not allowed to re-use the existing |URLFetcher|s, so free them here. // Note however that |source| is aliased to one of these, so we should be // careful not to delete it too early. - scoped_ptr<content::URLFetcher> s; + scoped_ptr<net::URLFetcher> s; if (source == current_fetch_xml_.get()) { s.reset(current_fetch_xml_.release()); diff --git a/chrome/browser/metrics/metrics_service.h b/chrome/browser/metrics/metrics_service.h index 82c89cf..0542064 100644 --- a/chrome/browser/metrics/metrics_service.h +++ b/chrome/browser/metrics/metrics_service.h @@ -24,7 +24,7 @@ #include "chrome/installer/util/google_update_settings.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "content/public/common/url_fetcher_delegate.h" +#include "net/url_request/url_fetcher_delegate.h" #if defined(OS_CHROMEOS) #include "chrome/browser/chromeos/external_metrics.h" @@ -50,6 +50,10 @@ namespace extensions { class ExtensionDownloader; } +namespace net { +class URLFetcher; +} + namespace prerender { bool IsOmniboxEnabled(Profile* profile); } @@ -65,7 +69,7 @@ struct WebPluginInfo; class MetricsService : public chrome_browser_metrics::TrackingSynchronizerObserver, public content::NotificationObserver, - public content::URLFetcherDelegate, + public net::URLFetcherDelegate, public MetricsServiceBase { public: MetricsService(); @@ -270,7 +274,7 @@ class MetricsService // copy of the staged log. void PrepareFetchWithStagedLog(); - // Implementation of content::URLFetcherDelegate. Called after transmission + // Implementation of net::URLFetcherDelegate. Called after transmission // completes (either successfully or with failure). virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; @@ -377,8 +381,8 @@ class MetricsService scoped_ptr<MetricsLog> initial_log_; // The outstanding transmission appears as a URL Fetch operation. - scoped_ptr<content::URLFetcher> current_fetch_xml_; - scoped_ptr<content::URLFetcher> current_fetch_proto_; + scoped_ptr<net::URLFetcher> current_fetch_xml_; + scoped_ptr<net::URLFetcher> current_fetch_proto_; // Cached responses from the XML request while we wait for a response to the // protubuf request. diff --git a/chrome/browser/metrics/variations_service.cc b/chrome/browser/metrics/variations_service.cc index 89e39a2..e47916f 100644 --- a/chrome/browser/metrics/variations_service.cc +++ b/chrome/browser/metrics/variations_service.cc @@ -6,9 +6,9 @@ #include "base/base64.h" #include "base/build_time.h" -#include "base/version.h" #include "base/memory/scoped_ptr.h" #include "base/metrics/field_trial.h" +#include "base/version.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/metrics/proto/trials_seed.pb.h" #include "chrome/browser/prefs/pref_service.h" @@ -83,7 +83,7 @@ void VariationsService::StartFetchingVariationsSeed() { void VariationsService::OnURLFetchComplete(const net::URLFetcher* source) { DCHECK_EQ(pending_seed_request_.get(), source); // When we're done handling the request, the fetcher will be deleted. - scoped_ptr<const content::URLFetcher> request( + scoped_ptr<const net::URLFetcher> request( pending_seed_request_.release()); if (request->GetStatus().status() != net::URLRequestStatus::SUCCESS || request->GetResponseCode() != 200) diff --git a/chrome/browser/metrics/variations_service.h b/chrome/browser/metrics/variations_service.h index 76e1cb1..b0009d2 100644 --- a/chrome/browser/metrics/variations_service.h +++ b/chrome/browser/metrics/variations_service.h @@ -10,18 +10,22 @@ #include "base/compiler_specific.h" #include "base/gtest_prod_util.h" -#include "base/time.h" #include "base/memory/scoped_ptr.h" +#include "base/time.h" #include "chrome/browser/metrics/proto/study.pb.h" #include "chrome/browser/metrics/proto/trials_seed.pb.h" #include "chrome/common/chrome_version_info.h" -#include "content/public/common/url_fetcher_delegate.h" +#include "net/url_request/url_fetcher_delegate.h" class PrefService; +namespace net { +class URLFetcher; +} // namespace net + // Used to setup field trials based on stored variations seed data, and fetch // new seed data from the variations server. -class VariationsService : public content::URLFetcherDelegate { +class VariationsService : public net::URLFetcherDelegate { public: VariationsService(); virtual ~VariationsService(); @@ -35,7 +39,7 @@ class VariationsService : public content::URLFetcherDelegate { // response. void StartFetchingVariationsSeed(); - // content::URLFetcherDelegate implementation: + // net::URLFetcherDelegate implementation: virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // Register Variations related prefs in Local State. @@ -80,7 +84,7 @@ class VariationsService : public content::URLFetcherDelegate { // Contains the current seed request. Will only have a value while a request // is pending, and will be reset by |OnURLFetchComplete|. - scoped_ptr<content::URLFetcher> pending_seed_request_; + scoped_ptr<net::URLFetcher> pending_seed_request_; // The variations seed data being used for this session. // TODO(jwd): This should be removed. When the seed data is loaded, it will be diff --git a/chrome/browser/net/gaia/gaia_oauth_fetcher.cc b/chrome/browser/net/gaia/gaia_oauth_fetcher.cc index 580bb6d..31d55fc 100644 --- a/chrome/browser/net/gaia/gaia_oauth_fetcher.cc +++ b/chrome/browser/net/gaia/gaia_oauth_fetcher.cc @@ -60,15 +60,15 @@ void GaiaOAuthFetcher::CancelRequest() { } // static -content::URLFetcher* GaiaOAuthFetcher::CreateGaiaFetcher( +net::URLFetcher* GaiaOAuthFetcher::CreateGaiaFetcher( net::URLRequestContextGetter* getter, const GURL& gaia_gurl, const std::string& body, const std::string& headers, bool send_cookies, - content::URLFetcherDelegate* delegate) { + net::URLFetcherDelegate* delegate) { bool empty_body = body.empty(); - content::URLFetcher* result = content::URLFetcher::Create( + net::URLFetcher* result = content::URLFetcher::Create( 0, gaia_gurl, empty_body ? content::URLFetcher::GET : content::URLFetcher::POST, delegate); @@ -683,7 +683,7 @@ void GaiaOAuthFetcher::OnUserInfoFetched( void GaiaOAuthFetcher::OnURLFetchComplete(const net::URLFetcher* source) { // Keep |fetcher_| around to avoid invalidating its |status| (accessed below). - scoped_ptr<content::URLFetcher> current_fetcher(fetcher_.release()); + scoped_ptr<net::URLFetcher> current_fetcher(fetcher_.release()); fetch_pending_ = false; std::string data; source->GetResponseAsString(&data); diff --git a/chrome/browser/net/gaia/gaia_oauth_fetcher.h b/chrome/browser/net/gaia/gaia_oauth_fetcher.h index 1a3fecc..2da38a5 100644 --- a/chrome/browser/net/gaia/gaia_oauth_fetcher.h +++ b/chrome/browser/net/gaia/gaia_oauth_fetcher.h @@ -14,8 +14,8 @@ #include "chrome/browser/net/gaia/gaia_oauth_consumer.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_fetcher_delegate.h" struct ChromeCookieDetails; @@ -23,6 +23,7 @@ class Browser; class Profile; namespace net { +class URLFetcher; class URLRequestContextGetter; class URLRequestStatus; typedef std::vector<std::string> ResponseCookies; @@ -45,7 +46,7 @@ typedef std::vector<std::string> ResponseCookies; // // This class can handle one request at a time, and all calls through an // instance should be serialized. -class GaiaOAuthFetcher : public content::URLFetcherDelegate, +class GaiaOAuthFetcher : public net::URLFetcherDelegate, public content::NotificationObserver { public: // Defines steps of OAuth process performed by this class. @@ -136,7 +137,7 @@ class GaiaOAuthFetcher : public content::URLFetcherDelegate, virtual void OnBrowserClosing(Browser* profile, bool detail); - // Implementation of content::URLFetcherDelegate + // Implementation of net::URLFetcherDelegate virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // StartGetOAuthToken (or other Start* routine) been called, but results @@ -237,13 +238,13 @@ class GaiaOAuthFetcher : public content::URLFetcherDelegate, const std::string& oauth2_service_scope); // Create a fetcher useable for making any Gaia OAuth request. - static content::URLFetcher* CreateGaiaFetcher( + static net::URLFetcher* CreateGaiaFetcher( net::URLRequestContextGetter* getter, const GURL& gaia_gurl_, const std::string& body, const std::string& headers, bool send_cookies, - content::URLFetcherDelegate* delegate); + net::URLFetcherDelegate* delegate); bool ShouldAutoFetch(RequestType fetch_step); @@ -255,7 +256,7 @@ class GaiaOAuthFetcher : public content::URLFetcherDelegate, content::NotificationRegistrar registrar_; // While a fetch is going on: - scoped_ptr<content::URLFetcher> fetcher_; + scoped_ptr<net::URLFetcher> fetcher_; std::string request_body_; std::string request_headers_; std::string service_scope_; diff --git a/chrome/browser/net/sdch_dictionary_fetcher.h b/chrome/browser/net/sdch_dictionary_fetcher.h index 8deb288..9a7f943 100644 --- a/chrome/browser/net/sdch_dictionary_fetcher.h +++ b/chrome/browser/net/sdch_dictionary_fetcher.h @@ -17,15 +17,16 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/threading/non_thread_safe.h" -#include "content/public/common/url_fetcher_delegate.h" #include "net/base/sdch_manager.h" +#include "net/url_request/url_fetcher_delegate.h" namespace net { +class URLFetcher; class URLRequestContextGetter; } // namespace net class SdchDictionaryFetcher - : public content::URLFetcherDelegate, + : public net::URLFetcherDelegate, public net::SdchFetcher, public base::NonThreadSafe { public: @@ -55,7 +56,7 @@ class SdchDictionaryFetcher // in the |fetch_queue_|. void StartFetching(); - // Implementation of content::URLFetcherDelegate. Called after transmission + // Implementation of net::URLFetcherDelegate. Called after transmission // completes (either successfully or with failure). virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; @@ -63,7 +64,7 @@ class SdchDictionaryFetcher std::queue<GURL> fetch_queue_; // The currently outstanding URL fetch of a dicitonary. // If this is null, then there is no outstanding request. - scoped_ptr<content::URLFetcher> current_fetch_; + scoped_ptr<net::URLFetcher> current_fetch_; // Always spread out the dictionary fetches, so that they don't steal // bandwidth from the actual page load. Create delayed tasks to spread out diff --git a/chrome/browser/policy/device_management_service.h b/chrome/browser/policy/device_management_service.h index 112e4b1..e8df7b2 100644 --- a/chrome/browser/policy/device_management_service.h +++ b/chrome/browser/policy/device_management_service.h @@ -18,7 +18,7 @@ #include "base/memory/weak_ptr.h" #include "chrome/browser/policy/cloud_policy_constants.h" #include "chrome/browser/policy/proto/device_management_backend.pb.h" -#include "content/public/common/url_fetcher_delegate.h" +#include "net/url_request/url_fetcher_delegate.h" namespace net { class URLRequestContextGetter; @@ -86,7 +86,7 @@ class DeviceManagementRequestJob { // communication with the device management server. It creates the backends // objects that the device management policy provider and friends use to issue // requests. -class DeviceManagementService : public content::URLFetcherDelegate { +class DeviceManagementService : public net::URLFetcherDelegate { public: explicit DeviceManagementService(const std::string& server_url); virtual ~DeviceManagementService(); @@ -110,7 +110,7 @@ class DeviceManagementService : public content::URLFetcherDelegate { friend class DeviceManagementRequestJobImpl; - // content::URLFetcherDelegate override. + // net::URLFetcherDelegate override. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // Does the actual initialization using the request context specified for diff --git a/chrome/browser/policy/testing_policy_url_fetcher_factory.cc b/chrome/browser/policy/testing_policy_url_fetcher_factory.cc index 76cf207..c0f0fff 100644 --- a/chrome/browser/policy/testing_policy_url_fetcher_factory.cc +++ b/chrome/browser/policy/testing_policy_url_fetcher_factory.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -40,7 +40,7 @@ class TestingPolicyURLFetcher : public TestURLFetcher { TestingPolicyURLFetcher( const base::WeakPtr<TestingPolicyURLFetcherFactory>& parent, const GURL& url, - content::URLFetcherDelegate* delegate); + net::URLFetcherDelegate* delegate); virtual void Start() OVERRIDE; void Respond(); @@ -65,7 +65,7 @@ class TestingPolicyURLFetcher : public TestURLFetcher { TestingPolicyURLFetcher::TestingPolicyURLFetcher( const base::WeakPtr<TestingPolicyURLFetcherFactory>& parent, const GURL& url, - content::URLFetcherDelegate* delegate) + net::URLFetcherDelegate* delegate) : TestURLFetcher(0, url, delegate), parent_(parent) { set_url(url); @@ -126,7 +126,7 @@ content::URLFetcher* TestingPolicyURLFetcherFactory::CreateURLFetcher( int id, const GURL& url, content::URLFetcher::RequestType request_type, - content::URLFetcherDelegate* delegate) { + net::URLFetcherDelegate* delegate) { return new TestingPolicyURLFetcher( weak_ptr_factory_.GetWeakPtr(), url, delegate); } diff --git a/chrome/browser/policy/testing_policy_url_fetcher_factory.h b/chrome/browser/policy/testing_policy_url_fetcher_factory.h index ded4d9f..3ca6ef6 100644 --- a/chrome/browser/policy/testing_policy_url_fetcher_factory.h +++ b/chrome/browser/policy/testing_policy_url_fetcher_factory.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,8 +10,8 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" -#include "content/public/common/url_fetcher_delegate.h" #include "content/test/test_url_fetcher_factory.h" +#include "net/url_request/url_fetcher_delegate.h" #include "testing/gmock/include/gmock/gmock.h" class GURL; @@ -43,7 +43,7 @@ class TestingPolicyURLFetcherFactory : public content::URLFetcherFactory, int id, const GURL& url, content::URLFetcher::RequestType request_type, - content::URLFetcherDelegate* delegate) OVERRIDE; + net::URLFetcherDelegate* delegate) OVERRIDE; LoggingWorkScheduler* scheduler(); diff --git a/chrome/browser/profiles/profile_downloader.h b/chrome/browser/profiles/profile_downloader.h index 42f973f..66d9960 100644 --- a/chrome/browser/profiles/profile_downloader.h +++ b/chrome/browser/profiles/profile_downloader.h @@ -16,16 +16,20 @@ #include "chrome/common/net/gaia/oauth2_access_token_consumer.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_fetcher_delegate.h" #include "third_party/skia/include/core/SkBitmap.h" class ProfileDownloaderDelegate; class OAuth2AccessTokenFetcher; +namespace net { +class URLFetcher; +} // namespace net + // Downloads user profile information. The profile picture is decoded in a // sandboxed process. -class ProfileDownloader : public content::URLFetcherDelegate, +class ProfileDownloader : public net::URLFetcherDelegate, public ImageDecoder::Delegate, public content::NotificationObserver, public OAuth2AccessTokenConsumer { @@ -67,7 +71,7 @@ class ProfileDownloader : public content::URLFetcherDelegate, FRIEND_TEST_ALL_PREFIXES(ProfileDownloaderTest, ParseData); FRIEND_TEST_ALL_PREFIXES(ProfileDownloaderTest, DefaultURL); - // Overriden from content::URLFetcherDelegate: + // Overriden from net::URLFetcherDelegate: virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // Overriden from ImageDecoder::Delegate: @@ -107,8 +111,8 @@ class ProfileDownloader : public content::URLFetcherDelegate, ProfileDownloaderDelegate* delegate_; std::string auth_token_; - scoped_ptr<content::URLFetcher> user_entry_fetcher_; - scoped_ptr<content::URLFetcher> profile_image_fetcher_; + scoped_ptr<net::URLFetcher> user_entry_fetcher_; + scoped_ptr<net::URLFetcher> profile_image_fetcher_; scoped_ptr<OAuth2AccessTokenFetcher> oauth2_access_token_fetcher_; content::NotificationRegistrar registrar_; string16 profile_full_name_; diff --git a/chrome/browser/safe_browsing/client_side_detection_service.h b/chrome/browser/safe_browsing/client_side_detection_service.h index 26483ee..d2dea5d 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service.h +++ b/chrome/browser/safe_browsing/client_side_detection_service.h @@ -31,9 +31,9 @@ #include "base/time.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" #include "net/base/net_util.h" +#include "net/url_request/url_fetcher_delegate.h" class SafeBrowsingService; @@ -46,6 +46,7 @@ class RenderProcessHost; } namespace net { +class URLFetcher; class URLRequestContextGetter; class URLRequestStatus; typedef std::vector<std::string> ResponseCookies; @@ -56,7 +57,7 @@ class ClientPhishingRequest; class ClientPhishingResponse; class ClientSideModel; -class ClientSideDetectionService : public content::URLFetcherDelegate, +class ClientSideDetectionService : public net::URLFetcherDelegate, public content::NotificationObserver { public: // void(GURL phishing_url, bool is_phishing). @@ -83,7 +84,7 @@ class ClientSideDetectionService : public content::URLFetcherDelegate, return enabled_; } - // From the content::URLFetcherDelegate interface. + // From the net::URLFetcherDelegate interface. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // content::NotificationObserver overrides: @@ -258,7 +259,7 @@ class ClientSideDetectionService : public content::URLFetcherDelegate, std::string model_str_; scoped_ptr<ClientSideModel> model_; scoped_ptr<base::TimeDelta> model_max_age_; - scoped_ptr<content::URLFetcher> model_fetcher_; + scoped_ptr<net::URLFetcher> model_fetcher_; // Map of client report phishing request to the corresponding callback that // has to be invoked when the request is done. diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc index cab143c..34e2e8c 100644 --- a/chrome/browser/safe_browsing/download_protection_service.cc +++ b/chrome/browser/safe_browsing/download_protection_service.cc @@ -28,11 +28,11 @@ #include "content/public/browser/download_item.h" #include "content/public/browser/page_navigator.h" #include "content/public/common/url_fetcher.h" -#include "content/public/common/url_fetcher_delegate.h" #include "net/base/load_flags.h" #include "net/base/x509_cert_types.h" #include "net/base/x509_certificate.h" #include "net/http/http_status_code.h" +#include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_status.h" @@ -331,7 +331,7 @@ class DownloadProtectionService::CheckClientDownloadRequest : public base::RefCountedThreadSafe< DownloadProtectionService::CheckClientDownloadRequest, BrowserThread::DeleteOnUIThread>, - public content::URLFetcherDelegate { + public net::URLFetcherDelegate { public: CheckClientDownloadRequest(const DownloadInfo& info, const CheckDownloadCallback& callback, @@ -421,7 +421,7 @@ class DownloadProtectionService::CheckClientDownloadRequest service_ = NULL; } - // From the content::URLFetcherDelegate interface. + // From the net::URLFetcherDelegate interface. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK_EQ(source, fetcher_.get()); diff --git a/chrome/browser/safe_browsing/download_protection_service_unittest.cc b/chrome/browser/safe_browsing/download_protection_service_unittest.cc index 40a32b6..b389961 100644 --- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc +++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc @@ -24,11 +24,11 @@ #include "chrome/common/safe_browsing/csd.pb.h" #include "chrome/common/zip.h" #include "content/public/browser/download_item.h" -#include "content/public/common/url_fetcher_delegate.h" #include "content/test/test_browser_thread.h" #include "content/test/test_url_fetcher_factory.h" #include "googleurl/src/gurl.h" #include "net/base/x509_certificate.h" +#include "net/url_request/url_fetcher_delegate.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/safe_browsing/malware_details_cache.h b/chrome/browser/safe_browsing/malware_details_cache.h index eaaa3c5..291d0f9 100644 --- a/chrome/browser/safe_browsing/malware_details_cache.h +++ b/chrome/browser/safe_browsing/malware_details_cache.h @@ -17,10 +17,11 @@ #include "base/memory/linked_ptr.h" #include "base/memory/ref_counted.h" #include "chrome/browser/safe_browsing/report.pb.h" -#include "content/public/common/url_fetcher_delegate.h" #include "net/base/completion_callback.h" +#include "net/url_request/url_fetcher_delegate.h" namespace net { +class URLFetcher; class URLRequestContext; } @@ -34,7 +35,7 @@ typedef base::hash_map< class MalwareDetailsCacheCollector : public base::RefCountedThreadSafe<MalwareDetailsCacheCollector>, - public content::URLFetcherDelegate { + public net::URLFetcherDelegate { public: MalwareDetailsCacheCollector(); @@ -82,7 +83,7 @@ class MalwareDetailsCacheCollector scoped_refptr<net::URLRequestContextGetter> request_context_getter_; // The current URLFetcher. - scoped_ptr<content::URLFetcher> current_fetch_; + scoped_ptr<net::URLFetcher> current_fetch_; // Returns the resource from resources_ that corresponds to |url| safe_browsing::ClientMalwareReportRequest::Resource* GetResource( diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc index 2773dd4..dd53567 100644 --- a/chrome/browser/safe_browsing/protocol_manager.cc +++ b/chrome/browser/safe_browsing/protocol_manager.cc @@ -172,7 +172,7 @@ void SafeBrowsingProtocolManager::GetNextUpdate() { IssueUpdateRequest(); } -// content::URLFetcherDelegate implementation ---------------------------------- +// net::URLFetcherDelegate implementation ---------------------------------- // All SafeBrowsing request responses are handled here. // TODO(paulg): Clarify with the SafeBrowsing team whether a failed parse of a diff --git a/chrome/browser/safe_browsing/protocol_manager.h b/chrome/browser/safe_browsing/protocol_manager.h index 8c8c83c..c1d2e61 100644 --- a/chrome/browser/safe_browsing/protocol_manager.h +++ b/chrome/browser/safe_browsing/protocol_manager.h @@ -25,7 +25,11 @@ #include "chrome/browser/safe_browsing/protocol_parser.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/safe_browsing/safe_browsing_util.h" -#include "content/public/common/url_fetcher_delegate.h" +#include "net/url_request/url_fetcher_delegate.h" + +namespace net { +class URLFetcher; +} // namespace net #if defined(COMPILER_GCC) // Allows us to use URLFetchers in a hash_map with gcc (MSVC is okay without @@ -56,7 +60,7 @@ class SBProtocolManagerFactory { DISALLOW_COPY_AND_ASSIGN(SBProtocolManagerFactory); }; -class SafeBrowsingProtocolManager : public content::URLFetcherDelegate { +class SafeBrowsingProtocolManager : public net::URLFetcherDelegate { FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestBackOffTimes); FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestChunkStrings); FRIEND_TEST_ALL_PREFIXES(SafeBrowsingProtocolManagerTest, TestGetHashUrl); @@ -91,7 +95,7 @@ class SafeBrowsingProtocolManager : public content::URLFetcherDelegate { // of the SafeBrowsing service. virtual void Initialize(); - // content::URLFetcherDelegate interface. + // net::URLFetcherDelegate interface. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // API used by the SafeBrowsingService for issuing queries. When the results @@ -282,7 +286,7 @@ class SafeBrowsingProtocolManager : public content::URLFetcherDelegate { // Current active request (in case we need to cancel) for updates or chunks // from the SafeBrowsing service. We can only have one of these outstanding // at any given time unlike GetHash requests, which are tracked separately. - scoped_ptr<content::URLFetcher> request_; + scoped_ptr<net::URLFetcher> request_; // The kind of request that is currently in progress. SafeBrowsingRequestType request_type_; diff --git a/chrome/browser/safe_browsing/safe_browsing_test.cc b/chrome/browser/safe_browsing/safe_browsing_test.cc index 33a8b6d..50eb4f7 100644 --- a/chrome/browser/safe_browsing/safe_browsing_test.cc +++ b/chrome/browser/safe_browsing/safe_browsing_test.cc @@ -39,12 +39,12 @@ #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/browser_context.h" #include "content/public/common/url_fetcher.h" -#include "content/public/common/url_fetcher_delegate.h" #include "content/test/test_browser_thread.h" #include "net/base/host_resolver.h" #include "net/base/load_flags.h" #include "net/base/net_log.h" #include "net/test/python_utils.h" +#include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_request_status.h" #include "testing/gtest/include/gtest/gtest.h" @@ -348,7 +348,7 @@ class SafeBrowsingServiceTest : public InProcessBrowserTest { class SafeBrowsingServiceTestHelper : public base::RefCountedThreadSafe<SafeBrowsingServiceTestHelper>, public SafeBrowsingService::Client, - public content::URLFetcherDelegate { + public net::URLFetcherDelegate { public: SafeBrowsingServiceTestHelper(SafeBrowsingServiceTest* safe_browsing_test, net::URLRequestContextGetter* request_context) diff --git a/chrome/browser/search_engines/template_url_fetcher.cc b/chrome/browser/search_engines/template_url_fetcher.cc index 21f30f6..f46d422 100644 --- a/chrome/browser/search_engines/template_url_fetcher.cc +++ b/chrome/browser/search_engines/template_url_fetcher.cc @@ -22,13 +22,13 @@ #include "content/public/browser/render_view_host.h" #include "content/public/browser/web_contents.h" #include "content/public/common/url_fetcher.h" -#include "content/public/common/url_fetcher_delegate.h" #include "net/base/load_flags.h" +#include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_request_status.h" // RequestDelegate ------------------------------------------------------------ class TemplateURLFetcher::RequestDelegate - : public content::URLFetcherDelegate, + : public net::URLFetcherDelegate, public content::NotificationObserver { public: // Takes ownership of |callbacks|. @@ -45,7 +45,7 @@ class TemplateURLFetcher::RequestDelegate const content::NotificationSource& source, const content::NotificationDetails& details); - // content::URLFetcherDelegate: + // net::URLFetcherDelegate: // If data contains a valid OSDD, a TemplateURL is created and added to // the TemplateURLService. virtual void OnURLFetchComplete(const net::URLFetcher* source); diff --git a/chrome/browser/spellchecker/spellcheck_host_impl.cc b/chrome/browser/spellchecker/spellcheck_host_impl.cc index a2b7d8f..a9c51a3 100644 --- a/chrome/browser/spellchecker/spellcheck_host_impl.cc +++ b/chrome/browser/spellchecker/spellcheck_host_impl.cc @@ -324,7 +324,7 @@ void SpellCheckHostImpl::WriteWordToCustomDictionary(const std::string& word) { void SpellCheckHostImpl::OnURLFetchComplete(const net::URLFetcher* source) { DCHECK(source); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - scoped_ptr<content::URLFetcher> fetcher_destructor(fetcher_.release()); + scoped_ptr<net::URLFetcher> fetcher_destructor(fetcher_.release()); if ((source->GetResponseCode() / 100) != 2) { // Initialize will not try to download the file a second time. diff --git a/chrome/browser/spellchecker/spellcheck_host_impl.h b/chrome/browser/spellchecker/spellcheck_host_impl.h index a7c4fe8..05bd9fe 100644 --- a/chrome/browser/spellchecker/spellcheck_host_impl.h +++ b/chrome/browser/spellchecker/spellcheck_host_impl.h @@ -18,7 +18,11 @@ #include "chrome/browser/spellchecker/spellcheck_profile_provider.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "content/public/common/url_fetcher_delegate.h" +#include "net/url_request/url_fetcher_delegate.h" + +namespace net { +class URLFetcher; +} // namespace net // This class implements the SpellCheckHost interface to provide the // functionalities listed below: @@ -41,7 +45,7 @@ // Available languages for the checker, which we need to specify via Create(), // can be listed using SpellCheckHost::GetAvailableLanguages() static method. class SpellCheckHostImpl : public SpellCheckHost, - public content::URLFetcherDelegate, + public net::URLFetcherDelegate, public content::NotificationObserver { public: SpellCheckHostImpl(SpellCheckProfileProvider* profile, @@ -107,7 +111,7 @@ class SpellCheckHostImpl : public SpellCheckHost, // Returns true if the dictionary is ready to use. virtual bool IsReady() const OVERRIDE; - // content::URLFetcherDelegate implementation. Called when we finish + // net::URLFetcherDelegate implementation. Called when we finish // downloading the spellcheck dictionary; saves the dictionary to |data_|. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; @@ -159,7 +163,7 @@ class SpellCheckHostImpl : public SpellCheckHost, net::URLRequestContextGetter* request_context_getter_; // Used for downloading the dictionary file. - scoped_ptr<content::URLFetcher> fetcher_; + scoped_ptr<net::URLFetcher> fetcher_; content::NotificationRegistrar registrar_; diff --git a/chrome/browser/spellchecker/spelling_service_client.cc b/chrome/browser/spellchecker/spelling_service_client.cc index b399248..7ca3717 100644 --- a/chrome/browser/spellchecker/spelling_service_client.cc +++ b/chrome/browser/spellchecker/spelling_service_client.cc @@ -110,7 +110,7 @@ bool SpellingServiceClient::RequestTextCheck( void SpellingServiceClient::OnURLFetchComplete( const net::URLFetcher* source) { - scoped_ptr<content::URLFetcher> clean_up_fetcher(fetcher_.release()); + scoped_ptr<net::URLFetcher> clean_up_fetcher(fetcher_.release()); bool success = false; std::vector<SpellCheckResult> results; if (source->GetResponseCode() / 100 == 2) { @@ -121,7 +121,7 @@ void SpellingServiceClient::OnURLFetchComplete( callback_.Run(tag_, success, results); } -content::URLFetcher* SpellingServiceClient::CreateURLFetcher(const GURL& url) { +net::URLFetcher* SpellingServiceClient::CreateURLFetcher(const GURL& url) { return content::URLFetcher::Create(url, content::URLFetcher::POST, this); } diff --git a/chrome/browser/spellchecker/spelling_service_client.h b/chrome/browser/spellchecker/spelling_service_client.h index a4ece9d..ebbb5f9 100644 --- a/chrome/browser/spellchecker/spelling_service_client.h +++ b/chrome/browser/spellchecker/spelling_service_client.h @@ -13,13 +13,17 @@ #include "base/compiler_specific.h" #include "base/memory/scoped_ptr.h" #include "base/string16.h" -#include "content/public/common/url_fetcher_delegate.h" +#include "net/url_request/url_fetcher_delegate.h" class GURL; class Profile; class TextCheckClientDelegate; struct SpellCheckResult; +namespace net { +class URLFetcher; +} // namespace net + // A class that encapsulates a JSON-RPC call to the Spelling service to check // text there. This class creates a JSON-RPC request, sends the request to the // service with URLFetcher, parses a response from the service, and calls a @@ -50,7 +54,7 @@ struct SpellCheckResult; // scoped_ptr<SpellingServiceClient> client_; // }; // -class SpellingServiceClient : public content::URLFetcherDelegate { +class SpellingServiceClient : public net::URLFetcherDelegate { public: // Service types provided by the Spelling service. The Spelling service // consists of a couple of backends: @@ -71,7 +75,7 @@ class SpellingServiceClient : public content::URLFetcherDelegate { SpellingServiceClient(); virtual ~SpellingServiceClient(); - // content::URLFetcherDelegate implementation. + // net::URLFetcherDelegate implementation. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // Sends a text-check request to the Spelling service. When we send a request @@ -88,14 +92,14 @@ class SpellingServiceClient : public content::URLFetcherDelegate { // Creates a URLFetcher object used for sending a JSON-RPC request. This // function is overriden by unit tests to prevent them from actually sending // requests to the Spelling service. - virtual content::URLFetcher* CreateURLFetcher(const GURL& url); + virtual net::URLFetcher* CreateURLFetcher(const GURL& url); // Parses a JSON-RPC response from the Spelling service. bool ParseResponse(const std::string& data, std::vector<SpellCheckResult>* results); // The URLFetcher object used for sending a JSON-RPC request. - scoped_ptr<content::URLFetcher> fetcher_; + scoped_ptr<net::URLFetcher> fetcher_; // The callback function to be called when we receive a response from the // Spelling service and parse it. diff --git a/chrome/browser/spellchecker/spelling_service_client_unittest.cc b/chrome/browser/spellchecker/spelling_service_client_unittest.cc index ddf8c77..5444ab7 100644 --- a/chrome/browser/spellchecker/spelling_service_client_unittest.cc +++ b/chrome/browser/spellchecker/spelling_service_client_unittest.cc @@ -28,7 +28,7 @@ class TestSpellingURLFetcher : public TestURLFetcher { public: TestSpellingURLFetcher(int id, const GURL& url, - content::URLFetcherDelegate* d, + net::URLFetcherDelegate* d, int version, const std::string& text, int status, diff --git a/chrome/browser/sync/glue/http_bridge.cc b/chrome/browser/sync/glue/http_bridge.cc index ebf08e5..d8bf723 100644 --- a/chrome/browser/sync/glue/http_bridge.cc +++ b/chrome/browser/sync/glue/http_bridge.cc @@ -276,7 +276,7 @@ void HttpBridge::Abort() { http_post_completed_.Signal(); } -void HttpBridge::DestroyURLFetcherOnIOThread(content::URLFetcher* fetcher) { +void HttpBridge::DestroyURLFetcherOnIOThread(net::URLFetcher* fetcher) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); delete fetcher; } diff --git a/chrome/browser/sync/glue/http_bridge.h b/chrome/browser/sync/glue/http_bridge.h index 2131440..c05b113 100644 --- a/chrome/browser/sync/glue/http_bridge.h +++ b/chrome/browser/sync/glue/http_bridge.h @@ -14,8 +14,8 @@ #include "base/memory/ref_counted.h" #include "base/synchronization/lock.h" #include "base/synchronization/waitable_event.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" #include "sync/internal_api/http_post_provider_factory.h" @@ -26,6 +26,7 @@ class HttpBridgeTest; namespace net { class HttpResponseHeaders; +class URLFetcher; } namespace browser_sync { @@ -38,7 +39,7 @@ namespace browser_sync { // needs to stick around across context switches, etc. class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, public sync_api::HttpPostProviderInterface, - public content::URLFetcherDelegate { + public net::URLFetcherDelegate { public: // A request context used for HTTP requests bridged from the sync backend. // A bridged RequestContext has a dedicated in-memory cookie store and does @@ -122,7 +123,7 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, virtual const std::string GetResponseHeaderValue( const std::string& name) const OVERRIDE; - // content::URLFetcherDelegate implementation. + // net::URLFetcherDelegate implementation. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; #if defined(UNIT_TEST) @@ -151,7 +152,7 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, // a reference to |this| is held while flushing any pending fetch completion // callbacks coming from the IO thread en route to finally destroying the // fetcher. - void DestroyURLFetcherOnIOThread(content::URLFetcher* fetcher); + void DestroyURLFetcherOnIOThread(net::URLFetcher* fetcher); // Gets a customized net::URLRequestContext for bridged requests. See // RequestContext definition for details. @@ -185,7 +186,7 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, // NOTE: This is not a scoped_ptr for a reason. It must be deleted on the // same thread that created it, which isn't the same thread |this| gets // deleted on. We must manually delete url_poster_ on the IO loop. - content::URLFetcher* url_poster; + net::URLFetcher* url_poster; // Used to support 'Abort' functionality. bool aborted; diff --git a/chrome/browser/sync/glue/http_bridge_unittest.cc b/chrome/browser/sync/glue/http_bridge_unittest.cc index 7e38744..5be1506 100644 --- a/chrome/browser/sync/glue/http_bridge_unittest.cc +++ b/chrome/browser/sync/glue/http_bridge_unittest.cc @@ -6,10 +6,10 @@ #include "base/synchronization/waitable_event.h" #include "base/threading/thread.h" #include "chrome/browser/sync/glue/http_bridge.h" -#include "content/public/common/url_fetcher_delegate.h" #include "content/test/test_browser_thread.h" #include "content/test/test_url_fetcher_factory.h" #include "net/test/test_server.h" +#include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_request_test_util.h" #include "testing/gtest/include/gtest/gtest.h" @@ -378,8 +378,8 @@ TEST_F(SyncHttpBridgeTest, AbortAndReleaseBeforeFetchComplete) { // Schedule the fetch completion callback (but don't run it yet). Don't take // a reference to the bridge to mimic URLFetcher's handling of the delegate. - content::URLFetcherDelegate* delegate = - static_cast<content::URLFetcherDelegate*>(bridge_for_race_test()); + net::URLFetcherDelegate* delegate = + static_cast<net::URLFetcherDelegate*>(bridge_for_race_test()); net::ResponseCookies cookies; std::string response_content = "success!"; TestURLFetcher fetcher(0, GURL(), NULL); @@ -389,7 +389,7 @@ TEST_F(SyncHttpBridgeTest, AbortAndReleaseBeforeFetchComplete) { fetcher.SetResponseString(response_content); ASSERT_TRUE(BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - base::Bind(&content::URLFetcherDelegate::OnURLFetchComplete, + base::Bind(&net::URLFetcherDelegate::OnURLFetchComplete, base::Unretained(delegate), &fetcher))); // Abort the fetch. This should be smart enough to handle the case where diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index f7784a6..f7ea163 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc @@ -37,7 +37,6 @@ #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/web_contents.h" #include "content/public/common/url_fetcher.h" -#include "content/public/common/url_fetcher_delegate.h" #include "content/test/test_browser_thread.h" #include "content/test/test_url_fetcher_factory.h" #include "googleurl/src/gurl.h" @@ -48,6 +47,7 @@ #include "net/proxy/proxy_config_service_fixed.h" #include "net/proxy/proxy_service.h" #include "net/test/test_server.h" +#include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_status.h" @@ -64,7 +64,7 @@ const char kSyncServerCommandLine[] = "sync-server-command-line"; } // Helper class that checks whether a sync test server is running or not. -class SyncServerStatusChecker : public content::URLFetcherDelegate { +class SyncServerStatusChecker : public net::URLFetcherDelegate { public: SyncServerStatusChecker() : running_(false) {} diff --git a/chrome/browser/tab_contents/render_view_context_menu.h b/chrome/browser/tab_contents/render_view_context_menu.h index ad6406b..6eaac87 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.h +++ b/chrome/browser/tab_contents/render_view_context_menu.h @@ -56,7 +56,7 @@ struct WebPluginAction; // The following snippet describes the simple usage that updates a context-menu // item with this interface. // -// class MyTask : public content::URLFetcherDelegate { +// class MyTask : public net::URLFetcherDelegate { // public: // MyTask(RenderViewContextMenuProxy* proxy, int id) // : proxy_(proxy), diff --git a/chrome/browser/tab_contents/spelling_menu_observer.h b/chrome/browser/tab_contents/spelling_menu_observer.h index a5f2339..be0e1b4 100644 --- a/chrome/browser/tab_contents/spelling_menu_observer.h +++ b/chrome/browser/tab_contents/spelling_menu_observer.h @@ -23,7 +23,7 @@ class SpellingServiceClient; // while we show it. This class implements two interfaces: // * RenderViewContextMenuObserver // This interface is used for adding a menu item and update it while showing. -// * content::URLFetcherDelegate +// * net::URLFetcherDelegate // This interface is used for sending a JSON_RPC request to the Spelling // service and retrieving its response. // These interfaces allow this class to make a JSON-RPC call to the Spelling diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index 21565cf..d659bb9 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.cc @@ -423,7 +423,7 @@ void TranslateManager::OnURLFetchComplete(const net::URLFetcher* source) { (source->GetStatus().status() != net::URLRequestStatus::SUCCESS || source->GetResponseCode() != 200); if (translate_script_request_pending_.get() == source) { - scoped_ptr<const content::URLFetcher> delete_ptr( + scoped_ptr<const net::URLFetcher> delete_ptr( translate_script_request_pending_.release()); if (!error) { base::StringPiece str = ResourceBundle::GetSharedInstance(). @@ -477,7 +477,7 @@ void TranslateManager::OnURLFetchComplete(const net::URLFetcher* source) { } pending_requests_.clear(); } else { // if (translate_script_request_pending_.get() == source) - scoped_ptr<const content::URLFetcher> delete_ptr( + scoped_ptr<const net::URLFetcher> delete_ptr( language_list_request_pending_.release()); if (!error) { std::string data; diff --git a/chrome/browser/translate/translate_manager.h b/chrome/browser/translate/translate_manager.h index 3ee3c83..2b9c9b2 100644 --- a/chrome/browser/translate/translate_manager.h +++ b/chrome/browser/translate/translate_manager.h @@ -20,7 +20,7 @@ #include "chrome/common/translate_errors.h" #include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_registrar.h" -#include "content/public/common/url_fetcher_delegate.h" +#include "net/url_request/url_fetcher_delegate.h" template <typename T> struct DefaultSingletonTraits; class GURL; @@ -32,13 +32,17 @@ namespace content { class WebContents; } +namespace net { +class URLFetcher; +} + // The TranslateManager class is responsible for showing an info-bar when a page // in a language different than the user language is loaded. It triggers the // page translation the user requests. // It is a singleton. class TranslateManager : public content::NotificationObserver, - public content::URLFetcherDelegate { + public net::URLFetcherDelegate { public: // Returns the singleton instance. static TranslateManager* GetInstance(); @@ -79,7 +83,7 @@ class TranslateManager : public content::NotificationObserver, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; - // content::URLFetcherDelegate implementation: + // net::URLFetcherDelegate implementation: virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // Used by unit-tests to override the default delay after which the translate @@ -208,11 +212,11 @@ class TranslateManager : public content::NotificationObserver, base::TimeDelta translate_script_expiration_delay_; // Set when the translate JS is currently being retrieved. NULL otherwise. - scoped_ptr<content::URLFetcher> translate_script_request_pending_; + scoped_ptr<net::URLFetcher> translate_script_request_pending_; // Set when the list of languages is currently being retrieved. // NULL otherwise. - scoped_ptr<content::URLFetcher> language_list_request_pending_; + scoped_ptr<net::URLFetcher> language_list_request_pending_; // The list of pending translate requests. Translate requests are queued when // the translate script is not ready and has to be fetched from the translate diff --git a/chrome/browser/ui/intents/web_intent_picker_controller.cc b/chrome/browser/ui/intents/web_intent_picker_controller.cc index 7af6b43..67997cd 100644 --- a/chrome/browser/ui/intents/web_intent_picker_controller.cc +++ b/chrome/browser/ui/intents/web_intent_picker_controller.cc @@ -34,9 +34,9 @@ #include "content/public/browser/web_contents.h" #include "content/public/browser/web_intents_dispatcher.h" #include "content/public/common/url_fetcher.h" -#include "content/public/common/url_fetcher_delegate.h" #include "grit/generated_resources.h" #include "net/base/load_flags.h" +#include "net/url_request/url_fetcher_delegate.h" #include "skia/ext/image_operations.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/codec/png_codec.h" @@ -100,7 +100,7 @@ string16 GetIntentActionString(const std::string& action) { } // Self-deleting trampoline that forwards A URLFetcher response to a callback. -class URLFetcherTrampoline : public content::URLFetcherDelegate { +class URLFetcherTrampoline : public net::URLFetcherDelegate { public: typedef base::Callback<void(const net::URLFetcher* source)> ForwardingCallback; @@ -108,7 +108,7 @@ class URLFetcherTrampoline : public content::URLFetcherDelegate { explicit URLFetcherTrampoline(const ForwardingCallback& callback); ~URLFetcherTrampoline(); - // content::URLFetcherDelegate implementation. + // net::URLFetcherDelegate implementation. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; private: diff --git a/chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc b/chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc index 6528dab..f7d512c 100644 --- a/chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc +++ b/chrome/browser/ui/intents/web_intent_picker_controller_browsertest.cc @@ -8,11 +8,11 @@ #include "base/bind.h" #include "base/callback.h" #include "base/memory/scoped_ptr.h" -#include "base/stringprintf.h" #include "base/string_util.h" +#include "base/stringprintf.h" #include "base/utf_string_conversions.h" -#include "chrome/browser/intents/default_web_intent_service.h" #include "chrome/browser/favicon/favicon_service.h" +#include "chrome/browser/intents/default_web_intent_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/intents/web_intent_picker.h" @@ -85,7 +85,7 @@ class DummyURLFetcherFactory : public content::URLFetcherFactory { int id, const GURL& url, content::URLFetcher::RequestType request_type, - content::URLFetcherDelegate* d) OVERRIDE { + net::URLFetcherDelegate* d) OVERRIDE { return new TestURLFetcher(id, url, d); } }; diff --git a/chrome/browser/ui/webui/ntp/suggestions_source_discovery.cc b/chrome/browser/ui/webui/ntp/suggestions_source_discovery.cc index 2de116c..85377d6 100644 --- a/chrome/browser/ui/webui/ntp/suggestions_source_discovery.cc +++ b/chrome/browser/ui/webui/ntp/suggestions_source_discovery.cc @@ -16,10 +16,10 @@ #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" #include "chrome/browser/ui/webui/ntp/suggestions_combiner.h" #include "content/public/common/url_fetcher.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" #include "net/base/load_flags.h" #include "net/http/http_status_code.h" +#include "net/url_request/url_fetcher_delegate.h" #include "net/url_request/url_request_status.h" namespace { diff --git a/chrome/browser/ui/webui/ntp/suggestions_source_discovery.h b/chrome/browser/ui/webui/ntp/suggestions_source_discovery.h index ac7ae9b..4e7d369 100644 --- a/chrome/browser/ui/webui/ntp/suggestions_source_discovery.h +++ b/chrome/browser/ui/webui/ntp/suggestions_source_discovery.h @@ -11,24 +11,27 @@ #include "chrome/browser/cancelable_request.h" #include "chrome/browser/history/history_types.h" #include "chrome/browser/ui/webui/ntp/suggestions_source.h" -#include "content/public/common/url_fetcher_delegate.h" +#include "net/url_request/url_fetcher_delegate.h" class SuggestionsCombiner; class Profile; -class URLFetcher; namespace base { class DictionaryValue; } +namespace net { +class URLFetcher; +} + // A source that suggests websites the user might find interesting. class SuggestionsSourceDiscovery : public SuggestionsSource, - public content::URLFetcherDelegate { + public net::URLFetcherDelegate { public: SuggestionsSourceDiscovery(); virtual ~SuggestionsSourceDiscovery(); - // content::URLFetcherDelegate override and implementation. + // net::URLFetcherDelegate override and implementation. virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; protected: @@ -47,7 +50,7 @@ class SuggestionsSourceDiscovery : public SuggestionsSource, std::deque<base::DictionaryValue*> items_; // Fetcher for the recommended pages. - scoped_ptr<content::URLFetcher> recommended_fetcher_; + scoped_ptr<net::URLFetcher> recommended_fetcher_; DISALLOW_COPY_AND_ASSIGN(SuggestionsSourceDiscovery); }; diff --git a/chrome/browser/web_resource/web_resource_service.cc b/chrome/browser/web_resource/web_resource_service.cc index 484ec0c..275aa53 100644 --- a/chrome/browser/web_resource/web_resource_service.cc +++ b/chrome/browser/web_resource/web_resource_service.cc @@ -222,7 +222,7 @@ void WebResourceService::StartFetch() { void WebResourceService::OnURLFetchComplete(const net::URLFetcher* source) { // Delete the URLFetcher when this function exits. - scoped_ptr<content::URLFetcher> clean_up_fetcher(url_fetcher_.release()); + scoped_ptr<net::URLFetcher> clean_up_fetcher(url_fetcher_.release()); // Don't parse data if attempt to download was unsuccessful. // Stop loading new web resource data, and silently exit. diff --git a/chrome/browser/web_resource/web_resource_service.h b/chrome/browser/web_resource/web_resource_service.h index 02e88e6..af44a47 100644 --- a/chrome/browser/web_resource/web_resource_service.h +++ b/chrome/browser/web_resource/web_resource_service.h @@ -11,8 +11,8 @@ #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" -#include "content/public/common/url_fetcher_delegate.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_fetcher_delegate.h" class PrefService; class ResourceDispatcherHost; @@ -21,11 +21,15 @@ namespace base { class DictionaryValue; } +namespace net { +class URLFetcher; +} + // A WebResourceService fetches JSON data from a web server and periodically // refreshes it. class WebResourceService : public base::RefCountedThreadSafe<WebResourceService>, - public content::URLFetcherDelegate { + public net::URLFetcherDelegate { public: WebResourceService(PrefService* prefs, const GURL& web_resource_server, @@ -50,7 +54,7 @@ class WebResourceService class UnpackerClient; friend class base::RefCountedThreadSafe<WebResourceService>; - // content::URLFetcherDelegate implementation: + // net::URLFetcherDelegate implementation: virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; // Schedules a fetch after |delay_ms| milliseconds. @@ -67,7 +71,7 @@ class WebResourceService base::WeakPtrFactory<WebResourceService> weak_ptr_factory_; // The tool that fetches the url data from the server. - scoped_ptr<content::URLFetcher> url_fetcher_; + scoped_ptr<net::URLFetcher> url_fetcher_; // True if we are currently fetching or unpacking data. If we are asked to // start a fetch when we are still fetching resource data, schedule another |