summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-26 01:12:22 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-26 01:12:22 +0000
commit36aea270be00f58680c3eff2cfeb7061c35276d5 (patch)
tree08066a2eef66b64f9a98fb16160b9ac90c1a82b1 /chrome/browser
parent28973f008ca89d623ec9ce48518a04436b1c71e4 (diff)
downloadchromium_src-36aea270be00f58680c3eff2cfeb7061c35276d5.zip
chromium_src-36aea270be00f58680c3eff2cfeb7061c35276d5.tar.gz
chromium_src-36aea270be00f58680c3eff2cfeb7061c35276d5.tar.bz2
Convert chrome callers of UrlFetcher to use the interface. I'll switch tests to use composition instead of inheritence in a future change.
BUG=98716 Review URL: http://codereview.chromium.org/8395023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107268 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/alternate_nav_url_fetcher.cc6
-rw-r--r--chrome/browser/autocomplete/search_provider.cc13
-rw-r--r--chrome/browser/autofill/autofill_download.cc9
-rw-r--r--chrome/browser/browser_process_impl.cc4
-rw-r--r--chrome/browser/bug_report_util.cc9
-rw-r--r--chrome/browser/chromeos/customization_document.cc5
-rw-r--r--chrome/browser/chromeos/login/client_login_response_handler.cc10
-rw-r--r--chrome/browser/chromeos/login/cookie_fetcher.cc5
-rw-r--r--chrome/browser/chromeos/login/image_downloader.cc5
-rw-r--r--chrome/browser/chromeos/login/issue_response_handler.cc6
-rw-r--r--chrome/browser/chromeos/login/profile_image_downloader.cc10
-rw-r--r--chrome/browser/chromeos/media/media_player.cc1
-rw-r--r--chrome/browser/component_updater/component_updater_service.cc8
-rw-r--r--chrome/browser/extensions/app_notify_channel_setup.cc6
-rw-r--r--chrome/browser/extensions/apps_promo.cc6
-rw-r--r--chrome/browser/extensions/extension_updater.cc12
-rw-r--r--chrome/browser/extensions/webstore_inline_installer.cc4
-rw-r--r--chrome/browser/extensions/webstore_install_helper.cc5
-rw-r--r--chrome/browser/google/google_url_tracker.cc7
-rw-r--r--chrome/browser/importer/toolbar_importer.cc8
-rw-r--r--chrome/browser/intranet_redirect_detector.cc5
-rw-r--r--chrome/browser/io_thread.cc4
-rw-r--r--chrome/browser/metrics/metrics_service.cc7
-rw-r--r--chrome/browser/net/gaia/gaia_oauth_fetcher.cc11
-rw-r--r--chrome/browser/net/sdch_dictionary_fetcher.cc7
-rw-r--r--chrome/browser/plugin_download_helper.cc6
-rw-r--r--chrome/browser/policy/device_management_backend_impl.cc2
-rw-r--r--chrome/browser/policy/device_management_service.cc6
-rw-r--r--chrome/browser/safe_browsing/client_side_detection_service.cc16
-rw-r--r--chrome/browser/safe_browsing/download_protection_service.cc9
-rw-r--r--chrome/browser/safe_browsing/malware_details_cache.cc8
-rw-r--r--chrome/browser/safe_browsing/protocol_manager.cc23
-rw-r--r--chrome/browser/search_engines/template_url_fetcher.cc12
-rw-r--r--chrome/browser/spellchecker/spellcheck_host_impl.cc5
-rw-r--r--chrome/browser/sync/glue/http_bridge.cc6
-rw-r--r--chrome/browser/tab_contents/spelling_menu_observer.cc5
-rw-r--r--chrome/browser/translate/translate_manager.cc10
-rw-r--r--chrome/browser/ui/webui/active_downloads_ui.cc1
-rw-r--r--chrome/browser/web_resource/web_resource_service.cc7
39 files changed, 149 insertions, 140 deletions
diff --git a/chrome/browser/alternate_nav_url_fetcher.cc b/chrome/browser/alternate_nav_url_fetcher.cc
index b948956..cc1035d 100644
--- a/chrome/browser/alternate_nav_url_fetcher.cc
+++ b/chrome/browser/alternate_nav_url_fetcher.cc
@@ -14,7 +14,7 @@
#include "content/browser/tab_contents/navigation_controller.h"
#include "content/browser/tab_contents/navigation_entry.h"
#include "content/public/browser/notification_service.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources_standard.h"
#include "net/base/registry_controlled_domain.h"
@@ -178,8 +178,8 @@ void AlternateNavURLFetcher::StartFetch(NavigationController* controller) {
DCHECK_EQ(NOT_STARTED, state_);
state_ = IN_PROGRESS;
- fetcher_.reset(new URLFetcher(GURL(alternate_nav_url_), URLFetcher::HEAD,
- this));
+ fetcher_.reset(content::URLFetcher::Create(
+ GURL(alternate_nav_url_), content::URLFetcher::HEAD, this));
fetcher_->SetRequestContext(
controller_->browser_context()->GetRequestContext());
fetcher_->Start();
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index c9ef2c2..9453e19 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -28,7 +28,7 @@
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "googleurl/src/url_util.h"
#include "grit/generated_resources.h"
#include "net/base/escape.h"
@@ -438,10 +438,13 @@ content::URLFetcher* SearchProvider::CreateSuggestFetcher(
const string16& text) {
const TemplateURLRef* const suggestions_url = provider.suggestions_url();
DCHECK(suggestions_url->SupportsReplacement());
- URLFetcher* fetcher = URLFetcher::Create(id,
- GURL(suggestions_url->ReplaceSearchTermsUsingProfile(profile_, provider,
- text, TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16())),
- URLFetcher::GET, this);
+ content::URLFetcher* fetcher = content::URLFetcher::Create(
+ id,
+ GURL(suggestions_url->ReplaceSearchTermsUsingProfile(
+ profile_, provider, text, TemplateURLRef::NO_SUGGESTIONS_AVAILABLE,
+ string16())),
+ content::URLFetcher::GET,
+ this);
fetcher->SetRequestContext(profile_->GetRequestContext());
fetcher->Start();
return fetcher;
diff --git a/chrome/browser/autofill/autofill_download.cc b/chrome/browser/autofill/autofill_download.cc
index 194a563..69f151d 100644
--- a/chrome/browser/autofill/autofill_download.cc
+++ b/chrome/browser/autofill/autofill_download.cc
@@ -18,7 +18,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "googleurl/src/gurl.h"
#include "net/http/http_response_headers.h"
#include "third_party/libjingle/source/talk/xmllite/xmlparser.h"
@@ -196,10 +196,9 @@ bool AutofillDownloadManager::StartRequest(
// Id is ignored for regular chrome, in unit test id's for fake fetcher
// factory will be 0, 1, 2, ...
- URLFetcher *fetcher = URLFetcher::Create(fetcher_id_for_unittest_++,
- GURL(request_url),
- URLFetcher::POST,
- this);
+ content::URLFetcher* fetcher = content::URLFetcher::Create(
+ fetcher_id_for_unittest_++, GURL(request_url), content::URLFetcher::POST,
+ this);
url_fetchers_[fetcher] = request_data;
fetcher->SetAutomaticallyRetryOn5xx(false);
fetcher->SetRequestContext(request_context);
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 99a0c92..17926f7 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -83,8 +83,8 @@
#include "content/browser/plugin_service.h"
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/resource_dispatcher_host.h"
-#include "content/common/net/url_fetcher.h"
#include "content/public/browser/notification_details.h"
+#include "content/public/common/url_fetcher.h"
#include "ipc/ipc_logging.h"
#include "net/socket/client_socket_pool_manager.h"
#include "net/url_request/url_request_context_getter.h"
@@ -221,7 +221,7 @@ BrowserProcessImpl::~BrowserProcessImpl() {
// but we have some URLFetchers using the DefaultRequestContext, so they need
// to be cancelled too. Remove this when DefaultRequestContext goes away.
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
- NewRunnableFunction(&URLFetcher::CancelAll));
+ NewRunnableFunction(&content::URLFetcher::CancelAll));
// Need to clear profiles (download managers) before the io_thread_.
profile_manager_.reset();
diff --git a/chrome/browser/bug_report_util.cc b/chrome/browser/bug_report_util.cc
index 1adb185..24eff64 100644
--- a/chrome/browser/bug_report_util.cc
+++ b/chrome/browser/bug_report_util.cc
@@ -22,7 +22,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/common/net/url_fetcher.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"
@@ -188,10 +188,9 @@ void BugReportUtil::SendFeedback(Profile* profile,
else
post_url = GURL(kBugReportPostUrl);
- URLFetcher* fetcher = new URLFetcher(post_url, URLFetcher::POST,
- new BugReportUtil::PostCleanup(profile,
- post_body,
- previous_delay));
+ content::URLFetcher* fetcher = content::URLFetcher::Create(
+ post_url, content::URLFetcher::POST,
+ new BugReportUtil::PostCleanup(profile, post_body, previous_delay));
fetcher->SetRequestContext(profile->GetRequestContext());
fetcher->SetUploadData(std::string(kProtBufMimeType), *post_body);
diff --git a/chrome/browser/chromeos/customization_document.cc b/chrome/browser/chromeos/customization_document.cc
index 49f6ede..a635ee7 100644
--- a/chrome/browser/chromeos/customization_document.cc
+++ b/chrome/browser/chromeos/customization_document.cc
@@ -20,7 +20,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "content/browser/browser_thread.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
// Manifest attributes names.
@@ -294,7 +294,8 @@ void ServicesCustomizationDocument::ReadFileInBackground(const FilePath& file) {
void ServicesCustomizationDocument::StartFileFetch() {
DCHECK(url_.is_valid());
- url_fetcher_.reset(new URLFetcher(url_, URLFetcher::GET, this));
+ url_fetcher_.reset(content::URLFetcher::Create(
+ url_, content::URLFetcher::GET, this));
url_fetcher_->SetRequestContext(
ProfileManager::GetDefaultProfile()->GetRequestContext());
url_fetcher_->Start();
diff --git a/chrome/browser/chromeos/login/client_login_response_handler.cc b/chrome/browser/chromeos/login/client_login_response_handler.cc
index e66f569..e56bd5d 100644
--- a/chrome/browser/chromeos/login/client_login_response_handler.cc
+++ b/chrome/browser/chromeos/login/client_login_response_handler.cc
@@ -10,7 +10,7 @@
#include "chrome/browser/chromeos/login/google_authenticator.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/common/net/gaia/gaia_urls.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "net/base/load_flags.h"
namespace chromeos {
@@ -33,10 +33,10 @@ content::URLFetcher* ClientLoginResponseHandler::Handle(
std::replace(payload_.begin(), payload_.end(), '\n', '&');
payload_.append(kService);
- URLFetcher* fetcher =
- new URLFetcher(GURL(GaiaUrls::GetInstance()->issue_auth_token_url()),
- URLFetcher::POST,
- catcher);
+ content::URLFetcher* fetcher = content::URLFetcher::Create(
+ GURL(GaiaUrls::GetInstance()->issue_auth_token_url()),
+ content::URLFetcher::POST,
+ catcher);
fetcher->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES);
fetcher->SetUploadData("application/x-www-form-urlencoded", payload_);
if (getter_) {
diff --git a/chrome/browser/chromeos/login/cookie_fetcher.cc b/chrome/browser/chromeos/login/cookie_fetcher.cc
index 8f78bfc..53d57d5 100644
--- a/chrome/browser/chromeos/login/cookie_fetcher.cc
+++ b/chrome/browser/chromeos/login/cookie_fetcher.cc
@@ -13,7 +13,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_paths.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "net/url_request/url_request_status.h"
namespace chromeos {
@@ -41,8 +41,7 @@ void CookieFetcher::AttemptFetch(const std::string& credentials) {
fetcher_.reset(client_login_handler_->Handle(credentials, this));
}
-void CookieFetcher::
-OnURLFetchComplete(const content::URLFetcher* source) {
+void CookieFetcher::OnURLFetchComplete(const content::URLFetcher* source) {
if (source->GetStatus().is_success() &&
source->GetResponseCode() == kHttpSuccess) {
if (issue_handler_->CanHandle(source->GetUrl())) {
diff --git a/chrome/browser/chromeos/login/image_downloader.cc b/chrome/browser/chromeos/login/image_downloader.cc
index afc0485..9883593 100644
--- a/chrome/browser/chromeos/login/image_downloader.cc
+++ b/chrome/browser/chromeos/login/image_downloader.cc
@@ -12,7 +12,7 @@
#include "base/stringprintf.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "content/browser/browser_thread.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
namespace chromeos {
@@ -28,7 +28,8 @@ ImageDownloader::ImageDownloader(ImageDecoder::Delegate* delegate,
const std::string& auth_token)
: delegate_(delegate) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- image_fetcher_.reset(new URLFetcher(GURL(image_url), URLFetcher::GET, this));
+ image_fetcher_.reset(content::URLFetcher::Create(
+ GURL(image_url), content::URLFetcher::GET, this));
image_fetcher_->SetRequestContext(
ProfileManager::GetDefaultProfile()->GetRequestContext());
if (!auth_token.empty()) {
diff --git a/chrome/browser/chromeos/login/issue_response_handler.cc b/chrome/browser/chromeos/login/issue_response_handler.cc
index f55d760..78eb2d3 100644
--- a/chrome/browser/chromeos/login/issue_response_handler.cc
+++ b/chrome/browser/chromeos/login/issue_response_handler.cc
@@ -9,7 +9,7 @@
#include "base/stringprintf.h"
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/common/net/gaia/gaia_urls.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "net/base/load_flags.h"
namespace chromeos {
@@ -26,8 +26,8 @@ content::URLFetcher* IssueResponseHandler::Handle(
content::URLFetcherDelegate* catcher) {
VLOG(1) << "Handling IssueAuthToken response";
token_url_.assign(BuildTokenAuthUrlWithToken(to_process));
- URLFetcher* fetcher =
- new URLFetcher(GURL(token_url_), URLFetcher::GET, catcher);
+ content::URLFetcher* fetcher = content::URLFetcher::Create(
+ GURL(token_url_), content::URLFetcher::GET, catcher);
fetcher->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES);
if (getter_) {
VLOG(1) << "Fetching " << GaiaUrls::GetInstance()->token_auth_url();
diff --git a/chrome/browser/chromeos/login/profile_image_downloader.cc b/chrome/browser/chromeos/login/profile_image_downloader.cc
index bba4bcf..6093fef 100644
--- a/chrome/browser/chromeos/login/profile_image_downloader.cc
+++ b/chrome/browser/chromeos/login/profile_image_downloader.cc
@@ -18,12 +18,12 @@
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/net/gaia/gaia_constants.h"
#include "content/browser/browser_thread.h"
-#include "content/common/net/url_fetcher.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/common/url_fetcher.h"
#include "googleurl/src/gurl.h"
#include "skia/ext/image_operations.h"
@@ -141,8 +141,8 @@ void ProfileImageDownloader::StartFetchingImage() {
if (email.empty())
return;
VLOG(1) << "Fetching user entry with token: " << auth_token_;
- user_entry_fetcher_.reset(
- new URLFetcher(GURL(kUserEntryURL), URLFetcher::GET, this));
+ user_entry_fetcher_.reset(content::URLFetcher::Create(
+ GURL(kUserEntryURL), content::URLFetcher::GET, this));
user_entry_fetcher_->SetRequestContext(
ProfileManager::GetDefaultProfile()->GetRequestContext());
if (!auth_token_.empty()) {
@@ -176,8 +176,8 @@ void ProfileImageDownloader::OnURLFetchComplete(
return;
}
VLOG(1) << "Fetching profile image from " << image_url;
- profile_image_fetcher_.reset(
- new URLFetcher(GURL(image_url), URLFetcher::GET, this));
+ profile_image_fetcher_.reset(content::URLFetcher::Create(
+ GURL(image_url), content::URLFetcher::GET, this));
profile_image_fetcher_->SetRequestContext(
ProfileManager::GetDefaultProfile()->GetRequestContext());
if (!auth_token_.empty()) {
diff --git a/chrome/browser/chromeos/media/media_player.cc b/chrome/browser/chromeos/media/media_player.cc
index f62bd6e..05b2a14 100644
--- a/chrome/browser/chromeos/media/media_player.cc
+++ b/chrome/browser/chromeos/media/media_player.cc
@@ -36,7 +36,6 @@
#include "content/browser/download/download_manager.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/browser/user_metrics.h"
-#include "content/common/net/url_fetcher.h"
#include "grit/browser_resources.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
diff --git a/chrome/browser/component_updater/component_updater_service.cc b/chrome/browser/component_updater/component_updater_service.cc
index f3c3e5c..63daf1f 100644
--- a/chrome/browser/component_updater/component_updater_service.cc
+++ b/chrome/browser/component_updater/component_updater_service.cc
@@ -24,9 +24,9 @@
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/extensions/extension.h"
#include "content/browser/utility_process_host.h"
-#include "content/common/net/url_fetcher.h"
#include "content/public/browser/notification_service.h"
#include "content/public/common/url_fetcher_delegate.h"
+#include "content/public/common/url_fetcher.h"
#include "googleurl/src/gurl.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
@@ -492,7 +492,8 @@ void CrxUpdateService::ProcessPendingItems() {
context->pk_hash = item->component.pk_hash;
context->id = item->id;
context->installer = item->component.installer;
- url_fetcher_.reset(URLFetcher::Create(0, item->crx_url, URLFetcher::GET,
+ url_fetcher_.reset(content::URLFetcher::Create(
+ 0, item->crx_url, content::URLFetcher::GET,
MakeContextDelegate(this, context)));
StartFetch(url_fetcher_.get(), config_->RequestContext(), true);
return;
@@ -552,7 +553,8 @@ void CrxUpdateService::ProcessPendingItems() {
const std::string full_query = MakeFinalQuery(config_->UpdateUrl().spec(),
query,
config_->ExtraRequestParams());
- url_fetcher_.reset(URLFetcher::Create(0, GURL(full_query), URLFetcher::GET,
+ url_fetcher_.reset(content::URLFetcher::Create(
+ 0, GURL(full_query), content::URLFetcher::GET,
MakeContextDelegate(this, new UpdateContext())));
StartFetch(url_fetcher_.get(), config_->RequestContext(), false);
}
diff --git a/chrome/browser/extensions/app_notify_channel_setup.cc b/chrome/browser/extensions/app_notify_channel_setup.cc
index 7f45712..8a22cbb 100644
--- a/chrome/browser/extensions/app_notify_channel_setup.cc
+++ b/chrome/browser/extensions/app_notify_channel_setup.cc
@@ -10,7 +10,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "content/browser/browser_thread.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
#include "net/url_request/url_request_status.h"
@@ -73,8 +73,8 @@ void AppNotifyChannelSetup::Start() {
return;
}
- url_fetcher_.reset(URLFetcher::Create(
- 0, channel_server_url, URLFetcher::POST, this));
+ url_fetcher_.reset(content::URLFetcher::Create(
+ 0, channel_server_url, content::URLFetcher::POST, this));
// TODO(asargent) - we eventually want this to use the browser login
// credentials instead of the regular cookie store, but for now to aid server
diff --git a/chrome/browser/extensions/apps_promo.cc b/chrome/browser/extensions/apps_promo.cc
index aa316f7..adc4b44 100644
--- a/chrome/browser/extensions/apps_promo.cc
+++ b/chrome/browser/extensions/apps_promo.cc
@@ -17,7 +17,7 @@
#include "chrome/common/pref_names.h"
#include "content/public/browser/notification_service.h"
#include "content/public/common/url_constants.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "net/base/load_flags.h"
#include "net/url_request/url_request_status.h"
@@ -374,8 +374,8 @@ void AppsPromoLogoFetcher::OnURLFetchComplete(
void AppsPromoLogoFetcher::FetchLogo() {
CHECK(promo_data_.logo.scheme() == chrome::kHttpsScheme);
- url_fetcher_.reset(URLFetcher::Create(
- 0, promo_data_.logo, URLFetcher::GET, this));
+ url_fetcher_.reset(content::URLFetcher::Create(
+ 0, promo_data_.logo, content::URLFetcher::GET, this));
url_fetcher_->SetRequestContext(
g_browser_process->system_request_context());
url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc
index 8bcfb17..3eaa449 100644
--- a/chrome/browser/extensions/extension_updater.cc
+++ b/chrome/browser/extensions/extension_updater.cc
@@ -37,9 +37,9 @@
#include "chrome/common/extensions/extension_file_util.h"
#include "chrome/common/pref_names.h"
#include "content/browser/utility_process_host.h"
-#include "content/common/net/url_fetcher.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/common/url_fetcher.h"
#include "crypto/sha2.h"
#include "googleurl/src/gurl.h"
#include "net/base/escape.h"
@@ -1168,9 +1168,9 @@ void ExtensionUpdater::StartUpdateCheck(ManifestFetchData* fetch_data) {
fetch_data->full_url().possibly_invalid_spec().length());
current_manifest_fetch_.swap(scoped_fetch_data);
- manifest_fetcher_.reset(
- URLFetcher::Create(kManifestFetcherId, fetch_data->full_url(),
- URLFetcher::GET, this));
+ manifest_fetcher_.reset(content::URLFetcher::Create(
+ kManifestFetcherId, fetch_data->full_url(), content::URLFetcher::GET,
+ this));
manifest_fetcher_->SetRequestContext(profile_->GetRequestContext());
manifest_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SAVE_COOKIES |
@@ -1196,8 +1196,8 @@ void ExtensionUpdater::FetchUpdatedExtension(const std::string& id,
extensions_pending_.push_back(ExtensionFetch(id, url, hash, version));
}
} else {
- extension_fetcher_.reset(
- URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this));
+ extension_fetcher_.reset(content::URLFetcher::Create(
+ kExtensionFetcherId, url, content::URLFetcher::GET, this));
extension_fetcher_->SetRequestContext(
profile_->GetRequestContext());
extension_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
diff --git a/chrome/browser/extensions/webstore_inline_installer.cc b/chrome/browser/extensions/webstore_inline_installer.cc
index c35b2b2..39d1964 100644
--- a/chrome/browser/extensions/webstore_inline_installer.cc
+++ b/chrome/browser/extensions/webstore_inline_installer.cc
@@ -167,8 +167,8 @@ void WebstoreInlineInstaller::BeginInstall() {
GURL webstore_data_url(extension_urls::GetWebstoreItemJsonDataURL(id_));
- webstore_data_url_fetcher_.reset(
- new URLFetcher(webstore_data_url, URLFetcher::GET, this));
+ webstore_data_url_fetcher_.reset(content::URLFetcher::Create(
+ webstore_data_url, content::URLFetcher::GET, this));
Profile* profile = Profile::FromBrowserContext(
tab_contents()->browser_context());
webstore_data_url_fetcher_->SetRequestContext(
diff --git a/chrome/browser/extensions/webstore_install_helper.cc b/chrome/browser/extensions/webstore_install_helper.cc
index 6a0c26d..c06815a 100644
--- a/chrome/browser/extensions/webstore_install_helper.cc
+++ b/chrome/browser/extensions/webstore_install_helper.cc
@@ -10,7 +10,7 @@
#include "base/values.h"
#include "chrome/common/chrome_utility_messages.h"
#include "content/browser/browser_thread.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -54,7 +54,8 @@ void WebstoreInstallHelper::Start() {
if (!icon_url_.is_empty()) {
CHECK(context_getter_);
- url_fetcher_.reset(new URLFetcher(icon_url_, URLFetcher::GET, this));
+ url_fetcher_.reset(content::URLFetcher::Create(
+ icon_url_, content::URLFetcher::GET, this));
url_fetcher_->SetRequestContext(context_getter_);
url_fetcher_->Start();
diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc
index 3e91c12..6d5eb2a 100644
--- a/chrome/browser/google/google_url_tracker.cc
+++ b/chrome/browser/google/google_url_tracker.cc
@@ -22,8 +22,8 @@
#include "chrome/common/pref_names.h"
#include "content/browser/tab_contents/navigation_controller.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/common/net/url_fetcher.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/common/url_fetcher.h"
#include "grit/generated_resources.h"
#include "net/base/load_flags.h"
#include "net/base/net_util.h"
@@ -205,8 +205,9 @@ void GoogleURLTracker::StartFetchIfDesirable() {
return;
already_fetched_ = true;
- fetcher_.reset(URLFetcher::Create(fetcher_id_, GURL(kSearchDomainCheckURL),
- URLFetcher::GET, this));
+ fetcher_.reset(content::URLFetcher::Create(
+ fetcher_id_, GURL(kSearchDomainCheckURL), content::URLFetcher::GET,
+ this));
++fetcher_id_;
// We don't want this fetch to affect existing state in local_state. For
// example, if a user has no Google cookies, this automatic check should not
diff --git a/chrome/browser/importer/toolbar_importer.cc b/chrome/browser/importer/toolbar_importer.cc
index 7689a74..d04aa62 100644
--- a/chrome/browser/importer/toolbar_importer.cc
+++ b/chrome/browser/importer/toolbar_importer.cc
@@ -17,7 +17,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/libxml_utils.h"
#include "content/browser/browser_thread.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "grit/generated_resources.h"
// Toolbar5Importer
@@ -206,7 +206,8 @@ void Toolbar5Importer::GetAuthenticationFromServer() {
random_string);
GURL url(url_string);
- token_fetcher_ = new URLFetcher(url, URLFetcher::GET, this);
+ token_fetcher_ = content::URLFetcher::Create(
+ url, content::URLFetcher::GET, this);
token_fetcher_->SetRequestContext(
Profile::Deprecated::GetDefaultRequestContext());
token_fetcher_->Start();
@@ -240,7 +241,8 @@ void Toolbar5Importer::GetBookmarkDataFromServer(const std::string& response) {
token);
GURL url(conn_string);
- data_fetcher_ = new URLFetcher(url, URLFetcher::GET, this);
+ data_fetcher_ = content::URLFetcher::Create(
+ url, content::URLFetcher::GET, this);
data_fetcher_->SetRequestContext(
Profile::Deprecated::GetDefaultRequestContext());
data_fetcher_->Start();
diff --git a/chrome/browser/intranet_redirect_detector.cc b/chrome/browser/intranet_redirect_detector.cc
index 7f92dc9..e28f2d1 100644
--- a/chrome/browser/intranet_redirect_detector.cc
+++ b/chrome/browser/intranet_redirect_detector.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
#include "net/base/registry_controlled_domain.h"
@@ -80,7 +80,8 @@ void IntranetRedirectDetector::FinishSleep() {
for (size_t j = 0; j < kNumCharsInHostnames; ++j)
url_string += ('a' + base::RandInt(0, 'z' - 'a'));
GURL random_url(url_string + '/');
- URLFetcher* fetcher = new URLFetcher(random_url, URLFetcher::HEAD, this);
+ content::URLFetcher* fetcher = content::URLFetcher::Create(
+ random_url, content::URLFetcher::HEAD, this);
// We don't want these fetches to affect existing state in the profile.
fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE |
net::LOAD_DO_NOT_SAVE_COOKIES);
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 343750d..32acf59 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -33,8 +33,8 @@
#include "content/browser/browser_thread.h"
#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/in_process_webkit/indexed_db_key_utility_client.h"
-#include "content/common/net/url_fetcher.h"
#include "content/public/common/content_client.h"
+#include "content/public/common/url_fetcher.h"
#include "net/base/cert_verifier.h"
#include "net/base/cookie_monster.h"
#include "net/base/default_origin_bound_cert_store.h"
@@ -486,7 +486,7 @@ void IOThread::CleanUp() {
#endif // defined(USE_NSS)
// Destroy all URLRequests started by URLFetchers.
- URLFetcher::CancelAll();
+ content::URLFetcher::CancelAll();
IndexedDBKeyUtilityClient::Shutdown();
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index 43934ec..bd5c099 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -179,8 +179,8 @@
#include "content/browser/plugin_service.h"
#include "content/browser/renderer_host/render_process_host.h"
#include "content/common/child_process_info.h"
-#include "content/common/net/url_fetcher.h"
#include "content/public/browser/notification_service.h"
+#include "content/public/common/url_fetcher.h"
#include "webkit/plugins/npapi/plugin_list.h"
#include "webkit/plugins/webplugininfo.h"
@@ -1037,9 +1037,8 @@ void MetricsService::PrepareFetchWithStagedLog() {
DCHECK(!log_manager_.staged_log_text().empty());
DCHECK(!current_fetch_.get());
- current_fetch_.reset(new URLFetcher(GURL(WideToUTF16(server_url_)),
- URLFetcher::POST,
- this));
+ current_fetch_.reset(content::URLFetcher::Create(
+ GURL(WideToUTF16(server_url_)), content::URLFetcher::POST, this));
current_fetch_->SetRequestContext(
g_browser_process->system_request_context());
current_fetch_->SetUploadData(kMetricsType, log_manager_.staged_log_text());
diff --git a/chrome/browser/net/gaia/gaia_oauth_fetcher.cc b/chrome/browser/net/gaia/gaia_oauth_fetcher.cc
index 50cc589..9ef89d5 100644
--- a/chrome/browser/net/gaia/gaia_oauth_fetcher.cc
+++ b/chrome/browser/net/gaia/gaia_oauth_fetcher.cc
@@ -24,7 +24,7 @@
#include "chrome/common/net/http_return.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "grit/chromium_strings.h"
#include "net/base/load_flags.h"
#include "net/url_request/url_request_context_getter.h"
@@ -65,11 +65,10 @@ content::URLFetcher* GaiaOAuthFetcher::CreateGaiaFetcher(
bool send_cookies,
content::URLFetcherDelegate* delegate) {
bool empty_body = body.empty();
- URLFetcher* result =
- URLFetcher::Create(0,
- gaia_gurl,
- empty_body ? URLFetcher::GET : URLFetcher::POST,
- delegate);
+ content::URLFetcher* result = content::URLFetcher::Create(
+ 0, gaia_gurl,
+ empty_body ? content::URLFetcher::GET : content::URLFetcher::POST,
+ delegate);
result->SetRequestContext(getter);
// The Gaia/OAuth token exchange requests do not require any cookie-based
diff --git a/chrome/browser/net/sdch_dictionary_fetcher.cc b/chrome/browser/net/sdch_dictionary_fetcher.cc
index 9d1b86e..122e976 100644
--- a/chrome/browser/net/sdch_dictionary_fetcher.cc
+++ b/chrome/browser/net/sdch_dictionary_fetcher.cc
@@ -5,8 +5,9 @@
#include "chrome/browser/net/sdch_dictionary_fetcher.h"
#include "base/compiler_specific.h"
+#include "base/message_loop.h"
#include "chrome/browser/profiles/profile.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "net/url_request/url_request_status.h"
SdchDictionaryFetcher::SdchDictionaryFetcher()
@@ -64,8 +65,8 @@ void SdchDictionaryFetcher::StartFetching() {
return;
}
- current_fetch_.reset(new URLFetcher(fetch_queue_.front(), URLFetcher::GET,
- this));
+ current_fetch_.reset(content::URLFetcher::Create(
+ fetch_queue_.front(), content::URLFetcher::GET, this));
fetch_queue_.pop();
current_fetch_->SetRequestContext(context);
current_fetch_->Start();
diff --git a/chrome/browser/plugin_download_helper.cc b/chrome/browser/plugin_download_helper.cc
index 8a707f3..c3a53c7 100644
--- a/chrome/browser/plugin_download_helper.cc
+++ b/chrome/browser/plugin_download_helper.cc
@@ -9,7 +9,7 @@
#include "base/file_util.h"
#include "content/browser/browser_thread.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "net/base/io_buffer.h"
PluginDownloadUrlHelper::PluginDownloadUrlHelper(
@@ -28,8 +28,8 @@ PluginDownloadUrlHelper::~PluginDownloadUrlHelper() {
void PluginDownloadUrlHelper::InitiateDownload(
net::URLRequestContextGetter* request_context,
base::MessageLoopProxy* file_thread_proxy) {
- download_file_fetcher_.reset(
- new URLFetcher(GURL(download_url_), URLFetcher::GET, this));
+ download_file_fetcher_.reset(content::URLFetcher::Create(
+ GURL(download_url_), content::URLFetcher::GET, this));
download_file_fetcher_->SetRequestContext(request_context);
download_file_fetcher_->SaveResponseToTemporaryFile(file_thread_proxy);
download_file_fetcher_->Start();
diff --git a/chrome/browser/policy/device_management_backend_impl.cc b/chrome/browser/policy/device_management_backend_impl.cc
index b69de25..a71f6ed 100644
--- a/chrome/browser/policy/device_management_backend_impl.cc
+++ b/chrome/browser/policy/device_management_backend_impl.cc
@@ -13,7 +13,7 @@
#include "chrome/browser/policy/device_management_service.h"
#include "chrome/browser/policy/enterprise_metrics.h"
#include "chrome/common/chrome_version_info.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
#include "net/url_request/url_request_status.h"
diff --git a/chrome/browser/policy/device_management_service.cc b/chrome/browser/policy/device_management_service.cc
index a01c5e0..ede9949 100644
--- a/chrome/browser/policy/device_management_service.cc
+++ b/chrome/browser/policy/device_management_service.cc
@@ -13,7 +13,7 @@
#include "chrome/browser/policy/device_management_backend_impl.h"
#include "content/browser/browser_thread.h"
#include "content/public/common/content_client.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "net/base/cookie_monster.h"
#include "net/base/host_resolver.h"
#include "net/base/load_flags.h"
@@ -210,8 +210,8 @@ void DeviceManagementService::RemoveJob(DeviceManagementJob* job) {
void DeviceManagementService::StartJob(DeviceManagementJob* job,
bool bypass_proxy) {
- URLFetcher* fetcher = URLFetcher::Create(0, job->GetURL(server_url_),
- URLFetcher::POST, this);
+ content::URLFetcher* fetcher = content::URLFetcher::Create(
+ 0, job->GetURL(server_url_), content::URLFetcher::POST, this);
fetcher->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SAVE_COOKIES |
net::LOAD_DISABLE_CACHE |
diff --git a/chrome/browser/safe_browsing/client_side_detection_service.cc b/chrome/browser/safe_browsing/client_side_detection_service.cc
index 2ea59ed..7bb0e85 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_service.cc
@@ -25,9 +25,9 @@
#include "chrome/common/safe_browsing/safebrowsing_messages.h"
#include "content/browser/browser_thread.h"
#include "content/browser/renderer_host/render_process_host.h"
-#include "content/common/net/url_fetcher.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/common/url_fetcher.h"
#include "crypto/sha2.h"
#include "googleurl/src/gurl.h"
#include "net/base/load_flags.h"
@@ -251,10 +251,9 @@ void ClientSideDetectionService::StartFetchModel() {
if (enabled_) {
// Start fetching the model either from the cache or possibly from the
// network if the model isn't in the cache.
- model_fetcher_.reset(URLFetcher::Create(0 /* ID is not used */,
- GURL(kClientModelUrl),
- URLFetcher::GET,
- this));
+ model_fetcher_.reset(content::URLFetcher::Create(
+ 0 /* ID used for testing */, GURL(kClientModelUrl),
+ content::URLFetcher::GET, this));
model_fetcher_->SetRequestContext(request_context_getter_.get());
model_fetcher_->Start();
}
@@ -307,10 +306,9 @@ void ClientSideDetectionService::StartClientReportPhishingRequest(
return;
}
- URLFetcher* fetcher = URLFetcher::Create(0 /* ID is not used */,
- GURL(kClientReportPhishingUrl),
- URLFetcher::POST,
- this);
+ content::URLFetcher* fetcher = content::URLFetcher::Create(
+ 0 /* ID used for testing */, GURL(kClientReportPhishingUrl),
+ content::URLFetcher::POST, this);
// Remember which callback and URL correspond to the current fetcher object.
ClientReportInfo* info = new ClientReportInfo;
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc
index 051e3f9..c1ce0f3 100644
--- a/chrome/browser/safe_browsing/download_protection_service.cc
+++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -12,7 +12,7 @@
#include "chrome/common/net/http_return.h"
#include "chrome/common/safe_browsing/csd.pb.h"
#include "content/browser/browser_thread.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "net/base/load_flags.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -182,10 +182,9 @@ void DownloadProtectionService::StartCheckClientDownload(
return;
}
- URLFetcher* fetcher = URLFetcher::Create(0 /* ID used for testing */,
- GURL(kDownloadRequestUrl),
- URLFetcher::POST,
- this);
+ content::URLFetcher* fetcher = content::URLFetcher::Create(
+ 0 /* ID used for testing */, GURL(kDownloadRequestUrl),
+ content::URLFetcher::POST, this);
download_requests_[fetcher] = callback;
fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE);
fetcher->SetRequestContext(request_context_getter_.get());
diff --git a/chrome/browser/safe_browsing/malware_details_cache.cc b/chrome/browser/safe_browsing/malware_details_cache.cc
index bb029d0..1f1bdb1 100644
--- a/chrome/browser/safe_browsing/malware_details_cache.cc
+++ b/chrome/browser/safe_browsing/malware_details_cache.cc
@@ -15,7 +15,7 @@
#include "chrome/browser/safe_browsing/report.pb.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "content/browser/browser_thread.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "net/base/host_port_pair.h"
#include "net/base/load_flags.h"
#include "net/http/http_response_headers.h"
@@ -81,10 +81,8 @@ void MalwareDetailsCacheCollector::OpenEntry() {
return;
}
- current_fetch_.reset(new URLFetcher(
- GURL(resources_it_->first),
- URLFetcher::GET,
- this));
+ current_fetch_.reset(content::URLFetcher::Create(
+ GURL(resources_it_->first), content::URLFetcher::GET, this));
current_fetch_->SetRequestContext(request_context_getter_);
// Only from cache, and don't save cookies.
current_fetch_->SetLoadFlags(net::LOAD_ONLY_FROM_CACHE |
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index 82dacf5..20ae1ed 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -21,7 +21,7 @@
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/env_vars.h"
#include "content/browser/browser_thread.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/url_request/url_request_context_getter.h"
@@ -169,7 +169,8 @@ void SafeBrowsingProtocolManager::GetFullHash(
}
bool use_mac = !client_key_.empty();
GURL gethash_url = GetHashUrl(use_mac);
- URLFetcher* fetcher = new URLFetcher(gethash_url, URLFetcher::POST, this);
+ content::URLFetcher* fetcher = content::URLFetcher::Create(
+ gethash_url, content::URLFetcher::POST, this);
hash_requests_[fetcher] = check;
std::string get_hash;
@@ -562,7 +563,8 @@ void SafeBrowsingProtocolManager::IssueChunkRequest() {
DCHECK(!next_chunk.url.empty());
GURL chunk_url = NextChunkUrl(next_chunk.url);
request_type_ = CHUNK_REQUEST;
- request_.reset(new URLFetcher(chunk_url, URLFetcher::GET, this));
+ request_.reset(content::URLFetcher::Create(
+ chunk_url, content::URLFetcher::GET, this));
request_->SetLoadFlags(net::LOAD_DISABLE_CACHE);
request_->SetRequestContext(request_context_getter_);
chunk_request_start_ = base::Time::Now();
@@ -572,7 +574,8 @@ void SafeBrowsingProtocolManager::IssueChunkRequest() {
void SafeBrowsingProtocolManager::IssueKeyRequest() {
GURL key_url = MacKeyUrl();
request_type_ = GETKEY_REQUEST;
- request_.reset(new URLFetcher(key_url, URLFetcher::GET, this));
+ request_.reset(content::URLFetcher::Create(
+ key_url, content::URLFetcher::GET, this));
request_->SetLoadFlags(net::LOAD_DISABLE_CACHE);
request_->SetRequestContext(request_context_getter_);
request_->Start();
@@ -613,7 +616,8 @@ void SafeBrowsingProtocolManager::OnGetChunksComplete(
SBListChunkRanges(safe_browsing_util::kMalwareList), use_mac));
GURL update_url = UpdateUrl(use_mac);
- request_.reset(new URLFetcher(update_url, URLFetcher::POST, this));
+ request_.reset(content::URLFetcher::Create(
+ update_url, content::URLFetcher::POST, this));
request_->SetLoadFlags(net::LOAD_DISABLE_CACHE);
request_->SetRequestContext(request_context_getter_);
request_->SetUploadData("text/plain", list_data);
@@ -656,8 +660,10 @@ void SafeBrowsingProtocolManager::ReportSafeBrowsingHit(
GURL report_url = SafeBrowsingHitUrl(malicious_url, page_url,
referrer_url, is_subresource,
threat_type);
- URLFetcher* report = new URLFetcher(
- report_url, post_data.empty() ? URLFetcher::GET : URLFetcher::POST, this);
+ content::URLFetcher* report = content::URLFetcher::Create(
+ report_url,
+ post_data.empty() ? content::URLFetcher::GET : content::URLFetcher::POST,
+ this);
report->SetLoadFlags(net::LOAD_DISABLE_CACHE);
report->SetRequestContext(request_context_getter_);
if (!post_data.empty())
@@ -670,7 +676,8 @@ void SafeBrowsingProtocolManager::ReportSafeBrowsingHit(
void SafeBrowsingProtocolManager::ReportMalwareDetails(
const std::string& report) {
GURL report_url = MalwareDetailsUrl();
- URLFetcher* fetcher = new URLFetcher(report_url, URLFetcher::POST, this);
+ content::URLFetcher* fetcher = content::URLFetcher::Create(
+ report_url, content::URLFetcher::POST, this);
fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE);
fetcher->SetRequestContext(request_context_getter_);
fetcher->SetUploadData("application/octet-stream", report);
diff --git a/chrome/browser/search_engines/template_url_fetcher.cc b/chrome/browser/search_engines/template_url_fetcher.cc
index abaed39..ac3189e 100644
--- a/chrome/browser/search_engines/template_url_fetcher.cc
+++ b/chrome/browser/search_engines/template_url_fetcher.cc
@@ -15,10 +15,10 @@
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/search_engines/template_url_parser.h"
#include "chrome/common/chrome_notification_types.h"
-#include "content/common/net/url_fetcher.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/common/url_fetcher.h"
#include "content/public/common/url_fetcher_delegate.h"
#include "net/url_request/url_request_status.h"
@@ -57,7 +57,7 @@ class TemplateURLFetcher::RequestDelegate
private:
void AddSearchProvider();
- URLFetcher url_fetcher_;
+ scoped_ptr<content::URLFetcher> url_fetcher_;
TemplateURLFetcher* fetcher_;
scoped_ptr<TemplateURL> template_url_;
string16 keyword_;
@@ -79,8 +79,8 @@ TemplateURLFetcher::RequestDelegate::RequestDelegate(
const GURL& favicon_url,
TemplateURLFetcherCallbacks* callbacks,
ProviderType provider_type)
- : ALLOW_THIS_IN_INITIALIZER_LIST(url_fetcher_(osdd_url,
- URLFetcher::GET, this)),
+ : ALLOW_THIS_IN_INITIALIZER_LIST(url_fetcher_(content::URLFetcher::Create(
+ osdd_url, content::URLFetcher::GET, this))),
fetcher_(fetcher),
keyword_(keyword),
osdd_url_(osdd_url),
@@ -99,8 +99,8 @@ TemplateURLFetcher::RequestDelegate::RequestDelegate(
model->Load();
}
- url_fetcher_.SetRequestContext(fetcher->profile()->GetRequestContext());
- url_fetcher_.Start();
+ url_fetcher_->SetRequestContext(fetcher->profile()->GetRequestContext());
+ url_fetcher_->Start();
}
void TemplateURLFetcher::RequestDelegate::Observe(
diff --git a/chrome/browser/spellchecker/spellcheck_host_impl.cc b/chrome/browser/spellchecker/spellcheck_host_impl.cc
index 5fdd915..bd18447 100644
--- a/chrome/browser/spellchecker/spellcheck_host_impl.cc
+++ b/chrome/browser/spellchecker/spellcheck_host_impl.cc
@@ -23,9 +23,9 @@
#include "chrome/common/spellcheck_common.h"
#include "chrome/common/spellcheck_messages.h"
#include "content/browser/renderer_host/render_process_host.h"
-#include "content/common/net/url_fetcher.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/common/url_fetcher.h"
#include "googleurl/src/gurl.h"
#include "net/url_request/url_request_context_getter.h"
#include "third_party/hunspell/google/bdict.h"
@@ -296,7 +296,8 @@ void SpellCheckHostImpl::DownloadDictionary() {
}
GURL url = GURL(std::string(kDownloadServerUrl) +
StringToLowerASCII(bdict_file));
- fetcher_.reset(new URLFetcher(url, URLFetcher::GET, this));
+ fetcher_.reset(content::URLFetcher::Create(
+ url, content::URLFetcher::GET, this));
fetcher_->SetRequestContext(request_context_getter_);
tried_to_download_ = true;
fetcher_->Start();
diff --git a/chrome/browser/sync/glue/http_bridge.cc b/chrome/browser/sync/glue/http_bridge.cc
index edcf900..b19aa49 100644
--- a/chrome/browser/sync/glue/http_bridge.cc
+++ b/chrome/browser/sync/glue/http_bridge.cc
@@ -8,8 +8,8 @@
#include "base/message_loop_proxy.h"
#include "base/string_number_conversions.h"
#include "content/browser/browser_thread.h"
-#include "content/common/net/url_fetcher.h"
#include "content/public/common/content_client.h"
+#include "content/public/common/url_fetcher.h"
#include "net/base/cookie_monster.h"
#include "net/base/host_resolver.h"
#include "net/base/load_flags.h"
@@ -217,8 +217,8 @@ void HttpBridge::MakeAsynchronousPost() {
if (fetch_state_.aborted)
return;
- fetch_state_.url_poster = URLFetcher::Create(0, url_for_request_,
- URLFetcher::POST, this);
+ fetch_state_.url_poster = content::URLFetcher::Create(
+ url_for_request_, content::URLFetcher::POST, this);
fetch_state_.url_poster->SetRequestContext(context_getter_for_request_);
fetch_state_.url_poster->SetUploadData(content_type_, request_content_);
fetch_state_.url_poster->SetExtraRequestHeaders(extra_headers_);
diff --git a/chrome/browser/tab_contents/spelling_menu_observer.cc b/chrome/browser/tab_contents/spelling_menu_observer.cc
index 23156aa..aa68904 100644
--- a/chrome/browser/tab_contents/spelling_menu_observer.cc
+++ b/chrome/browser/tab_contents/spelling_menu_observer.cc
@@ -17,7 +17,7 @@
#include "chrome/browser/tab_contents/render_view_context_menu.h"
#include "chrome/common/pref_names.h"
#include "content/browser/renderer_host/render_view_host.h"
-#include "content/common/net/url_fetcher.h"
+#include "content/public/common/url_fetcher.h"
#include "googleurl/src/gurl.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
@@ -139,7 +139,8 @@ bool SpellingMenuObserver::Invoke(const string16& text,
static const char kSpellingServiceURL[] = SPELLING_SERVICE_URL;
GURL url = GURL(kSpellingServiceURL);
- fetcher_.reset(new URLFetcher(url, URLFetcher::POST, this));
+ fetcher_.reset(content::URLFetcher::Create(
+ url, content::URLFetcher::POST, this));
fetcher_->SetRequestContext(context);
fetcher_->SetUploadData("application/json", request);
fetcher_->Start();
diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc
index c573326..e0c015c 100644
--- a/chrome/browser/translate/translate_manager.cc
+++ b/chrome/browser/translate/translate_manager.cc
@@ -38,11 +38,11 @@
#include "content/browser/tab_contents/navigation_details.h"
#include "content/browser/tab_contents/navigation_entry.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/common/net/url_fetcher.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
+#include "content/public/common/url_fetcher.h"
#include "grit/browser_resources.h"
#include "net/base/escape.h"
#include "net/url_request/url_request_status.h"
@@ -750,8 +750,8 @@ void TranslateManager::FetchLanguageListFromTranslateServer(
return;
}
- language_list_request_pending_.reset(URLFetcher::Create(
- 1, GURL(kLanguageListFetchURL), URLFetcher::GET, this));
+ language_list_request_pending_.reset(content::URLFetcher::Create(
+ 1, GURL(kLanguageListFetchURL), content::URLFetcher::GET, this));
language_list_request_pending_->SetRequestContext(
Profile::Deprecated::GetDefaultRequestContext());
language_list_request_pending_->SetMaxRetries(kMaxRetryLanguageListFetch);
@@ -767,8 +767,8 @@ void TranslateManager::RequestTranslateScript() {
if (translate_script_request_pending_.get() != NULL)
return;
- translate_script_request_pending_.reset(URLFetcher::Create(
- 0, GURL(kTranslateScriptURL), URLFetcher::GET, this));
+ translate_script_request_pending_.reset(content::URLFetcher::Create(
+ 0, GURL(kTranslateScriptURL), content::URLFetcher::GET, this));
translate_script_request_pending_->SetRequestContext(
Profile::Deprecated::GetDefaultRequestContext());
translate_script_request_pending_->SetExtraRequestHeaders(
diff --git a/chrome/browser/ui/webui/active_downloads_ui.cc b/chrome/browser/ui/webui/active_downloads_ui.cc
index 2511dc0..2278b95 100644
--- a/chrome/browser/ui/webui/active_downloads_ui.cc
+++ b/chrome/browser/ui/webui/active_downloads_ui.cc
@@ -42,7 +42,6 @@
#include "content/browser/download/download_item.h"
#include "content/browser/download/download_manager.h"
#include "content/browser/tab_contents/tab_contents.h"
-#include "content/common/net/url_fetcher.h"
#include "grit/browser_resources.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
diff --git a/chrome/browser/web_resource/web_resource_service.cc b/chrome/browser/web_resource/web_resource_service.cc
index 0dfc70a..b445ab3 100644
--- a/chrome/browser/web_resource/web_resource_service.cc
+++ b/chrome/browser/web_resource/web_resource_service.cc
@@ -21,8 +21,8 @@
#include "chrome/common/extensions/extension.h"
#include "chrome/common/web_resource/web_resource_unpacker.h"
#include "content/browser/browser_thread.h"
-#include "content/common/net/url_fetcher.h"
#include "content/public/browser/notification_service.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"
@@ -66,9 +66,8 @@ class WebResourceService::WebResourceFetcher
web_resource_server.append(locale);
}
- url_fetcher_.reset(new URLFetcher(GURL(
- web_resource_server),
- URLFetcher::GET, this));
+ url_fetcher_.reset(content::URLFetcher::Create(
+ GURL(web_resource_server), content::URLFetcher::GET, this));
// Do not let url fetcher affect existing state in system context (by
// setting cookies, for example).
url_fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE |