summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/alternate_nav_url_fetcher.cc4
-rw-r--r--chrome/browser/autocomplete/search_provider.cc4
-rw-r--r--chrome/browser/autofill/autofill_download.cc4
-rw-r--r--chrome/browser/captive_portal/captive_portal_service.cc10
-rw-r--r--chrome/browser/chrome_to_mobile_service.cc6
-rw-r--r--chrome/browser/chromeos/customization_document.cc4
-rw-r--r--chrome/browser/chromeos/gdata/gdata_operations.cc4
-rw-r--r--chrome/browser/chromeos/gdata/gdata_protocol_handler.cc4
-rw-r--r--chrome/browser/chromeos/imageburner/burn_manager.cc10
-rw-r--r--chrome/browser/chromeos/login/mock_url_fetchers.cc2
-rw-r--r--chrome/browser/component_updater/component_updater_service.cc6
-rw-r--r--chrome/browser/component_updater/component_updater_service_unittest.cc6
-rw-r--r--chrome/browser/extensions/app_notify_channel_setup.cc4
-rw-r--r--chrome/browser/extensions/app_notify_channel_setup.h2
-rw-r--r--chrome/browser/extensions/apps_promo.cc4
-rw-r--r--chrome/browser/extensions/extension_management_browsertest.cc12
-rw-r--r--chrome/browser/extensions/updater/extension_downloader.cc6
-rw-r--r--chrome/browser/extensions/webstore_inline_installer.cc4
-rw-r--r--chrome/browser/extensions/webstore_install_helper.cc4
-rw-r--r--chrome/browser/feedback/feedback_util.cc4
-rw-r--r--chrome/browser/google/google_url_tracker.cc6
-rw-r--r--chrome/browser/google/google_url_tracker.h2
-rw-r--r--chrome/browser/google/google_url_tracker_unittest.cc4
-rw-r--r--chrome/browser/importer/toolbar_importer.cc6
-rw-r--r--chrome/browser/intents/cws_intents_registry.cc4
-rw-r--r--chrome/browser/intranet_redirect_detector.cc4
-rw-r--r--chrome/browser/io_thread.cc2
-rw-r--r--chrome/browser/metrics/metrics_service.cc8
-rw-r--r--chrome/browser/metrics/variations_service.cc4
-rw-r--r--chrome/browser/net/gaia/gaia_oauth_fetcher.cc4
-rw-r--r--chrome/browser/net/sdch_dictionary_fetcher.cc4
-rw-r--r--chrome/browser/policy/device_management_service.cc4
-rw-r--r--chrome/browser/policy/device_management_service_browsertest.cc4
-rw-r--r--chrome/browser/profiles/profile_downloader.cc6
-rw-r--r--chrome/browser/safe_browsing/client_side_detection_service.cc6
-rw-r--r--chrome/browser/safe_browsing/download_protection_service.cc10
-rw-r--r--chrome/browser/safe_browsing/malware_details_cache.cc4
-rw-r--r--chrome/browser/safe_browsing/protocol_manager.cc12
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_test.cc4
-rw-r--r--chrome/browser/search_engines/template_url_fetcher.cc3
-rw-r--r--chrome/browser/spellchecker/spellcheck_host_impl.cc6
-rw-r--r--chrome/browser/spellchecker/spellcheck_message_filter.cc2
-rw-r--r--chrome/browser/spellchecker/spelling_service_client.cc4
-rw-r--r--chrome/browser/sync/glue/http_bridge.cc4
-rw-r--r--chrome/browser/sync/test/integration/sync_test.cc4
-rw-r--r--chrome/browser/translate/translate_manager.cc6
-rw-r--r--chrome/browser/ui/intents/web_intent_picker_controller.cc4
-rw-r--r--chrome/browser/web_resource/web_resource_service.cc4
-rw-r--r--chrome/chrome_browser.gypi1
-rw-r--r--chrome/common/net/gaia/gaia_auth_fetcher.cc4
-rw-r--r--chrome/common/net/gaia/gaia_oauth_client.cc4
-rw-r--r--chrome/common/net/gaia/oauth2_access_token_fetcher.cc4
-rw-r--r--chrome/common/net/gaia/oauth2_access_token_fetcher_unittest.cc2
-rw-r--r--chrome/common/net/gaia/oauth2_api_call_flow.cc4
-rw-r--r--chrome/common/net/gaia/oauth2_api_call_flow_unittest.cc2
-rw-r--r--chrome/common/net/gaia/oauth2_mint_token_fetcher.cc4
-rw-r--r--chrome/common/net/gaia/oauth2_mint_token_fetcher_unittest.cc2
-rw-r--r--chrome/common/net/gaia/oauth2_mint_token_flow.cc2
-rw-r--r--chrome/common/net/gaia/oauth2_revocation_fetcher.cc4
-rw-r--r--chrome/common/net/gaia/oauth2_revocation_fetcher_unittest.cc2
-rw-r--r--chrome/service/cloud_print/cloud_print_url_fetcher.cc4
-rw-r--r--chrome/service/gaia/service_gaia_authenticator.cc4
-rw-r--r--chrome/service/service_process.cc6
-rw-r--r--content/browser/browser_process_sub_thread.cc4
-rw-r--r--content/browser/geolocation/network_location_request.cc4
-rw-r--r--content/browser/speech/google_one_shot_remote_engine.cc10
-rw-r--r--content/common/net/url_fetcher.cc36
-rw-r--r--content/public/common/url_fetcher.h59
-rw-r--r--net/url_request/url_fetcher.cc32
-rw-r--r--net/url_request/url_fetcher.h28
70 files changed, 249 insertions, 212 deletions
diff --git a/chrome/browser/alternate_nav_url_fetcher.cc b/chrome/browser/alternate_nav_url_fetcher.cc
index 9c47b3a..e5c03aa 100644
--- a/chrome/browser/alternate_nav_url_fetcher.cc
+++ b/chrome/browser/alternate_nav_url_fetcher.cc
@@ -16,11 +16,11 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/common/url_fetcher.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources_standard.h"
#include "net/base/load_flags.h"
#include "net/base/registry_controlled_domain.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
@@ -191,7 +191,7 @@ void AlternateNavURLFetcher::StartFetch(NavigationController* controller) {
DCHECK_EQ(NOT_STARTED, state_);
state_ = IN_PROGRESS;
- fetcher_.reset(content::URLFetcher::Create(
+ fetcher_.reset(net::URLFetcher::Create(
GURL(alternate_nav_url_), net::URLFetcher::HEAD, this));
fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES);
fetcher_->SetRequestContext(
diff --git a/chrome/browser/autocomplete/search_provider.cc b/chrome/browser/autocomplete/search_provider.cc
index 256b188..ed39598 100644
--- a/chrome/browser/autocomplete/search_provider.cc
+++ b/chrome/browser/autocomplete/search_provider.cc
@@ -36,13 +36,13 @@
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
-#include "content/public/common/url_fetcher.h"
#include "googleurl/src/url_util.h"
#include "grit/generated_resources.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/base/net_util.h"
#include "net/http/http_response_headers.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_status.h"
#include "ui/base/l10n/l10n_util.h"
@@ -592,7 +592,7 @@ net::URLFetcher* SearchProvider::CreateSuggestFetcher(
const TemplateURLRef& suggestions_url,
const string16& text) {
DCHECK(suggestions_url.SupportsReplacement());
- net::URLFetcher* fetcher = content::URLFetcher::Create(id,
+ net::URLFetcher* fetcher = net::URLFetcher::Create(id,
GURL(suggestions_url.ReplaceSearchTerms(text,
TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16())),
net::URLFetcher::GET, this);
diff --git a/chrome/browser/autofill/autofill_download.cc b/chrome/browser/autofill/autofill_download.cc
index 7c96fac..cdd56a1 100644
--- a/chrome/browser/autofill/autofill_download.cc
+++ b/chrome/browser/autofill/autofill_download.cc
@@ -18,10 +18,10 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
-#include "content/public/common/url_fetcher.h"
#include "googleurl/src/gurl.h"
#include "net/base/load_flags.h"
#include "net/http/http_response_headers.h"
+#include "net/url_request/url_fetcher.h"
#include "third_party/libjingle/source/talk/xmllite/xmlparser.h"
namespace {
@@ -171,7 +171,7 @@ bool AutofillDownloadManager::StartRequest(
// Id is ignored for regular chrome, in unit test id's for fake fetcher
// factory will be 0, 1, 2, ...
- net::URLFetcher* fetcher = content::URLFetcher::Create(
+ net::URLFetcher* fetcher = net::URLFetcher::Create(
fetcher_id_for_unittest_++, GURL(request_url), net::URLFetcher::POST,
this);
url_fetchers_[fetcher] = request_data;
diff --git a/chrome/browser/captive_portal/captive_portal_service.cc b/chrome/browser/captive_portal/captive_portal_service.cc
index 498cdf9..e48ef44 100644
--- a/chrome/browser/captive_portal/captive_portal_service.cc
+++ b/chrome/browser/captive_portal/captive_portal_service.cc
@@ -16,9 +16,9 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/notification_service.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/load_flags.h"
#include "net/http/http_response_headers.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_status.h"
namespace captive_portal {
@@ -198,10 +198,10 @@ void CaptivePortalService::DetectCaptivePortalInternal() {
}
// The first 0 means this can use a TestURLFetcherFactory in unit tests.
- url_fetcher_.reset(content::URLFetcher::Create(0,
- test_url_,
- net::URLFetcher::GET,
- this));
+ url_fetcher_.reset(net::URLFetcher::Create(0,
+ test_url_,
+ net::URLFetcher::GET,
+ this));
url_fetcher_->SetAutomaticallyRetryOn5xx(false);
url_fetcher_->SetRequestContext(profile_->GetRequestContext());
// Can't safely use net::LOAD_DISABLE_CERT_REVOCATION_CHECKING here,
diff --git a/chrome/browser/chrome_to_mobile_service.cc b/chrome/browser/chrome_to_mobile_service.cc
index db1598f..557c168 100644
--- a/chrome/browser/chrome_to_mobile_service.cc
+++ b/chrome/browser/chrome_to_mobile_service.cc
@@ -32,9 +32,9 @@
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
namespace {
@@ -346,7 +346,7 @@ net::URLFetcher* ChromeToMobileService::CreateRequest(
const RequestData& data) {
bool get = data.type != SNAPSHOT;
GURL service_url(cloud_print_url_->GetCloudPrintServiceURL());
- net::URLFetcher* request = content::URLFetcher::Create(
+ net::URLFetcher* request = net::URLFetcher::Create(
data.type == SEARCH ? GetSearchURL(service_url) :
GetSubmitURL(service_url, data),
get ? net::URLFetcher::GET : net::URLFetcher::POST, this);
@@ -397,7 +397,7 @@ void ChromeToMobileService::RequestAccountInfo() {
}
account_info_request_.reset(
- content::URLFetcher::Create(url, net::URLFetcher::GET, this));
+ net::URLFetcher::Create(url, net::URLFetcher::GET, this));
account_info_request_->SetRequestContext(profile_->GetRequestContext());
account_info_request_->SetMaxRetries(kMaxRetries);
// This request sends the user's cookie to check the cloud print service flag.
diff --git a/chrome/browser/chromeos/customization_document.cc b/chrome/browser/chromeos/customization_document.cc
index cd7ac2e..932ec75 100644
--- a/chrome/browser/chromeos/customization_document.cc
+++ b/chrome/browser/chromeos/customization_document.cc
@@ -22,7 +22,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/common/url_fetcher.h"
+#include "net/url_request/url_fetcher.h"
using content::BrowserThread;
@@ -295,7 +295,7 @@ void ServicesCustomizationDocument::ReadFileInBackground(const FilePath& file) {
void ServicesCustomizationDocument::StartFileFetch() {
DCHECK(url_.is_valid());
- url_fetcher_.reset(content::URLFetcher::Create(
+ url_fetcher_.reset(net::URLFetcher::Create(
url_, net::URLFetcher::GET, this));
url_fetcher_->SetRequestContext(
ProfileManager::GetDefaultProfile()->GetRequestContext());
diff --git a/chrome/browser/chromeos/gdata/gdata_operations.cc b/chrome/browser/chromeos/gdata/gdata_operations.cc
index 4d6e8f9..9781153 100644
--- a/chrome/browser/chromeos/gdata/gdata_operations.cc
+++ b/chrome/browser/chromeos/gdata/gdata_operations.cc
@@ -15,9 +15,9 @@
#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 "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_status.h"
#include "third_party/libxml/chromium/libxml_utils.h"
@@ -267,7 +267,7 @@ void UrlFetchOperationBase::Start(const std::string& auth_token) {
DVLOG(1) << "URL: " << url.spec();
url_fetcher_.reset(
- content::URLFetcher::Create(url, GetRequestType(), this));
+ net::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_protocol_handler.cc b/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc
index e61fbea..271f8bc 100644
--- a/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc
+++ b/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc
@@ -243,7 +243,7 @@ void GDataURLRequestJob::Start() {
// GetDownloadDataCallback - this would either get it from cache or
// download it from gdata.
// 7) If file is downloaded from gdata:
- // 7.1) Whenever content::URLFetcherCore::OnReadCompleted() receives a part
+ // 7.1) Whenever net::URLFetcherCore::OnReadCompleted() receives a part
// of the response, it invokes
// constent::URLFetcherDelegate::OnURLFetchDownloadData() if
// net::URLFetcherDelegate::ShouldSendDownloadData() is true.
@@ -259,7 +259,7 @@ void GDataURLRequestJob::Start() {
// 7.4) Copies the formal download data into a growable-drainable dowload
// IOBuffer
// - IOBuffer has initial size 4096, same as buffer used in
- // content::URLFetcherCore::OnReadCompleted.
+ // net::URLFetcherCore::OnReadCompleted.
// - We may end up with multiple chunks, so we use GrowableIOBuffer.
// - We then wrap the growable buffer within a DrainableIOBuffer for
// ease of progressively writing into the buffer.
diff --git a/chrome/browser/chromeos/imageburner/burn_manager.cc b/chrome/browser/chromeos/imageburner/burn_manager.cc
index 775a2e0..c2d035d 100644
--- a/chrome/browser/chromeos/imageburner/burn_manager.cc
+++ b/chrome/browser/chromeos/imageburner/burn_manager.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/chromeos/system/statistics_provider.h"
#include "chrome/common/chrome_paths.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/common/url_fetcher.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_status.h"
using content::BrowserThread;
@@ -281,7 +281,7 @@ void BurnManager::FetchConfigFile(Delegate* delegate) {
if (config_fetcher_.get())
return;
- config_fetcher_.reset(content::URLFetcher::Create(
+ config_fetcher_.reset(net::URLFetcher::Create(
config_file_url_, net::URLFetcher::GET, this));
config_fetcher_->SetRequestContext(
g_browser_process->system_request_context());
@@ -291,9 +291,9 @@ void BurnManager::FetchConfigFile(Delegate* delegate) {
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,
- net::URLFetcher::GET,
- this));
+ image_fetcher_.reset(net::URLFetcher::Create(image_url,
+ net::URLFetcher::GET,
+ this));
image_fetcher_->SetRequestContext(
g_browser_process->system_request_context());
image_fetcher_->SaveResponseToFileAtPath(
diff --git a/chrome/browser/chromeos/login/mock_url_fetchers.cc b/chrome/browser/chromeos/login/mock_url_fetchers.cc
index afd1973..2511f28 100644
--- a/chrome/browser/chromeos/login/mock_url_fetchers.cc
+++ b/chrome/browser/chromeos/login/mock_url_fetchers.cc
@@ -10,9 +10,9 @@
#include "base/message_loop.h"
#include "base/stringprintf.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/common/url_fetcher.h"
#include "googleurl/src/gurl.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_request_status.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/component_updater/component_updater_service.cc b/chrome/browser/component_updater/component_updater_service.cc
index 6e18fd5..06e2bae 100644
--- a/chrome/browser/component_updater/component_updater_service.cc
+++ b/chrome/browser/component_updater/component_updater_service.cc
@@ -28,10 +28,10 @@
#include "content/public/browser/notification_service.h"
#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 "googleurl/src/gurl.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
using content::BrowserThread;
@@ -506,7 +506,7 @@ void CrxUpdateService::ProcessPendingItems() {
context->pk_hash = item->component.pk_hash;
context->id = item->id;
context->installer = item->component.installer;
- url_fetcher_.reset(content::URLFetcher::Create(
+ url_fetcher_.reset(net::URLFetcher::Create(
0, item->crx_url, net::URLFetcher::GET,
MakeContextDelegate(this, context)));
StartFetch(url_fetcher_.get(), config_->RequestContext(), true);
@@ -567,7 +567,7 @@ void CrxUpdateService::ProcessPendingItems() {
const std::string full_query = MakeFinalQuery(config_->UpdateUrl().spec(),
query,
config_->ExtraRequestParams());
- url_fetcher_.reset(content::URLFetcher::Create(
+ url_fetcher_.reset(net::URLFetcher::Create(
0, GURL(full_query), net::URLFetcher::GET,
MakeContextDelegate(this, new UpdateContext())));
StartFetch(url_fetcher_.get(), config_->RequestContext(), false);
diff --git a/chrome/browser/component_updater/component_updater_service_unittest.cc b/chrome/browser/component_updater/component_updater_service_unittest.cc
index b1fe380..6a25757 100644
--- a/chrome/browser/component_updater/component_updater_service_unittest.cc
+++ b/chrome/browser/component_updater/component_updater_service_unittest.cc
@@ -16,11 +16,11 @@
#include "chrome/common/chrome_paths.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_service.h"
-#include "content/public/common/url_fetcher.h"
#include "content/public/test/test_browser_thread.h"
#include "content/public/test/test_notification_tracker.h"
#include "googleurl/src/gurl.h"
#include "libxml/globals.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_test_util.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -158,11 +158,11 @@ class ComponentUpdaterTest : public testing::Test {
notification_tracker_.ListenFor(
notifications[ix], content::NotificationService::AllSources());
}
- content::URLFetcher::SetEnableInterceptionForTests(true);
+ net::URLFetcher::SetEnableInterceptionForTests(true);
}
~ComponentUpdaterTest() {
- content::URLFetcher::SetEnableInterceptionForTests(false);
+ net::URLFetcher::SetEnableInterceptionForTests(false);
}
void TearDown() {
diff --git a/chrome/browser/extensions/app_notify_channel_setup.cc b/chrome/browser/extensions/app_notify_channel_setup.cc
index e5f3cba..d4370d6 100644
--- a/chrome/browser/extensions/app_notify_channel_setup.cc
+++ b/chrome/browser/extensions/app_notify_channel_setup.cc
@@ -25,11 +25,11 @@
#include "chrome/common/net/gaia/gaia_urls.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_status.h"
using base::StringPrintf;
@@ -147,7 +147,7 @@ URLFetcher* AppNotifyChannelSetup::CreateURLFetcher(
CHECK(url.is_valid());
URLFetcher::RequestType type =
body.empty() ? URLFetcher::GET : URLFetcher::POST;
- URLFetcher* fetcher = content::URLFetcher::Create(0, url, type, this);
+ URLFetcher* fetcher = net::URLFetcher::Create(0, url, type, this);
fetcher->SetRequestContext(profile_->GetRequestContext());
// Always set flags to neither send nor save cookies.
fetcher->SetLoadFlags(
diff --git a/chrome/browser/extensions/app_notify_channel_setup.h b/chrome/browser/extensions/app_notify_channel_setup.h
index ae394dd..f8aa5df 100644
--- a/chrome/browser/extensions/app_notify_channel_setup.h
+++ b/chrome/browser/extensions/app_notify_channel_setup.h
@@ -13,8 +13,8 @@
#include "chrome/browser/extensions/app_notify_channel_ui.h"
#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 "googleurl/src/gurl.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
class AppNotifyChannelSetupTest;
diff --git a/chrome/browser/extensions/apps_promo.cc b/chrome/browser/extensions/apps_promo.cc
index cc4e9ac..0b5ce56 100644
--- a/chrome/browser/extensions/apps_promo.cc
+++ b/chrome/browser/extensions/apps_promo.cc
@@ -16,8 +16,8 @@
#include "chrome/common/pref_names.h"
#include "content/public/browser/notification_service.h"
#include "content/public/common/url_constants.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_status.h"
const int AppsPromo::kDefaultAppsCounterMax = 10;
@@ -357,7 +357,7 @@ void AppsPromoLogoFetcher::OnURLFetchComplete(
void AppsPromoLogoFetcher::FetchLogo() {
CHECK(promo_data_.logo.scheme() == chrome::kHttpsScheme);
- url_fetcher_.reset(content::URLFetcher::Create(
+ url_fetcher_.reset(net::URLFetcher::Create(
0, promo_data_.logo, net::URLFetcher::GET, this));
url_fetcher_->SetRequestContext(
g_browser_process->system_request_context());
diff --git a/chrome/browser/extensions/extension_management_browsertest.cc b/chrome/browser/extensions/extension_management_browsertest.cc
index a9d0898..d42f004 100644
--- a/chrome/browser/extensions/extension_management_browsertest.cc
+++ b/chrome/browser/extensions/extension_management_browsertest.cc
@@ -22,7 +22,7 @@
#include "chrome/test/base/ui_test_utils.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_view_host.h"
-#include "content/public/common/url_fetcher.h"
+#include "net/url_request/url_fetcher.h"
using extensions::Extension;
@@ -238,7 +238,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, MAYBE_AutoUpdate) {
FilePath basedir = test_data_dir_.AppendASCII("autoupdate");
// Note: This interceptor gets requests on the IO thread.
scoped_refptr<AutoUpdateInterceptor> interceptor(new AutoUpdateInterceptor());
- content::URLFetcher::SetEnableInterceptionForTests(true);
+ net::URLFetcher::SetEnableInterceptionForTests(true);
interceptor->SetResponseOnIOThread("http://localhost/autoupdate/manifest",
basedir.AppendASCII("manifest_v2.xml"));
@@ -317,7 +317,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest,
FilePath basedir = test_data_dir_.AppendASCII("autoupdate");
// Note: This interceptor gets requests on the IO thread.
scoped_refptr<AutoUpdateInterceptor> interceptor(new AutoUpdateInterceptor());
- content::URLFetcher::SetEnableInterceptionForTests(true);
+ net::URLFetcher::SetEnableInterceptionForTests(true);
interceptor->SetResponseOnIOThread("http://localhost/autoupdate/manifest",
basedir.AppendASCII("manifest_v2.xml"));
@@ -378,7 +378,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, ExternalUrlUpdate) {
// Note: This interceptor gets requests on the IO thread.
scoped_refptr<AutoUpdateInterceptor> interceptor(new AutoUpdateInterceptor());
- content::URLFetcher::SetEnableInterceptionForTests(true);
+ net::URLFetcher::SetEnableInterceptionForTests(true);
interceptor->SetResponseOnIOThread("http://localhost/autoupdate/manifest",
basedir.AppendASCII("manifest_v2.xml"));
@@ -461,7 +461,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest, ExternalPolicyRefresh) {
// Note: This interceptor gets requests on the IO thread.
scoped_refptr<AutoUpdateInterceptor> interceptor(new AutoUpdateInterceptor());
- content::URLFetcher::SetEnableInterceptionForTests(true);
+ net::URLFetcher::SetEnableInterceptionForTests(true);
interceptor->SetResponseOnIOThread("http://localhost/autoupdate/manifest",
basedir.AppendASCII("manifest_v2.xml"));
@@ -536,7 +536,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionManagementTest,
// Note: This interceptor gets requests on the IO thread.
scoped_refptr<AutoUpdateInterceptor> interceptor(new AutoUpdateInterceptor());
- content::URLFetcher::SetEnableInterceptionForTests(true);
+ net::URLFetcher::SetEnableInterceptionForTests(true);
interceptor->SetResponseOnIOThread("http://localhost/autoupdate/manifest",
basedir.AppendASCII("manifest_v2.xml"));
diff --git a/chrome/browser/extensions/updater/extension_downloader.cc b/chrome/browser/extensions/updater/extension_downloader.cc
index a19c8df..a0ea581 100644
--- a/chrome/browser/extensions/updater/extension_downloader.cc
+++ b/chrome/browser/extensions/updater/extension_downloader.cc
@@ -28,8 +28,8 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_service.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_status.h"
using base::Time;
@@ -343,7 +343,7 @@ void ExtensionDownloader::StartUpdateCheck(ManifestFetchData* fetch_data) {
}
current_manifest_fetch_.swap(scoped_fetch_data);
- manifest_fetcher_.reset(content::URLFetcher::Create(
+ manifest_fetcher_.reset(net::URLFetcher::Create(
kManifestFetcherId, fetch_data->full_url(), net::URLFetcher::GET,
this));
manifest_fetcher_->SetRequestContext(request_context_);
@@ -562,7 +562,7 @@ void ExtensionDownloader::FetchUpdatedExtension(const std::string& id,
extensions_pending_.push_back(ExtensionFetch(id, url, hash, version));
}
} else {
- extension_fetcher_.reset(content::URLFetcher::Create(
+ extension_fetcher_.reset(net::URLFetcher::Create(
kExtensionFetcherId, url, net::URLFetcher::GET, this));
extension_fetcher_->SetRequestContext(request_context_);
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 f97aed0..d24ec32 100644
--- a/chrome/browser/extensions/webstore_inline_installer.cc
+++ b/chrome/browser/extensions/webstore_inline_installer.cc
@@ -23,9 +23,9 @@
#include "content/public/browser/utility_process_host.h"
#include "content/public/browser/utility_process_host_client.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_status.h"
using content::BrowserThread;
@@ -171,7 +171,7 @@ void WebstoreInlineInstaller::BeginInstall() {
GURL webstore_data_url(extension_urls::GetWebstoreItemJsonDataURL(id_));
- webstore_data_url_fetcher_.reset(content::URLFetcher::Create(
+ webstore_data_url_fetcher_.reset(net::URLFetcher::Create(
webstore_data_url, net::URLFetcher::GET, this));
Profile* profile = Profile::FromBrowserContext(
web_contents()->GetBrowserContext());
diff --git a/chrome/browser/extensions/webstore_install_helper.cc b/chrome/browser/extensions/webstore_install_helper.cc
index 911596f..98219dc 100644
--- a/chrome/browser/extensions/webstore_install_helper.cc
+++ b/chrome/browser/extensions/webstore_install_helper.cc
@@ -11,8 +11,8 @@
#include "chrome/common/chrome_utility_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/utility_process_host.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -58,7 +58,7 @@ void WebstoreInstallHelper::Start() {
if (!icon_url_.is_empty()) {
CHECK(context_getter_);
- url_fetcher_.reset(content::URLFetcher::Create(
+ url_fetcher_.reset(net::URLFetcher::Create(
icon_url_, net::URLFetcher::GET, this));
url_fetcher_->SetRequestContext(context_getter_);
url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
diff --git a/chrome/browser/feedback/feedback_util.cc b/chrome/browser/feedback/feedback_util.cc
index a58cb22..7f5e84f 100644
--- a/chrome/browser/feedback/feedback_util.cc
+++ b/chrome/browser/feedback/feedback_util.cc
@@ -26,12 +26,12 @@
#include "chrome/common/chrome_version_info.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/common/url_fetcher.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.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_request_status.h"
#include "ui/base/l10n/l10n_util.h"
@@ -198,7 +198,7 @@ void FeedbackUtil::SendFeedback(Profile* profile,
else
post_url = GURL(kFeedbackPostUrl);
- net::URLFetcher* fetcher = content::URLFetcher::Create(
+ net::URLFetcher* fetcher = net::URLFetcher::Create(
post_url, net::URLFetcher::POST,
new FeedbackUtil::PostCleanup(profile, post_body, previous_delay));
fetcher->SetRequestContext(profile->GetRequestContext());
diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc
index c32e4f4..29efa84 100644
--- a/chrome/browser/google/google_url_tracker.cc
+++ b/chrome/browser/google/google_url_tracker.cc
@@ -26,10 +26,10 @@
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/web_contents.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"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
#include "ui/base/l10n/l10n_util.h"
@@ -283,8 +283,8 @@ void GoogleURLTracker::StartFetchIfDesirable() {
fetch_url = kSearchDomainCheckURL;
already_fetched_ = true;
- fetcher_.reset(content::URLFetcher::Create(fetcher_id_, GURL(fetch_url),
- net::URLFetcher::GET, this));
+ fetcher_.reset(net::URLFetcher::Create(fetcher_id_, GURL(fetch_url),
+ net::URLFetcher::GET, this));
++fetcher_id_;
// We don't want this fetch to set new entries in the cache or cookies, lest
// we alarm the user.
diff --git a/chrome/browser/google/google_url_tracker.h b/chrome/browser/google/google_url_tracker.h
index 50d52fb..bbb4709 100644
--- a/chrome/browser/google/google_url_tracker.h
+++ b/chrome/browser/google/google_url_tracker.h
@@ -17,9 +17,9 @@
#include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
-#include "content/public/common/url_fetcher.h"
#include "googleurl/src/gurl.h"
#include "net/base/network_change_notifier.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
class GoogleURLTrackerInfoBarDelegate;
diff --git a/chrome/browser/google/google_url_tracker_unittest.cc b/chrome/browser/google/google_url_tracker_unittest.cc
index dd52008..ab57d78 100644
--- a/chrome/browser/google/google_url_tracker_unittest.cc
+++ b/chrome/browser/google/google_url_tracker_unittest.cc
@@ -8,16 +8,16 @@
#include <string>
#include "base/message_loop.h"
-#include "chrome/browser/infobars/infobar_delegate.h"
#include "chrome/browser/google/google_url_tracker_factory.h"
+#include "chrome/browser/infobars/infobar_delegate.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/browser/notification_service.h"
-#include "content/public/common/url_fetcher.h"
#include "content/public/test/test_browser_thread.h"
#include "content/public/test/test_url_fetcher_factory.h"
+#include "net/url_request/url_fetcher.h"
#include "testing/gtest/include/gtest/gtest.h"
class TabContents;
diff --git a/chrome/browser/importer/toolbar_importer.cc b/chrome/browser/importer/toolbar_importer.cc
index cc38da4..60ec73a 100644
--- a/chrome/browser/importer/toolbar_importer.cc
+++ b/chrome/browser/importer/toolbar_importer.cc
@@ -16,9 +16,9 @@
#include "chrome/browser/importer/importer_data_types.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/common/url_fetcher.h"
#include "grit/generated_resources.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "third_party/libxml/chromium/libxml_utils.h"
using content::BrowserThread;
@@ -213,7 +213,7 @@ void Toolbar5Importer::GetAuthenticationFromServer() {
// Because the importer is started as the result of a user action which
// explicitly requires authentication, sending cookies here is reasonable.
- token_fetcher_ = content::URLFetcher::Create(
+ token_fetcher_ = net::URLFetcher::Create(
url, net::URLFetcher::GET, this);
token_fetcher_->SetRequestContext(request_context_getter_.get());
token_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES);
@@ -250,7 +250,7 @@ void Toolbar5Importer::GetBookmarkDataFromServer(const std::string& response) {
// Because the importer is started as the result of a user action which
// explicitly requires authentication, sending cookies here is reasonable.
- data_fetcher_ = content::URLFetcher::Create(
+ data_fetcher_ = net::URLFetcher::Create(
url, net::URLFetcher::GET, this);
data_fetcher_->SetRequestContext(request_context_getter_.get());
data_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES);
diff --git a/chrome/browser/intents/cws_intents_registry.cc b/chrome/browser/intents/cws_intents_registry.cc
index 8f75b78..78fc48b 100644
--- a/chrome/browser/intents/cws_intents_registry.cc
+++ b/chrome/browser/intents/cws_intents_registry.cc
@@ -14,9 +14,9 @@
#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/browser/webdata/web_data_service.h"
#include "chrome/common/net/url_util.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/load_flags.h"
#include "net/base/mime_util.h"
+#include "net/url_request/url_fetcher.h"
namespace {
@@ -160,7 +160,7 @@ void CWSIntentsRegistry::GetIntentServices(const string16& action,
const ResultsCallback& cb) {
scoped_ptr<IntentsQuery> query(new IntentsQuery);
query->callback = cb;
- query->url_fetcher.reset(content::URLFetcher::Create(
+ query->url_fetcher.reset(net::URLFetcher::Create(
0, BuildQueryURL(action,mimetype), net::URLFetcher::GET, this));
if (query->url_fetcher.get() == NULL)
diff --git a/chrome/browser/intranet_redirect_detector.cc b/chrome/browser/intranet_redirect_detector.cc
index ba6465f..16541fa 100644
--- a/chrome/browser/intranet_redirect_detector.cc
+++ b/chrome/browser/intranet_redirect_detector.cc
@@ -13,10 +13,10 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.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"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -81,7 +81,7 @@ void IntranetRedirectDetector::FinishSleep() {
for (size_t j = 0; j < kNumCharsInHostnames; ++j)
url_string += ('a' + base::RandInt(0, 'z' - 'a'));
GURL random_url(url_string + '/');
- net::URLFetcher* fetcher = content::URLFetcher::Create(
+ net::URLFetcher* fetcher = net::URLFetcher::Create(
random_url, net::URLFetcher::HEAD, this);
// We don't want these fetches to affect existing state in the profile.
fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE |
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 3b006b3..29c8861 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -34,7 +34,6 @@
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_client.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/cert_verifier.h"
#include "net/base/default_server_bound_cert_store.h"
#include "net/base/host_cache.h"
@@ -53,6 +52,7 @@
#include "net/proxy/proxy_config_service.h"
#include "net/proxy/proxy_script_fetcher_impl.h"
#include "net/proxy/proxy_service.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_throttler_manager.h"
#if defined(USE_NSS)
diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc
index 82f061e..38fbb4b 100644
--- a/chrome/browser/metrics/metrics_service.cc
+++ b/chrome/browser/metrics/metrics_service.cc
@@ -147,9 +147,9 @@
#include <algorithm>
#include "base/bind.h"
-#include "base/guid.h"
#include "base/callback.h"
#include "base/command_line.h"
+#include "base/guid.h"
#include "base/md5.h"
#include "base/metrics/histogram.h"
#include "base/rand_util.h"
@@ -191,8 +191,8 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/plugin_service.h"
#include "content/public/browser/render_process_host.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "webkit/plugins/webplugininfo.h"
// TODO(port): port browser_distribution.h.
@@ -1291,7 +1291,7 @@ void MetricsService::PrepareFetchWithStagedLog() {
// Prepare the XML version.
DCHECK(!current_fetch_xml_.get());
if (log_manager_.has_staged_log_xml()) {
- current_fetch_xml_.reset(content::URLFetcher::Create(
+ current_fetch_xml_.reset(net::URLFetcher::Create(
GURL(server_url_xml_), net::URLFetcher::POST, this));
current_fetch_xml_->SetRequestContext(
g_browser_process->system_request_context());
@@ -1306,7 +1306,7 @@ void MetricsService::PrepareFetchWithStagedLog() {
// Prepare the protobuf version.
DCHECK(!current_fetch_proto_.get());
if (log_manager_.has_staged_log_proto()) {
- current_fetch_proto_.reset(content::URLFetcher::Create(
+ current_fetch_proto_.reset(net::URLFetcher::Create(
GURL(server_url_proto_), net::URLFetcher::POST, this));
current_fetch_proto_->SetRequestContext(
g_browser_process->system_request_context());
diff --git a/chrome/browser/metrics/variations_service.cc b/chrome/browser/metrics/variations_service.cc
index 9af5718..606e658 100644
--- a/chrome/browser/metrics/variations_service.cc
+++ b/chrome/browser/metrics/variations_service.cc
@@ -16,11 +16,11 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/common/metrics/experiments_helper.h"
#include "chrome/common/pref_names.h"
-#include "content/public/common/url_fetcher.h"
#include "googleurl/src/gurl.h"
#include "net/base/load_flags.h"
#include "net/base/network_change_notifier.h"
#include "net/http/http_response_headers.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_status.h"
namespace {
@@ -107,7 +107,7 @@ void VariationsService::StartFetchingVariationsSeed() {
if (net::NetworkChangeNotifier::IsOffline())
return;
- pending_seed_request_.reset(content::URLFetcher::Create(
+ pending_seed_request_.reset(net::URLFetcher::Create(
GURL(kDefaultVariationsServer), net::URLFetcher::GET, this));
pending_seed_request_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SAVE_COOKIES);
diff --git a/chrome/browser/net/gaia/gaia_oauth_fetcher.cc b/chrome/browser/net/gaia/gaia_oauth_fetcher.cc
index 43713aa..bae1236 100644
--- a/chrome/browser/net/gaia/gaia_oauth_fetcher.cc
+++ b/chrome/browser/net/gaia/gaia_oauth_fetcher.cc
@@ -26,10 +26,10 @@
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "content/public/common/referrer.h"
-#include "content/public/common/url_fetcher.h"
#include "grit/chromium_strings.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
#include "ui/base/l10n/l10n_util.h"
@@ -68,7 +68,7 @@ net::URLFetcher* GaiaOAuthFetcher::CreateGaiaFetcher(
bool send_cookies,
net::URLFetcherDelegate* delegate) {
bool empty_body = body.empty();
- net::URLFetcher* result = content::URLFetcher::Create(
+ net::URLFetcher* result = net::URLFetcher::Create(
0, gaia_gurl,
empty_body ? net::URLFetcher::GET : net::URLFetcher::POST,
delegate);
diff --git a/chrome/browser/net/sdch_dictionary_fetcher.cc b/chrome/browser/net/sdch_dictionary_fetcher.cc
index c6a518a..e122ba7 100644
--- a/chrome/browser/net/sdch_dictionary_fetcher.cc
+++ b/chrome/browser/net/sdch_dictionary_fetcher.cc
@@ -8,8 +8,8 @@
#include "base/compiler_specific.h"
#include "base/message_loop.h"
#include "chrome/browser/profiles/profile.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -66,7 +66,7 @@ void SdchDictionaryFetcher::StartFetching() {
task_is_pending_ = false;
DCHECK(context_.get());
- current_fetch_.reset(content::URLFetcher::Create(
+ current_fetch_.reset(net::URLFetcher::Create(
fetch_queue_.front(), net::URLFetcher::GET, this));
fetch_queue_.pop();
current_fetch_->SetRequestContext(context_.get());
diff --git a/chrome/browser/policy/device_management_service.cc b/chrome/browser/policy/device_management_service.cc
index 53140de..8db4b16 100644
--- a/chrome/browser/policy/device_management_service.cc
+++ b/chrome/browser/policy/device_management_service.cc
@@ -17,7 +17,6 @@
#include "chrome/common/chrome_version_info.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_client.h"
-#include "content/public/common/url_fetcher.h"
#include "googleurl/src/gurl.h"
#include "net/base/escape.h"
#include "net/base/host_resolver.h"
@@ -28,6 +27,7 @@
#include "net/http/http_network_layer.h"
#include "net/http/http_response_headers.h"
#include "net/proxy/proxy_service.h"
+#include "net/url_request/url_fetcher.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"
@@ -510,7 +510,7 @@ DeviceManagementService::DeviceManagementService(
void DeviceManagementService::StartJob(DeviceManagementRequestJobImpl* job,
bool bypass_proxy) {
- net::URLFetcher* fetcher = content::URLFetcher::Create(
+ net::URLFetcher* fetcher = net::URLFetcher::Create(
0, job->GetURL(server_url_), net::URLFetcher::POST, this);
fetcher->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SAVE_COOKIES |
diff --git a/chrome/browser/policy/device_management_service_browsertest.cc b/chrome/browser/policy/device_management_service_browsertest.cc
index dc65b25..79e84c2 100644
--- a/chrome/browser/policy/device_management_service_browsertest.cc
+++ b/chrome/browser/policy/device_management_service_browsertest.cc
@@ -8,9 +8,9 @@
#include "chrome/browser/policy/cloud_policy_constants.h"
#include "chrome/browser/policy/device_management_service.h"
#include "chrome/test/base/in_process_browser_test.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/upload_data.h"
#include "net/test/test_server.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_test_job.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -94,7 +94,7 @@ class DeviceManagementServiceIntegrationTest
const em::DeviceManagementResponse&));
std::string InitCannedResponse() {
- content::URLFetcher::SetEnableInterceptionForTests(true);
+ net::URLFetcher::SetEnableInterceptionForTests(true);
interceptor_.reset(new CannedResponseInterceptor(GURL(kServiceUrl)));
return kServiceUrl;
}
diff --git a/chrome/browser/profiles/profile_downloader.cc b/chrome/browser/profiles/profile_downloader.cc
index c4d50ac..0b2211f 100644
--- a/chrome/browser/profiles/profile_downloader.cc
+++ b/chrome/browser/profiles/profile_downloader.cc
@@ -28,9 +28,9 @@
#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 "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "skia/ext/image_operations.h"
using content::BrowserThread;
@@ -244,7 +244,7 @@ std::string ProfileDownloader::GetProfilePictureURL() const {
void ProfileDownloader::StartFetchingImage() {
VLOG(1) << "Fetching user entry with token: " << auth_token_;
- user_entry_fetcher_.reset(content::URLFetcher::Create(
+ user_entry_fetcher_.reset(net::URLFetcher::Create(
GURL(kUserEntryURL), net::URLFetcher::GET, this));
user_entry_fetcher_->SetRequestContext(
delegate_->GetBrowserProfile()->GetRequestContext());
@@ -308,7 +308,7 @@ void ProfileDownloader::OnURLFetchComplete(const net::URLFetcher* source) {
}
VLOG(1) << "Fetching profile image from " << image_url;
picture_url_ = image_url;
- profile_image_fetcher_.reset(content::URLFetcher::Create(
+ profile_image_fetcher_.reset(net::URLFetcher::Create(
GURL(image_url), net::URLFetcher::GET, this));
profile_image_fetcher_->SetRequestContext(
delegate_->GetBrowserProfile()->GetRequestContext());
diff --git a/chrome/browser/safe_browsing/client_side_detection_service.cc b/chrome/browser/safe_browsing/client_side_detection_service.cc
index b00682b..0d989bd 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_service.cc
@@ -24,12 +24,12 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_process_host.h"
-#include "content/public/common/url_fetcher.h"
#include "crypto/sha2.h"
#include "googleurl/src/gurl.h"
#include "net/base/load_flags.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -249,7 +249,7 @@ 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(content::URLFetcher::Create(
+ model_fetcher_.reset(net::URLFetcher::Create(
0 /* ID used for testing */, GURL(kClientModelUrl),
net::URLFetcher::GET, this));
model_fetcher_->SetRequestContext(request_context_getter_.get());
@@ -302,7 +302,7 @@ void ClientSideDetectionService::StartClientReportPhishingRequest(
return;
}
- net::URLFetcher* fetcher = content::URLFetcher::Create(
+ net::URLFetcher* fetcher = net::URLFetcher::Create(
0 /* ID used for testing */, GURL(kClientReportPhishingUrl),
net::URLFetcher::POST, this);
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc
index 9a66f2b..385d108 100644
--- a/chrome/browser/safe_browsing/download_protection_service.cc
+++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -27,11 +27,11 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_item.h"
#include "content/public/browser/page_navigator.h"
-#include "content/public/common/url_fetcher.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.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"
@@ -688,10 +688,10 @@ class DownloadProtectionService::CheckClientDownloadRequest
VLOG(2) << "Sending a request for URL: "
<< info_.download_url_chain.back();
- fetcher_.reset(content::URLFetcher::Create(0 /* ID used for testing */,
- GURL(kDownloadRequestUrl),
- net::URLFetcher::POST,
- this));
+ fetcher_.reset(net::URLFetcher::Create(0 /* ID used for testing */,
+ GURL(kDownloadRequestUrl),
+ net::URLFetcher::POST,
+ this));
fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE);
fetcher_->SetAutomaticallyRetryOn5xx(false); // Don't retry on error.
fetcher_->SetRequestContext(service_->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 fa98e81..cdd0090 100644
--- a/chrome/browser/safe_browsing/malware_details_cache.cc
+++ b/chrome/browser/safe_browsing/malware_details_cache.cc
@@ -15,11 +15,11 @@
#include "chrome/browser/safe_browsing/report.pb.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/host_port_pair.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -82,7 +82,7 @@ void MalwareDetailsCacheCollector::OpenEntry() {
return;
}
- current_fetch_.reset(content::URLFetcher::Create(
+ current_fetch_.reset(net::URLFetcher::Create(
GURL(resources_it_->first), net::URLFetcher::GET, this));
current_fetch_->SetRequestContext(request_context_getter_);
// Only from cache, and don't save cookies.
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index 9b3d98d..3329d0b 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -20,9 +20,9 @@
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/env_vars.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -153,7 +153,7 @@ void SafeBrowsingProtocolManager::GetFullHash(
return;
}
GURL gethash_url = GetHashUrl();
- net::URLFetcher* fetcher = content::URLFetcher::Create(
+ net::URLFetcher* fetcher = net::URLFetcher::Create(
gethash_url, net::URLFetcher::POST, this);
hash_requests_[fetcher] = check;
@@ -497,7 +497,7 @@ void SafeBrowsingProtocolManager::IssueChunkRequest() {
DCHECK(!next_chunk.url.empty());
GURL chunk_url = NextChunkUrl(next_chunk.url);
request_type_ = CHUNK_REQUEST;
- request_.reset(content::URLFetcher::Create(
+ request_.reset(net::URLFetcher::Create(
chunk_url, net::URLFetcher::GET, this));
request_->SetLoadFlags(net::LOAD_DISABLE_CACHE);
request_->SetRequestContext(request_context_getter_);
@@ -538,7 +538,7 @@ void SafeBrowsingProtocolManager::OnGetChunksComplete(
SBListChunkRanges(safe_browsing_util::kMalwareList)));
GURL update_url = UpdateUrl();
- request_.reset(content::URLFetcher::Create(
+ request_.reset(net::URLFetcher::Create(
update_url, net::URLFetcher::POST, this));
request_->SetLoadFlags(net::LOAD_DISABLE_CACHE);
request_->SetRequestContext(request_context_getter_);
@@ -582,7 +582,7 @@ void SafeBrowsingProtocolManager::ReportSafeBrowsingHit(
GURL report_url = SafeBrowsingHitUrl(malicious_url, page_url,
referrer_url, is_subresource,
threat_type);
- net::URLFetcher* report = content::URLFetcher::Create(
+ net::URLFetcher* report = net::URLFetcher::Create(
report_url,
post_data.empty() ? net::URLFetcher::GET : net::URLFetcher::POST,
this);
@@ -598,7 +598,7 @@ void SafeBrowsingProtocolManager::ReportSafeBrowsingHit(
void SafeBrowsingProtocolManager::ReportMalwareDetails(
const std::string& report) {
GURL report_url = MalwareDetailsUrl();
- net::URLFetcher* fetcher = content::URLFetcher::Create(
+ net::URLFetcher* fetcher = net::URLFetcher::Create(
report_url, net::URLFetcher::POST, this);
fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE);
fetcher->SetRequestContext(request_context_getter_);
diff --git a/chrome/browser/safe_browsing/safe_browsing_test.cc b/chrome/browser/safe_browsing/safe_browsing_test.cc
index 596df2d..f3aa7c1 100644
--- a/chrome/browser/safe_browsing/safe_browsing_test.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_test.cc
@@ -38,12 +38,12 @@
#include "chrome/test/base/in_process_browser_test.h"
#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/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.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_request_status.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -528,7 +528,7 @@ class SafeBrowsingServiceTestHelper
// Fetch a URL. If message_loop_started is true, starts the message loop
// so the caller could wait till OnURLFetchComplete is called.
net::URLRequestStatus::Status FetchUrl(const GURL& url) {
- url_fetcher_.reset(content::URLFetcher::Create(
+ url_fetcher_.reset(net::URLFetcher::Create(
url, net::URLFetcher::GET, this));
url_fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE);
url_fetcher_->SetRequestContext(request_context_);
diff --git a/chrome/browser/search_engines/template_url_fetcher.cc b/chrome/browser/search_engines/template_url_fetcher.cc
index 60b8ade..5823d2f 100644
--- a/chrome/browser/search_engines/template_url_fetcher.cc
+++ b/chrome/browser/search_engines/template_url_fetcher.cc
@@ -23,6 +23,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/common/url_fetcher.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_request_status.h"
@@ -85,7 +86,7 @@ TemplateURLFetcher::RequestDelegate::RequestDelegate(
content::WebContents* web_contents,
TemplateURLFetcherCallbacks* callbacks,
ProviderType provider_type)
- : ALLOW_THIS_IN_INITIALIZER_LIST(url_fetcher_(content::URLFetcher::Create(
+ : ALLOW_THIS_IN_INITIALIZER_LIST(url_fetcher_(net::URLFetcher::Create(
osdd_url, net::URLFetcher::GET, this))),
fetcher_(fetcher),
keyword_(keyword),
diff --git a/chrome/browser/spellchecker/spellcheck_host_impl.cc b/chrome/browser/spellchecker/spellcheck_host_impl.cc
index 4615576..b969298 100644
--- a/chrome/browser/spellchecker/spellcheck_host_impl.cc
+++ b/chrome/browser/spellchecker/spellcheck_host_impl.cc
@@ -28,9 +28,9 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_process_host.h"
-#include "content/public/common/url_fetcher.h"
#include "googleurl/src/gurl.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "third_party/hunspell/google/bdict.h"
#include "ui/base/l10n/l10n_util.h"
@@ -283,8 +283,8 @@ void SpellCheckHostImpl::DownloadDictionary() {
}
GURL url = GURL(std::string(kDownloadServerUrl) +
StringToLowerASCII(bdict_file));
- fetcher_.reset(content::URLFetcher::Create(url, net::URLFetcher::GET,
- weak_ptr_factory_.GetWeakPtr()));
+ fetcher_.reset(net::URLFetcher::Create(url, net::URLFetcher::GET,
+ weak_ptr_factory_.GetWeakPtr()));
fetcher_->SetRequestContext(request_context_getter_);
fetcher_->SetLoadFlags(
net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES);
diff --git a/chrome/browser/spellchecker/spellcheck_message_filter.cc b/chrome/browser/spellchecker/spellcheck_message_filter.cc
index f9eae96..885f59d 100644
--- a/chrome/browser/spellchecker/spellcheck_message_filter.cc
+++ b/chrome/browser/spellchecker/spellcheck_message_filter.cc
@@ -14,7 +14,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/spellcheck_messages.h"
#include "content/public/browser/render_process_host.h"
-#include "content/public/common/url_fetcher.h"
+#include "net/url_request/url_fetcher.h"
using content::BrowserThread;
diff --git a/chrome/browser/spellchecker/spelling_service_client.cc b/chrome/browser/spellchecker/spelling_service_client.cc
index e318a98..72c4938 100644
--- a/chrome/browser/spellchecker/spelling_service_client.cc
+++ b/chrome/browser/spellchecker/spelling_service_client.cc
@@ -16,8 +16,8 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/spellcheck_result.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "unicode/uloc.h"
#if defined(GOOGLE_CHROME_BUILD)
@@ -142,7 +142,7 @@ void SpellingServiceClient::OnURLFetchComplete(
}
net::URLFetcher* SpellingServiceClient::CreateURLFetcher(const GURL& url) {
- return content::URLFetcher::Create(url, net::URLFetcher::POST, this);
+ return net::URLFetcher::Create(url, net::URLFetcher::POST, this);
}
bool SpellingServiceClient::ParseResponse(
diff --git a/chrome/browser/sync/glue/http_bridge.cc b/chrome/browser/sync/glue/http_bridge.cc
index 78fc872..1387279 100644
--- a/chrome/browser/sync/glue/http_bridge.cc
+++ b/chrome/browser/sync/glue/http_bridge.cc
@@ -9,7 +9,6 @@
#include "base/string_number_conversions.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_client.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/host_resolver.h"
#include "net/base/load_flags.h"
#include "net/base/net_errors.h"
@@ -18,6 +17,7 @@
#include "net/http/http_network_layer.h"
#include "net/http/http_response_headers.h"
#include "net/proxy/proxy_service.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_status.h"
@@ -221,7 +221,7 @@ void HttpBridge::MakeAsynchronousPost() {
if (fetch_state_.aborted)
return;
- fetch_state_.url_poster = content::URLFetcher::Create(
+ fetch_state_.url_poster = net::URLFetcher::Create(
url_for_request_, net::URLFetcher::POST, this);
fetch_state_.url_poster->SetRequestContext(context_getter_for_request_);
fetch_state_.url_poster->SetUploadData(content_type_, request_content_);
diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc
index 2c6a50e..e936f921 100644
--- a/chrome/browser/sync/test/integration/sync_test.cc
+++ b/chrome/browser/sync/test/integration/sync_test.cc
@@ -36,7 +36,6 @@
#include "chrome/test/base/testing_browser_process.h"
#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/test/test_browser_thread.h"
#include "content/public/test/test_url_fetcher_factory.h"
#include "googleurl/src/gurl.h"
@@ -47,6 +46,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.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"
@@ -561,7 +561,7 @@ bool SyncTest::IsTestServerRunning() {
std::string sync_url = cl->GetSwitchValueASCII(switches::kSyncServiceURL);
GURL sync_url_status(sync_url.append("/healthz"));
SyncServerStatusChecker delegate;
- scoped_ptr<net::URLFetcher> fetcher(content::URLFetcher::Create(
+ scoped_ptr<net::URLFetcher> fetcher(net::URLFetcher::Create(
sync_url_status, net::URLFetcher::GET, &delegate));
fetcher->SetLoadFlags(net::LOAD_DISABLE_CACHE |
net::LOAD_DO_NOT_SEND_COOKIES |
diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc
index 758d89f..3979c3e 100644
--- a/chrome/browser/translate/translate_manager.cc
+++ b/chrome/browser/translate/translate_manager.cc
@@ -45,10 +45,10 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/common/url_fetcher.h"
#include "grit/browser_resources.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_status.h"
#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
@@ -812,7 +812,7 @@ void TranslateManager::FetchLanguageListFromTranslateServer(
std::string language_list_fetch_url = base::StringPrintf(
kLanguageListFetchURL,
GetLanguageCode(g_browser_process->GetApplicationLocale()).c_str());
- language_list_request_pending_.reset(content::URLFetcher::Create(
+ language_list_request_pending_.reset(net::URLFetcher::Create(
1, GURL(language_list_fetch_url), net::URLFetcher::GET, this));
language_list_request_pending_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
net::LOAD_DO_NOT_SAVE_COOKIES);
@@ -834,7 +834,7 @@ void TranslateManager::RequestTranslateScript() {
std::string translate_script_url = base::StringPrintf(
kTranslateScriptURL,
GetLanguageCode(g_browser_process->GetApplicationLocale()).c_str());
- translate_script_request_pending_.reset(content::URLFetcher::Create(
+ translate_script_request_pending_.reset(net::URLFetcher::Create(
0, GURL(translate_script_url), net::URLFetcher::GET, this));
translate_script_request_pending_->SetLoadFlags(
net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES);
diff --git a/chrome/browser/ui/intents/web_intent_picker_controller.cc b/chrome/browser/ui/intents/web_intent_picker_controller.cc
index 4866beb..c4d9c29 100644
--- a/chrome/browser/ui/intents/web_intent_picker_controller.cc
+++ b/chrome/browser/ui/intents/web_intent_picker_controller.cc
@@ -33,9 +33,9 @@
#include "content/public/browser/notification_source.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_intents_dispatcher.h"
-#include "content/public/common/url_fetcher.h"
#include "grit/generated_resources.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "skia/ext/image_operations.h"
#include "ui/base/l10n/l10n_util.h"
@@ -560,7 +560,7 @@ void WebIntentPickerController::OnCWSIntentServicesAvailable(
info.average_rating);
pending_async_count_++;
- net::URLFetcher* icon_url_fetcher = content::URLFetcher::Create(
+ net::URLFetcher* icon_url_fetcher = net::URLFetcher::Create(
0,
info.icon_url,
net::URLFetcher::GET,
diff --git a/chrome/browser/web_resource/web_resource_service.cc b/chrome/browser/web_resource/web_resource_service.cc
index 3b50ae9..eb4c10a 100644
--- a/chrome/browser/web_resource/web_resource_service.cc
+++ b/chrome/browser/web_resource/web_resource_service.cc
@@ -22,9 +22,9 @@
#include "content/public/browser/resource_dispatcher_host.h"
#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 "googleurl/src/gurl.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_status.h"
using content::BrowserThread;
@@ -207,7 +207,7 @@ void WebResourceService::StartFetch() {
web_resource_server_;
DVLOG(1) << "WebResourceService StartFetch " << web_resource_server;
- url_fetcher_.reset(content::URLFetcher::Create(
+ url_fetcher_.reset(net::URLFetcher::Create(
web_resource_server, net::URLFetcher::GET, this));
// Do not let url fetcher affect existing state in system context
// (by setting cookies, for example).
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 48c6543..82648fa 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -34,6 +34,7 @@
'variations_seed_proto',
'../build/temp_gyp/googleurl.gyp:googleurl',
'../content/content.gyp:content_browser',
+ '../content/content.gyp:content_common',
'../crypto/crypto.gyp:crypto',
'../media/media.gyp:media',
'../net/net.gyp:net',
diff --git a/chrome/common/net/gaia/gaia_auth_fetcher.cc b/chrome/common/net/gaia/gaia_auth_fetcher.cc
index 130a187..2dfac96 100644
--- a/chrome/common/net/gaia/gaia_auth_fetcher.cc
+++ b/chrome/common/net/gaia/gaia_auth_fetcher.cc
@@ -19,10 +19,10 @@
#include "chrome/common/net/gaia/gaia_constants.h"
#include "chrome/common/net/gaia/gaia_urls.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -205,7 +205,7 @@ net::URLFetcher* GaiaAuthFetcher::CreateGaiaFetcher(
const GURL& gaia_gurl,
int load_flags,
net::URLFetcherDelegate* delegate) {
- net::URLFetcher* to_return = content::URLFetcher::Create(
+ net::URLFetcher* to_return = net::URLFetcher::Create(
0, gaia_gurl,
body == "" ? net::URLFetcher::GET : net::URLFetcher::POST,
delegate);
diff --git a/chrome/common/net/gaia/gaia_oauth_client.cc b/chrome/common/net/gaia/gaia_oauth_client.cc
index 6705597..e62f93e7 100644
--- a/chrome/common/net/gaia/gaia_oauth_client.cc
+++ b/chrome/common/net/gaia/gaia_oauth_client.cc
@@ -8,10 +8,10 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
-#include "content/public/common/url_fetcher.h"
#include "googleurl/src/gurl.h"
#include "net/base/escape.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_request_context_getter.h"
@@ -100,7 +100,7 @@ void GaiaOAuthClient::Core::MakeGaiaRequest(
DCHECK(!request_.get()) << "Tried to fetch two things at once!";
delegate_ = delegate;
num_retries_ = 0;
- request_.reset(content::URLFetcher::Create(
+ request_.reset(net::URLFetcher::Create(
0, gaia_url_, net::URLFetcher::POST, this));
request_->SetRequestContext(request_context_getter_);
request_->SetUploadData("application/x-www-form-urlencoded", post_body);
diff --git a/chrome/common/net/gaia/oauth2_access_token_fetcher.cc b/chrome/common/net/gaia/oauth2_access_token_fetcher.cc
index 04b1851..595ecae 100644
--- a/chrome/common/net/gaia/oauth2_access_token_fetcher.cc
+++ b/chrome/common/net/gaia/oauth2_access_token_fetcher.cc
@@ -14,10 +14,10 @@
#include "base/values.h"
#include "chrome/common/net/gaia/gaia_urls.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -59,7 +59,7 @@ static URLFetcher* CreateFetcher(URLRequestContextGetter* getter,
const std::string& body,
URLFetcherDelegate* delegate) {
bool empty_body = body.empty();
- URLFetcher* result = content::URLFetcher::Create(
+ URLFetcher* result = net::URLFetcher::Create(
0, url,
empty_body ? URLFetcher::GET : URLFetcher::POST,
delegate);
diff --git a/chrome/common/net/gaia/oauth2_access_token_fetcher_unittest.cc b/chrome/common/net/gaia/oauth2_access_token_fetcher_unittest.cc
index 3059a35..b758e40 100644
--- a/chrome/common/net/gaia/oauth2_access_token_fetcher_unittest.cc
+++ b/chrome/common/net/gaia/oauth2_access_token_fetcher_unittest.cc
@@ -13,11 +13,11 @@
#include "chrome/common/net/gaia/oauth2_access_token_consumer.h"
#include "chrome/common/net/gaia/oauth2_access_token_fetcher.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/public/common/url_fetcher.h"
#include "content/public/test/test_browser_thread.h"
#include "content/public/test/test_url_fetcher_factory.h"
#include "googleurl/src/gurl.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_fetcher_factory.h"
#include "net/url_request/url_request.h"
diff --git a/chrome/common/net/gaia/oauth2_api_call_flow.cc b/chrome/common/net/gaia/oauth2_api_call_flow.cc
index 5fe29192..6426d7e 100644
--- a/chrome/common/net/gaia/oauth2_api_call_flow.cc
+++ b/chrome/common/net/gaia/oauth2_api_call_flow.cc
@@ -10,10 +10,10 @@
#include "base/basictypes.h"
#include "base/stringprintf.h"
#include "chrome/common/net/gaia/gaia_urls.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -148,7 +148,7 @@ void OAuth2ApiCallFlow::OnGetTokenFailure(
URLFetcher* OAuth2ApiCallFlow::CreateURLFetcher() {
std::string body = CreateApiCallBody();
bool empty_body = body.empty();
- URLFetcher* result = content::URLFetcher::Create(
+ URLFetcher* result = net::URLFetcher::Create(
0,
CreateApiCallUrl(),
empty_body ? URLFetcher::GET : URLFetcher::POST,
diff --git a/chrome/common/net/gaia/oauth2_api_call_flow_unittest.cc b/chrome/common/net/gaia/oauth2_api_call_flow_unittest.cc
index 34f60ca..ca87e79 100644
--- a/chrome/common/net/gaia/oauth2_api_call_flow_unittest.cc
+++ b/chrome/common/net/gaia/oauth2_api_call_flow_unittest.cc
@@ -14,10 +14,10 @@
#include "chrome/common/net/gaia/oauth2_access_token_fetcher.h"
#include "chrome/common/net/gaia/oauth2_api_call_flow.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/public/common/url_fetcher.h"
#include "content/public/test/test_url_fetcher_factory.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_fetcher_factory.h"
#include "net/url_request/url_request.h"
diff --git a/chrome/common/net/gaia/oauth2_mint_token_fetcher.cc b/chrome/common/net/gaia/oauth2_mint_token_fetcher.cc
index 0d191ba..e46b307 100644
--- a/chrome/common/net/gaia/oauth2_mint_token_fetcher.cc
+++ b/chrome/common/net/gaia/oauth2_mint_token_fetcher.cc
@@ -13,10 +13,10 @@
#include "base/values.h"
#include "chrome/common/net/gaia/gaia_urls.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -54,7 +54,7 @@ static URLFetcher* CreateFetcher(URLRequestContextGetter* getter,
const std::string& body,
URLFetcherDelegate* delegate) {
bool empty_body = body.empty();
- URLFetcher* result = content::URLFetcher::Create(
+ URLFetcher* result = net::URLFetcher::Create(
0, url,
empty_body ? URLFetcher::GET : URLFetcher::POST,
delegate);
diff --git a/chrome/common/net/gaia/oauth2_mint_token_fetcher_unittest.cc b/chrome/common/net/gaia/oauth2_mint_token_fetcher_unittest.cc
index ed5a76a..3fe0c66 100644
--- a/chrome/common/net/gaia/oauth2_mint_token_fetcher_unittest.cc
+++ b/chrome/common/net/gaia/oauth2_mint_token_fetcher_unittest.cc
@@ -14,11 +14,11 @@
#include "chrome/common/net/gaia/oauth2_mint_token_consumer.h"
#include "chrome/common/net/gaia/oauth2_mint_token_fetcher.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/public/common/url_fetcher.h"
#include "content/public/test/test_browser_thread.h"
#include "content/public/test/test_url_fetcher_factory.h"
#include "googleurl/src/gurl.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_fetcher_factory.h"
#include "net/url_request/url_request.h"
diff --git a/chrome/common/net/gaia/oauth2_mint_token_flow.cc b/chrome/common/net/gaia/oauth2_mint_token_flow.cc
index b15a459..b5c9e51 100644
--- a/chrome/common/net/gaia/oauth2_mint_token_flow.cc
+++ b/chrome/common/net/gaia/oauth2_mint_token_flow.cc
@@ -18,8 +18,8 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/net/gaia/gaia_urls.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
diff --git a/chrome/common/net/gaia/oauth2_revocation_fetcher.cc b/chrome/common/net/gaia/oauth2_revocation_fetcher.cc
index f04c55b..63a4baf 100644
--- a/chrome/common/net/gaia/oauth2_revocation_fetcher.cc
+++ b/chrome/common/net/gaia/oauth2_revocation_fetcher.cc
@@ -14,10 +14,10 @@
#include "base/values.h"
#include "chrome/common/net/gaia/gaia_urls.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -54,7 +54,7 @@ static URLFetcher* CreateFetcher(URLRequestContextGetter* getter,
const std::string& body,
URLFetcherDelegate* delegate) {
bool empty_body = body.empty();
- URLFetcher* result = content::URLFetcher::Create(
+ URLFetcher* result = net::URLFetcher::Create(
0, url,
empty_body ? URLFetcher::GET : URLFetcher::POST,
delegate);
diff --git a/chrome/common/net/gaia/oauth2_revocation_fetcher_unittest.cc b/chrome/common/net/gaia/oauth2_revocation_fetcher_unittest.cc
index 02ca937..aec0c82 100644
--- a/chrome/common/net/gaia/oauth2_revocation_fetcher_unittest.cc
+++ b/chrome/common/net/gaia/oauth2_revocation_fetcher_unittest.cc
@@ -13,11 +13,11 @@
#include "chrome/common/net/gaia/oauth2_revocation_consumer.h"
#include "chrome/common/net/gaia/oauth2_revocation_fetcher.h"
#include "chrome/test/base/testing_profile.h"
-#include "content/public/common/url_fetcher.h"
#include "content/public/test/test_browser_thread.h"
#include "content/public/test/test_url_fetcher_factory.h"
#include "googleurl/src/gurl.h"
#include "net/http/http_status_code.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_fetcher_delegate.h"
#include "net/url_request/url_fetcher_factory.h"
#include "net/url_request/url_request.h"
diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher.cc b/chrome/service/cloud_print/cloud_print_url_fetcher.cc
index 884e27a..95ed8db 100644
--- a/chrome/service/cloud_print/cloud_print_url_fetcher.cc
+++ b/chrome/service/cloud_print/cloud_print_url_fetcher.cc
@@ -12,10 +12,10 @@
#include "chrome/service/cloud_print/cloud_print_token_store.h"
#include "chrome/service/net/service_url_request_context.h"
#include "chrome/service/service_process.h"
-#include "content/public/common/url_fetcher.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.h"
#include "net/url_request/url_request_status.h"
CloudPrintURLFetcher::CloudPrintURLFetcher()
@@ -144,7 +144,7 @@ void CloudPrintURLFetcher::StartRequestHelper(
DCHECK(delegate);
// Persist the additional headers in case we need to retry the request.
additional_headers_ = additional_headers;
- request_.reset(content::URLFetcher::Create(url, request_type, this));
+ request_.reset(net::URLFetcher::Create(url, request_type, this));
request_->SetRequestContext(GetRequestContextGetter());
// Since we implement our own retry logic, disable the retry in URLFetcher.
request_->SetAutomaticallyRetryOn5xx(false);
diff --git a/chrome/service/gaia/service_gaia_authenticator.cc b/chrome/service/gaia/service_gaia_authenticator.cc
index 8f0bb7e..b635bfc 100644
--- a/chrome/service/gaia/service_gaia_authenticator.cc
+++ b/chrome/service/gaia/service_gaia_authenticator.cc
@@ -8,8 +8,8 @@
#include "base/message_loop_proxy.h"
#include "chrome/service/net/service_url_request_context.h"
#include "chrome/service/service_process.h"
-#include "content/public/common/url_fetcher.h"
#include "googleurl/src/gurl.h"
+#include "net/url_request/url_fetcher.h"
ServiceGaiaAuthenticator::ServiceGaiaAuthenticator(
const std::string& user_agent, const std::string& service_id,
@@ -78,7 +78,7 @@ ServiceGaiaAuthenticator::~ServiceGaiaAuthenticator() {}
void ServiceGaiaAuthenticator::DoPost(const GURL& post_url,
const std::string& post_body) {
DCHECK(io_message_loop_proxy_->BelongsToCurrentThread());
- net::URLFetcher* request = content::URLFetcher::Create(
+ net::URLFetcher* request = net::URLFetcher::Create(
post_url, net::URLFetcher::POST, this);
request->SetRequestContext(
g_service_process->GetServiceURLRequestContextGetter());
diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc
index 7b77781..d585f30 100644
--- a/chrome/service/service_process.cc
+++ b/chrome/service/service_process.cc
@@ -26,17 +26,17 @@
#include "chrome/service/net/service_url_request_context.h"
#include "chrome/service/service_ipc_server.h"
#include "chrome/service/service_process_prefs.h"
-#include "content/public/common/url_fetcher.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "net/base/network_change_notifier.h"
+#include "net/url_request/url_fetcher.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_switches.h"
#if defined(TOOLKIT_GTK)
-#include "ui/gfx/gtk_util.h"
#include <gtk/gtk.h>
+#include "ui/gfx/gtk_util.h"
#endif
ServiceProcess* g_service_process = NULL;
@@ -71,7 +71,7 @@ ServiceIOThread::~ServiceIOThread() {
}
void ServiceIOThread::CleanUp() {
- content::URLFetcher::CancelAll();
+ net::URLFetcher::CancelAll();
}
// Prepares the localized strings that are going to be displayed to
diff --git a/content/browser/browser_process_sub_thread.cc b/content/browser/browser_process_sub_thread.cc
index bab8ead..4a705ed 100644
--- a/content/browser/browser_process_sub_thread.cc
+++ b/content/browser/browser_process_sub_thread.cc
@@ -14,7 +14,7 @@
#include "content/browser/browser_child_process_host_impl.h"
#include "content/browser/in_process_webkit/indexed_db_key_utility_client.h"
#include "content/browser/notification_service_impl.h"
-#include "content/public/common/url_fetcher.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request.h"
namespace content {
@@ -68,7 +68,7 @@ void BrowserProcessSubThread::IOThreadPreCleanUp() {
// net::URLRequest/net::URLRequestContexts.
// Destroy all URLRequests started by URLFetchers.
- content::URLFetcher::CancelAll();
+ net::URLFetcher::CancelAll();
IndexedDBKeyUtilityClient::Shutdown();
diff --git a/content/browser/geolocation/network_location_request.cc b/content/browser/geolocation/network_location_request.cc
index 9a92923..145bba5 100644
--- a/content/browser/geolocation/network_location_request.cc
+++ b/content/browser/geolocation/network_location_request.cc
@@ -13,9 +13,9 @@
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "content/public/common/geoposition.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_status.h"
@@ -85,7 +85,7 @@ bool NetworkLocationRequest::MakeRequest(const string16& access_token,
GURL request_url = FormRequestURL(url_.spec(), access_token,
wifi_data, timestamp_);
- url_fetcher_.reset(content::URLFetcher::Create(
+ url_fetcher_.reset(net::URLFetcher::Create(
url_fetcher_id_for_tests, request_url, net::URLFetcher::GET, this));
url_fetcher_->SetRequestContext(url_context_);
url_fetcher_->SetLoadFlags(
diff --git a/content/browser/speech/google_one_shot_remote_engine.cc b/content/browser/speech/google_one_shot_remote_engine.cc
index 6deec30..ff8587b 100644
--- a/content/browser/speech/google_one_shot_remote_engine.cc
+++ b/content/browser/speech/google_one_shot_remote_engine.cc
@@ -13,9 +13,9 @@
#include "content/browser/speech/audio_buffer.h"
#include "content/public/common/speech_recognition_error.h"
#include "content/public/common/speech_recognition_result.h"
-#include "content/public/common/url_fetcher.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
+#include "net/url_request/url_fetcher.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"
@@ -207,10 +207,10 @@ void GoogleOneShotRemoteEngine::StartRecognition() {
config_.audio_sample_rate,
config_.audio_num_bits_per_sample));
DCHECK(encoder_.get());
- url_fetcher_.reset(content::URLFetcher::Create(url_fetcher_id_for_tests,
- url,
- net::URLFetcher::POST,
- this));
+ url_fetcher_.reset(net::URLFetcher::Create(url_fetcher_id_for_tests,
+ url,
+ net::URLFetcher::POST,
+ this));
url_fetcher_->SetChunkedUpload(encoder_->mime_type());
url_fetcher_->SetRequestContext(url_context_);
url_fetcher_->SetReferrer(config_.origin_url);
diff --git a/content/common/net/url_fetcher.cc b/content/common/net/url_fetcher.cc
index 5b3f5cc..d356f35 100644
--- a/content/common/net/url_fetcher.cc
+++ b/content/common/net/url_fetcher.cc
@@ -6,37 +6,23 @@
#include "base/bind.h"
#include "content/common/net/url_request_user_data.h"
-#include "net/url_request/url_fetcher_factory.h"
-#include "net/url_request/url_fetcher_impl.h"
+#include "net/url_request/url_fetcher.h"
-// static
-net::URLFetcher* content::URLFetcher::Create(
- const GURL& url,
- net::URLFetcher::RequestType request_type,
- net::URLFetcherDelegate* d) {
- return new net::URLFetcherImpl(url, request_type, d);
-}
+namespace content {
+
+namespace URLFetcher {
-// static
-net::URLFetcher* content::URLFetcher::Create(
- int id,
+// We have to mark the definition as CONTENT_EXPORT, too, as the
+// declaration isn't visible from here (since it's protected by an
+// #ifdef).
+CONTENT_EXPORT net::URLFetcher* Create(
const GURL& url,
net::URLFetcher::RequestType request_type,
net::URLFetcherDelegate* d) {
- net::URLFetcherFactory* factory = net::URLFetcherImpl::factory();
- return factory ? factory->CreateURLFetcher(id, url, request_type, d) :
- new net::URLFetcherImpl(url, request_type, d);
+ return net::URLFetcher::Create(url, request_type, d);
}
-// static
-void content::URLFetcher::CancelAll() {
- net::URLFetcherImpl::CancelAll();
-}
-
-// static
-void content::URLFetcher::SetEnableInterceptionForTests(bool enabled) {
- net::URLFetcherImpl::SetEnableInterceptionForTests(enabled);
-}
+} // namespace URLFetcher
namespace {
@@ -48,8 +34,6 @@ base::SupportsUserData::Data* CreateURLRequestUserData(
} // namespace
-namespace content {
-
void AssociateURLFetcherWithRenderView(net::URLFetcher* url_fetcher,
const GURL& first_party_for_cookies,
int render_process_id,
diff --git a/content/public/common/url_fetcher.h b/content/public/common/url_fetcher.h
index ac5ba60..d30c145 100644
--- a/content/public/common/url_fetcher.h
+++ b/content/public/common/url_fetcher.h
@@ -7,46 +7,37 @@
#pragma once
#include "content/common/content_export.h"
+
+// TODO(akalin): Remove this block once rlz is updated to use
+// url_fetcher.h from net/.
+#ifdef RLZ_LIB_FINANCIAL_PING_H_
+
#include "net/url_request/url_fetcher.h"
+#endif
+
+class GURL;
+
namespace net {
-class URLFetcherDelegate;
-} // namespace net
+class URLFetcher;
+} // namespace
namespace content {
-// TODO(akalin): Move the static functions to net::URLFetcher and
-// remove content::URLFetcher.
-class CONTENT_EXPORT URLFetcher {
- public:
- // |url| is the URL to send the request to.
- // |request_type| is the type of request to make.
- // |d| the object that will receive the callback on fetch completion.
- static net::URLFetcher* Create(const GURL& url,
- net::URLFetcher::RequestType request_type,
- net::URLFetcherDelegate* d);
-
- // Like above, but if there's a URLFetcherFactory registered with the
- // implementation it will be used. |id| may be used during testing to identify
- // who is creating the URLFetcher.
- static net::URLFetcher* Create(int id,
- const GURL& url,
- net::URLFetcher::RequestType request_type,
- net::URLFetcherDelegate* d);
-
- // Cancels all existing URLFetchers. Will notify the URLFetcherDelegates.
- // Note that any new URLFetchers created while this is running will not be
- // cancelled. Typically, one would call this in the CleanUp() method of an IO
- // thread, so that no new URLRequests would be able to start on the IO thread
- // anyway. This doesn't prevent new URLFetchers from trying to post to the IO
- // thread though, even though the task won't ever run.
- static void CancelAll();
-
- // Normally interception is disabled for URLFetcher, but you can use this
- // to enable it for tests. Also see ScopedURLFetcherFactory for another way
- // of testing code that uses an URLFetcher.
- static void SetEnableInterceptionForTests(bool enabled);
-};
+// TODO(akalin): Remove this block once rlz is updated to use
+// url_fetcher.h from net/.
+#ifdef RLZ_LIB_FINANCIAL_PING_H_
+
+namespace URLFetcher {
+
+CONTENT_EXPORT net::URLFetcher* Create(
+ const GURL& url,
+ net::URLFetcher::RequestType request_type,
+ net::URLFetcherDelegate* d);
+
+} // namespace URLFetcher
+
+#endif // RLZ_LIB_FINANCIAL_PING_H_
// Mark URLRequests started by the URLFetcher to stem from the given render
// view.
diff --git a/net/url_request/url_fetcher.cc b/net/url_request/url_fetcher.cc
index 27f32fa..e0fd5d1 100644
--- a/net/url_request/url_fetcher.cc
+++ b/net/url_request/url_fetcher.cc
@@ -4,8 +4,40 @@
#include "net/url_request/url_fetcher.h"
+#include "net/url_request/url_fetcher_factory.h"
+#include "net/url_request/url_fetcher_impl.h"
+
namespace net {
URLFetcher::~URLFetcher() {}
+// static
+URLFetcher* net::URLFetcher::Create(
+ const GURL& url,
+ URLFetcher::RequestType request_type,
+ URLFetcherDelegate* d) {
+ return new URLFetcherImpl(url, request_type, d);
+}
+
+// static
+URLFetcher* net::URLFetcher::Create(
+ int id,
+ const GURL& url,
+ URLFetcher::RequestType request_type,
+ URLFetcherDelegate* d) {
+ URLFetcherFactory* factory = URLFetcherImpl::factory();
+ return factory ? factory->CreateURLFetcher(id, url, request_type, d) :
+ new URLFetcherImpl(url, request_type, d);
+}
+
+// static
+void net::URLFetcher::CancelAll() {
+ URLFetcherImpl::CancelAll();
+}
+
+// static
+void net::URLFetcher::SetEnableInterceptionForTests(bool enabled) {
+ URLFetcherImpl::SetEnableInterceptionForTests(enabled);
+}
+
} // namespace net
diff --git a/net/url_request/url_fetcher.h b/net/url_request/url_fetcher.h
index ae94e80..7349392 100644
--- a/net/url_request/url_fetcher.h
+++ b/net/url_request/url_fetcher.h
@@ -83,6 +83,34 @@ class NET_EXPORT URLFetcher {
virtual ~URLFetcher();
+ // |url| is the URL to send the request to.
+ // |request_type| is the type of request to make.
+ // |d| the object that will receive the callback on fetch completion.
+ static URLFetcher* Create(const GURL& url,
+ URLFetcher::RequestType request_type,
+ URLFetcherDelegate* d);
+
+ // Like above, but if there's a URLFetcherFactory registered with the
+ // implementation it will be used. |id| may be used during testing to identify
+ // who is creating the URLFetcher.
+ static URLFetcher* Create(int id,
+ const GURL& url,
+ URLFetcher::RequestType request_type,
+ URLFetcherDelegate* d);
+
+ // Cancels all existing URLFetchers. Will notify the URLFetcherDelegates.
+ // Note that any new URLFetchers created while this is running will not be
+ // cancelled. Typically, one would call this in the CleanUp() method of an IO
+ // thread, so that no new URLRequests would be able to start on the IO thread
+ // anyway. This doesn't prevent new URLFetchers from trying to post to the IO
+ // thread though, even though the task won't ever run.
+ static void CancelAll();
+
+ // Normally interception is disabled for URLFetcher, but you can use this
+ // to enable it for tests. Also see ScopedURLFetcherFactory for another way
+ // of testing code that uses an URLFetcher.
+ static void SetEnableInterceptionForTests(bool enabled);
+
// Sets data only needed by POSTs. All callers making POST requests should
// call this before the request is started. |upload_content_type| is the MIME
// type of the content, while |upload_content| is the data to be sent (the