diff options
author | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-31 18:49:34 +0000 |
---|---|---|
committer | sanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-31 18:49:34 +0000 |
commit | abe2c035dd58c29f9c5f00807e502baa2cc462bc (patch) | |
tree | 45c383ddc14968e16e050938f73456e13a3fe980 /chrome/browser | |
parent | 6cfef4d1548e36ecff926bdb148d9d497de4176c (diff) | |
download | chromium_src-abe2c035dd58c29f9c5f00807e502baa2cc462bc.zip chromium_src-abe2c035dd58c29f9c5f00807e502baa2cc462bc.tar.gz chromium_src-abe2c035dd58c29f9c5f00807e502baa2cc462bc.tar.bz2 |
Moved URLRequestContextGetter to net/ so it can be used by projects such as jingle.
BUG=None
TEST=Build.
Review URL: http://codereview.chromium.org/6778025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80033 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
85 files changed, 300 insertions, 235 deletions
diff --git a/chrome/browser/autofill/autofill_download.cc b/chrome/browser/autofill/autofill_download.cc index ebbce44..aa231cc 100644 --- a/chrome/browser/autofill/autofill_download.cc +++ b/chrome/browser/autofill/autofill_download.cc @@ -178,7 +178,7 @@ void AutofillDownloadManager::SetNegativeUploadRate(double rate) { bool AutofillDownloadManager::StartRequest( const std::string& form_xml, const FormRequestData& request_data) { - URLRequestContextGetter* request_context = + net::URLRequestContextGetter* request_context = Profile::GetDefaultRequestContext(); // Check if default request context is NULL: this very rarely happens, // I think, this could happen only if user opens chrome with some pages diff --git a/chrome/browser/autofill/autofill_download_unittest.cc b/chrome/browser/autofill/autofill_download_unittest.cc index 7f3785a..326961f 100644 --- a/chrome/browser/autofill/autofill_download_unittest.cc +++ b/chrome/browser/autofill/autofill_download_unittest.cc @@ -111,7 +111,7 @@ class AutofillDownloadTestHelper : public AutofillDownloadManager::Observer { TestingProfile profile; AutofillDownloadManager download_manager; - scoped_refptr<URLRequestContextGetter> request_context_getter; + scoped_refptr<net::URLRequestContextGetter> request_context_getter; }; typedef TestingBrowserProcessTest AutofillDownloadTest; diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index a65a960..e1b2bb5 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -84,7 +84,6 @@ #include "chrome/common/chrome_version_info.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/json_value_serializer.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "chrome/test/automation/tab_proxy.h" @@ -97,6 +96,7 @@ #include "net/proxy/proxy_config_service_fixed.h" #include "net/proxy/proxy_service.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "webkit/glue/password_form.h" #if defined(OS_WIN) @@ -546,7 +546,7 @@ void AutomationProvider::SendFindRequest( class SetProxyConfigTask : public Task { public: - SetProxyConfigTask(URLRequestContextGetter* request_context_getter, + SetProxyConfigTask(net::URLRequestContextGetter* request_context_getter, const std::string& new_proxy_config) : request_context_getter_(request_context_getter), proxy_config_(new_proxy_config) {} @@ -601,13 +601,14 @@ class SetProxyConfigTask : public Task { } private: - scoped_refptr<URLRequestContextGetter> request_context_getter_; + scoped_refptr<net::URLRequestContextGetter> request_context_getter_; std::string proxy_config_; }; void AutomationProvider::SetProxyConfig(const std::string& new_proxy_config) { - URLRequestContextGetter* context_getter = Profile::GetDefaultRequestContext(); + net::URLRequestContextGetter* context_getter = + Profile::GetDefaultRequestContext(); if (!context_getter) { FilePath user_data_dir; PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); diff --git a/chrome/browser/automation/automation_util.cc b/chrome/browser/automation/automation_util.cc index 57004fd..268fe44 100644 --- a/chrome/browser/automation/automation_util.cc +++ b/chrome/browser/automation/automation_util.cc @@ -15,7 +15,6 @@ #include "chrome/browser/renderer_host/browser_render_process_host.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_list.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/browser/ui/browser.h" #include "content/browser/browser_thread.h" #include "content/browser/renderer_host/render_view_host.h" @@ -23,12 +22,13 @@ #include "net/base/cookie_monster.h" #include "net/base/cookie_store.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" namespace { void GetCookiesOnIOThread( const GURL& url, - const scoped_refptr<URLRequestContextGetter>& context_getter, + const scoped_refptr<net::URLRequestContextGetter>& context_getter, base::WaitableEvent* event, std::string* cookies) { *cookies = @@ -38,7 +38,7 @@ void GetCookiesOnIOThread( void GetCanonicalCookiesOnIOThread( const GURL& url, - const scoped_refptr<URLRequestContextGetter>& context_getter, + const scoped_refptr<net::URLRequestContextGetter>& context_getter, base::WaitableEvent* event, net::CookieList* cookie_list) { *cookie_list = @@ -50,7 +50,7 @@ void GetCanonicalCookiesOnIOThread( void SetCookieOnIOThread( const GURL& url, const std::string& value, - const scoped_refptr<URLRequestContextGetter>& context_getter, + const scoped_refptr<net::URLRequestContextGetter>& context_getter, base::WaitableEvent* event, bool* success) { *success = @@ -63,7 +63,7 @@ void SetCookieWithDetailsOnIOThread( const GURL& url, const net::CookieMonster::CanonicalCookie& cookie, const std::string& original_domain, - const scoped_refptr<URLRequestContextGetter>& context_getter, + const scoped_refptr<net::URLRequestContextGetter>& context_getter, base::WaitableEvent* event, bool* success) { net::CookieMonster* cookie_monster = @@ -79,7 +79,7 @@ void SetCookieWithDetailsOnIOThread( void DeleteCookieOnIOThread( const GURL& url, const std::string& name, - const scoped_refptr<URLRequestContextGetter>& context_getter, + const scoped_refptr<net::URLRequestContextGetter>& context_getter, base::WaitableEvent* event) { context_getter->GetURLRequestContext()->cookie_store()-> DeleteCookie(url, name); @@ -115,7 +115,7 @@ void GetCookies(const GURL& url, // Get the request context specific to the current TabContents and app. const Extension* installed_app = static_cast<BrowserRenderProcessHost*>( contents->render_view_host()->process())->installed_app(); - scoped_refptr<URLRequestContextGetter> context_getter = + scoped_refptr<net::URLRequestContextGetter> context_getter = contents->profile()->GetRequestContextForPossibleApp(installed_app); base::WaitableEvent event(true /* manual reset */, @@ -141,7 +141,7 @@ void SetCookie(const GURL& url, // Get the request context specific to the current TabContents and app. const Extension* installed_app = static_cast<BrowserRenderProcessHost*>( contents->render_view_host()->process())->installed_app(); - scoped_refptr<URLRequestContextGetter> context_getter = + scoped_refptr<net::URLRequestContextGetter> context_getter = contents->profile()->GetRequestContextForPossibleApp(installed_app); base::WaitableEvent event(true /* manual reset */, @@ -168,7 +168,7 @@ void DeleteCookie(const GURL& url, // Get the request context specific to the current TabContents and app. const Extension* installed_app = static_cast<BrowserRenderProcessHost*>( contents->render_view_host()->process())->installed_app(); - scoped_refptr<URLRequestContextGetter> context_getter = + scoped_refptr<net::URLRequestContextGetter> context_getter = contents->profile()->GetRequestContextForPossibleApp(installed_app); base::WaitableEvent event(true /* manual reset */, @@ -193,7 +193,7 @@ void GetCookiesJSON(AutomationProvider* provider, } // Since we may be on the UI thread don't call GetURLRequestContext(). - scoped_refptr<URLRequestContextGetter> context_getter = + scoped_refptr<net::URLRequestContextGetter> context_getter = provider->profile()->GetRequestContext(); net::CookieList cookie_list; @@ -242,7 +242,7 @@ void DeleteCookieJSON(AutomationProvider* provider, } // Since we may be on the UI thread don't call GetURLRequestContext(). - scoped_refptr<URLRequestContextGetter> context_getter = + scoped_refptr<net::URLRequestContextGetter> context_getter = provider->profile()->GetRequestContext(); base::WaitableEvent event(true /* manual reset */, @@ -326,7 +326,7 @@ void SetCookieJSON(AutomationProvider* provider, } // Since we may be on the UI thread don't call GetURLRequestContext(). - scoped_refptr<URLRequestContextGetter> context_getter = + scoped_refptr<net::URLRequestContextGetter> context_getter = provider->profile()->GetRequestContext(); base::WaitableEvent event(true /* manual reset */, diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h index c8c9649..6bbc63d 100644 --- a/chrome/browser/browser_process.h +++ b/chrome/browser/browser_process.h @@ -41,7 +41,6 @@ class ResourceDispatcherHost; class SidebarManager; class TabCloseableStateWatcher; class ThumbnailGenerator; -class URLRequestContextGetter; class WatchDogThread; namespace base { @@ -55,6 +54,10 @@ class ProxyConfigServiceImpl; } #endif // defined(OS_CHROMEOS) +namespace net { +class URLRequestContextGetter; +} + namespace printing { class PrintJobManager; class PrintPreviewTabController; @@ -90,7 +93,7 @@ class BrowserProcess { virtual DevToolsManager* devtools_manager() = 0; virtual SidebarManager* sidebar_manager() = 0; virtual ui::Clipboard* clipboard() = 0; - virtual URLRequestContextGetter* system_request_context() = 0; + virtual net::URLRequestContextGetter* system_request_context() = 0; #if defined(OS_CHROMEOS) // Returns ChromeOS's ProxyConfigServiceImpl, creating if not yet created. diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 89ea85a..70f321e 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -56,7 +56,6 @@ #include "chrome/common/extensions/extension_l10n_util.h" #include "chrome/common/extensions/extension_resource.h" #include "chrome/common/json_pref_store.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/pref_names.h" #include "chrome/common/switch_utils.h" #include "chrome/common/url_constants.h" @@ -68,6 +67,7 @@ #include "content/browser/renderer_host/resource_dispatcher_host.h" #include "content/common/notification_service.h" #include "ipc/ipc_logging.h" +#include "net/url_request/url_request_context_getter.h" #include "ui/base/clipboard/clipboard.h" #include "ui/base/l10n/l10n_util.h" #include "webkit/database/database_tracker.h" @@ -461,7 +461,7 @@ ui::Clipboard* BrowserProcessImpl::clipboard() { return clipboard_.get(); } -URLRequestContextGetter* BrowserProcessImpl::system_request_context() { +net::URLRequestContextGetter* BrowserProcessImpl::system_request_context() { DCHECK(CalledOnValidThread()); return io_thread()->system_url_request_context_getter(); } diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h index bbe822b..77dc71f 100644 --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h @@ -64,7 +64,7 @@ class BrowserProcessImpl : public BrowserProcess, virtual DevToolsManager* devtools_manager(); virtual SidebarManager* sidebar_manager(); virtual ui::Clipboard* clipboard(); - virtual URLRequestContextGetter* system_request_context(); + virtual net::URLRequestContextGetter* system_request_context(); #if defined(OS_CHROMEOS) virtual chromeos::ProxyConfigServiceImpl* chromeos_proxy_config_service_impl(); diff --git a/chrome/browser/browsing_data_appcache_helper.h b/chrome/browser/browsing_data_appcache_helper.h index 95b09a0..6dfad26 100644 --- a/chrome/browser/browsing_data_appcache_helper.h +++ b/chrome/browser/browsing_data_appcache_helper.h @@ -8,9 +8,9 @@ #include "base/memory/scoped_ptr.h" #include "base/task.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/appcache/chrome_appcache_service.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_request_context_getter.h" class Profile; @@ -41,7 +41,7 @@ class BrowsingDataAppCacheHelper void OnFetchComplete(int rv); ChromeAppCacheService* GetAppCacheService(); - scoped_refptr<URLRequestContextGetter> request_context_getter_; + scoped_refptr<net::URLRequestContextGetter> request_context_getter_; bool is_fetching_; scoped_refptr<net::CancelableCompletionCallback<BrowsingDataAppCacheHelper> > appcache_info_callback_; diff --git a/chrome/browser/browsing_data_remover.cc b/chrome/browser/browsing_data_remover.cc index 0838789..074f9da 100644 --- a/chrome/browser/browsing_data_remover.cc +++ b/chrome/browser/browsing_data_remover.cc @@ -26,7 +26,6 @@ #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/sessions/tab_restore_service.h" #include "chrome/browser/webdata/web_data_service.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/url_constants.h" #include "content/browser/browser_thread.h" #include "content/browser/in_process_webkit/webkit_context.h" @@ -37,6 +36,7 @@ #include "net/disk_cache/disk_cache.h" #include "net/http/http_cache.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "webkit/database/database_tracker.h" #include "webkit/database/database_util.h" @@ -386,7 +386,7 @@ void BrowsingDataRemover::DoClearCache(int rv) { case STATE_CREATE_MAIN: case STATE_CREATE_MEDIA: { // Get a pointer to the cache. - URLRequestContextGetter* getter = + net::URLRequestContextGetter* getter = (next_cache_state_ == STATE_CREATE_MAIN) ? main_context_getter_ : media_context_getter_; net::HttpTransactionFactory* factory = diff --git a/chrome/browser/browsing_data_remover.h b/chrome/browser/browsing_data_remover.h index 1429c7b..6d83a84 100644 --- a/chrome/browser/browsing_data_remover.h +++ b/chrome/browser/browsing_data_remover.h @@ -20,12 +20,15 @@ class ExtensionSpecialStoragePolicy; class IOThread; class PluginDataRemover; class Profile; -class URLRequestContextGetter; namespace disk_cache { class Backend; } +namespace net { +class URLRequestContextGetter; +} + namespace webkit_database { class DatabaseTracker; } @@ -200,8 +203,8 @@ class BrowsingDataRemover : public NotificationObserver, disk_cache::Backend* cache_; // Used to delete data from HTTP cache and appcache. - scoped_refptr<URLRequestContextGetter> main_context_getter_; - scoped_refptr<URLRequestContextGetter> media_context_getter_; + scoped_refptr<net::URLRequestContextGetter> main_context_getter_; + scoped_refptr<net::URLRequestContextGetter> media_context_getter_; // Used to delete plugin data. scoped_refptr<PluginDataRemover> plugin_data_remover_; diff --git a/chrome/browser/chromeos/cros/libcros_service_library.cc b/chrome/browser/chromeos/cros/libcros_service_library.cc index 564e198..a8a3e61 100644 --- a/chrome/browser/chromeos/cros/libcros_service_library.cc +++ b/chrome/browser/chromeos/cros/libcros_service_library.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -7,12 +7,12 @@ #include "base/synchronization/lock.h" #include "chrome/browser/chromeos/cros/cros_library.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/browser_thread.h" #include "cros/chromeos_libcros_service.h" #include "net/base/net_errors.h" #include "net/proxy/proxy_service.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" namespace chromeos { @@ -208,7 +208,7 @@ void LibCrosServiceLibraryImpl::NetworkProxyLibrary::ResolveProxy( &NetworkProxyLibrary::NotifyProxyResolved, request); // Retrieve ProxyService from profile's request context. - URLRequestContextGetter* getter = Profile::GetDefaultRequestContext(); + net::URLRequestContextGetter* getter = Profile::GetDefaultRequestContext(); net::ProxyService* proxy_service = NULL; if (getter) proxy_service = getter->GetURLRequestContext()->proxy_service(); diff --git a/chrome/browser/chromeos/login/client_login_response_handler.h b/chrome/browser/chromeos/login/client_login_response_handler.h index 8fc1fe1..d0096b0 100644 --- a/chrome/browser/chromeos/login/client_login_response_handler.h +++ b/chrome/browser/chromeos/login/client_login_response_handler.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -11,7 +11,9 @@ #include "base/basictypes.h" #include "chrome/browser/chromeos/login/auth_response_handler.h" +namespace net { class URLRequestContextGetter; +} namespace chromeos { @@ -21,7 +23,7 @@ namespace chromeos { // is then sent to the IssueAuthToken endpoint. class ClientLoginResponseHandler : public AuthResponseHandler { public: - explicit ClientLoginResponseHandler(URLRequestContextGetter* getter) + explicit ClientLoginResponseHandler(net::URLRequestContextGetter* getter) : getter_(getter) {} ~ClientLoginResponseHandler() {} @@ -43,7 +45,7 @@ class ClientLoginResponseHandler : public AuthResponseHandler { static const char kService[]; private: std::string payload_; - URLRequestContextGetter* getter_; + net::URLRequestContextGetter* getter_; DISALLOW_COPY_AND_ASSIGN(ClientLoginResponseHandler); }; diff --git a/chrome/browser/chromeos/login/issue_response_handler.h b/chrome/browser/chromeos/login/issue_response_handler.h index e724111..c560921 100644 --- a/chrome/browser/chromeos/login/issue_response_handler.h +++ b/chrome/browser/chromeos/login/issue_response_handler.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -11,7 +11,9 @@ #include "base/basictypes.h" #include "chrome/browser/chromeos/login/auth_response_handler.h" +namespace net { class URLRequestContextGetter; +} namespace chromeos { @@ -22,7 +24,7 @@ namespace chromeos { // associated with |getter_|. class IssueResponseHandler : public AuthResponseHandler { public: - explicit IssueResponseHandler(URLRequestContextGetter* getter) + explicit IssueResponseHandler(net::URLRequestContextGetter* getter) : getter_(getter) {} virtual ~IssueResponseHandler() {} @@ -42,7 +44,7 @@ class IssueResponseHandler : public AuthResponseHandler { private: std::string token_url_; - URLRequestContextGetter* getter_; + net::URLRequestContextGetter* getter_; DISALLOW_COPY_AND_ASSIGN(IssueResponseHandler); }; diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc index 1406945..ea81053 100644 --- a/chrome/browser/chromeos/login/login_utils.cc +++ b/chrome/browser/chromeos/login/login_utils.cc @@ -48,7 +48,6 @@ #include "chrome/common/logging_chrome.h" #include "chrome/common/net/gaia/gaia_auth_fetcher.h" #include "chrome/common/net/gaia/gaia_constants.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/browser/browser_thread.h" @@ -56,6 +55,7 @@ #include "net/base/cookie_store.h" #include "net/proxy/proxy_config_service.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "views/widget/widget_gtk.h" #include "ui/gfx/gl/gl_switches.h" @@ -87,7 +87,7 @@ class ResetDefaultProxyConfigServiceTask : public Task { // Task override. virtual void Run() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - URLRequestContextGetter* getter = Profile::GetDefaultRequestContext(); + net::URLRequestContextGetter* getter = Profile::GetDefaultRequestContext(); DCHECK(getter); if (getter) { getter->GetURLRequestContext()->proxy_service()->ResetConfigService( diff --git a/chrome/browser/chromeos/login/online_attempt.h b/chrome/browser/chromeos/login/online_attempt.h index a5cfba5..0f4d6ca 100644 --- a/chrome/browser/chromeos/login/online_attempt.h +++ b/chrome/browser/chromeos/login/online_attempt.h @@ -18,7 +18,10 @@ class CancelableTask; class GaiaAuthFetcher; class Profile; + +namespace net { class URLRequestContextGetter; +} namespace chromeos { class AuthAttemptState; diff --git a/chrome/browser/cookies_tree_model_unittest.cc b/chrome/browser/cookies_tree_model_unittest.cc index acafc7d5..93333cb 100644 --- a/chrome/browser/cookies_tree_model_unittest.cc +++ b/chrome/browser/cookies_tree_model_unittest.cc @@ -11,11 +11,11 @@ #include "chrome/browser/mock_browsing_data_database_helper.h" #include "chrome/browser/mock_browsing_data_indexed_db_helper.h" #include "chrome/browser/mock_browsing_data_local_storage_helper.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/test/testing_profile.h" #include "content/common/notification_details.h" #include "content/common/notification_type.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/debugger/devtools_http_protocol_handler.cc b/chrome/browser/debugger/devtools_http_protocol_handler.cc index 0ee11dc..d5fedc0 100644 --- a/chrome/browser/debugger/devtools_http_protocol_handler.cc +++ b/chrome/browser/debugger/devtools_http_protocol_handler.cc @@ -19,13 +19,13 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" #include "chrome/common/devtools_messages.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/browser_thread.h" #include "content/browser/tab_contents/tab_contents.h" #include "googleurl/src/gurl.h" #include "net/base/io_buffer.h" #include "net/server/http_server_request_info.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" const int kBufferSize = 16 * 1024; diff --git a/chrome/browser/download/download_file_manager.h b/chrome/browser/download/download_file_manager.h index 622a627..39262a5 100644 --- a/chrome/browser/download/download_file_manager.h +++ b/chrome/browser/download/download_file_manager.h @@ -57,7 +57,10 @@ class DownloadManager; class FilePath; class GURL; class ResourceDispatcherHost; + +namespace net { class URLRequestContextGetter; +} // Manages all in progress downloads. class DownloadFileManager diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h index 128a007..da46168 100644 --- a/chrome/browser/download/download_manager.h +++ b/chrome/browser/download/download_manager.h @@ -52,11 +52,14 @@ class DownloadStatusUpdater; class GURL; class Profile; class ResourceDispatcherHost; -class URLRequestContextGetter; class TabContents; struct DownloadCreateInfo; struct DownloadSaveInfo; +namespace net { +class URLRequestContextGetter; +} + // Browser's download manager: manages all downloads and destination view. class DownloadManager : public base::RefCountedThreadSafe<DownloadManager, @@ -360,7 +363,7 @@ class DownloadManager // The current active profile. Profile* profile_; - scoped_refptr<URLRequestContextGetter> request_context_getter_; + scoped_refptr<net::URLRequestContextGetter> request_context_getter_; scoped_ptr<DownloadHistory> download_history_; diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index 62ff15f..ae87619 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -737,7 +737,7 @@ void DownloadUrl( ResourceDispatcherHost* rdh, int render_process_host_id, int render_view_id, - URLRequestContextGetter* request_context_getter) { + net::URLRequestContextGetter* request_context_getter) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); net::URLRequestContext* context = diff --git a/chrome/browser/download/download_util.h b/chrome/browser/download/download_util.h index dce55b7..ab109a0 100644 --- a/chrome/browser/download/download_util.h +++ b/chrome/browser/download/download_util.h @@ -32,11 +32,14 @@ class GURL; class Profile; class ResourceDispatcherHost; class SkBitmap; -class URLRequestContextGetter; struct DownloadCreateInfo; struct DownloadSaveInfo; +namespace net { +class URLRequestContextGetter; +} + namespace download_util { // Download temporary file creation -------------------------------------------- @@ -187,7 +190,7 @@ void DownloadUrl(const GURL& url, ResourceDispatcherHost* rdh, int render_process_host_id, int render_view_id, - URLRequestContextGetter* request_context_getter); + net::URLRequestContextGetter* request_context_getter); // Tells the resource dispatcher host to cancel a download request. // Must be called on the IO thread. diff --git a/chrome/browser/download/save_file_manager.cc b/chrome/browser/download/save_file_manager.cc index dfce49d..910aed6 100644 --- a/chrome/browser/download/save_file_manager.cc +++ b/chrome/browser/download/save_file_manager.cc @@ -17,7 +17,6 @@ #include "chrome/browser/platform_util.h" #include "chrome/browser/tab_contents/tab_util.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/browser_thread.h" #include "content/browser/renderer_host/resource_dispatcher_host.h" #include "content/browser/tab_contents/tab_contents.h" @@ -25,7 +24,7 @@ #include "net/base/net_util.h" #include "net/base/io_buffer.h" #include "net/url_request/url_request_context.h" - +#include "net/url_request/url_request_context_getter.h" SaveFileManager::SaveFileManager(ResourceDispatcherHost* rdh) : next_id_(0), @@ -115,14 +114,15 @@ SavePackage* SaveFileManager::LookupPackage(int save_id) { } // Call from SavePackage for starting a saving job -void SaveFileManager::SaveURL(const GURL& url, - const GURL& referrer, - int render_process_host_id, - int render_view_id, - SaveFileCreateInfo::SaveFileSource save_source, - const FilePath& file_full_path, - URLRequestContextGetter* request_context_getter, - SavePackage* save_package) { +void SaveFileManager::SaveURL( + const GURL& url, + const GURL& referrer, + int render_process_host_id, + int render_view_id, + SaveFileCreateInfo::SaveFileSource save_source, + const FilePath& file_full_path, + net::URLRequestContextGetter* request_context_getter, + SavePackage* save_package) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); // Register a saving job. @@ -359,7 +359,7 @@ void SaveFileManager::OnSaveURL( const GURL& referrer, int render_process_host_id, int render_view_id, - URLRequestContextGetter* request_context_getter) { + net::URLRequestContextGetter* request_context_getter) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); net::URLRequestContext* context = request_context_getter->GetURLRequestContext(); diff --git a/chrome/browser/download/save_file_manager.h b/chrome/browser/download/save_file_manager.h index d8c6cb9..f508d67 100644 --- a/chrome/browser/download/save_file_manager.h +++ b/chrome/browser/download/save_file_manager.h @@ -75,7 +75,10 @@ class SaveFile; class SavePackage; class ResourceDispatcherHost; class Task; + +namespace net { class URLRequestContextGetter; +} class SaveFileManager : public base::RefCountedThreadSafe<SaveFileManager> { @@ -96,7 +99,7 @@ class SaveFileManager int render_view_id, SaveFileCreateInfo::SaveFileSource save_source, const FilePath& file_full_path, - URLRequestContextGetter* request_context_getter, + net::URLRequestContextGetter* request_context_getter, SavePackage* save_package); // Notifications sent from the IO thread and run on the file thread: @@ -210,7 +213,7 @@ class SaveFileManager const GURL& referrer, int render_process_host_id, int render_view_id, - URLRequestContextGetter* request_context_getter); + net::URLRequestContextGetter* request_context_getter); // Handler for a notification sent to the IO thread for generating save id. void OnRequireSaveJobFromOtherSource(SaveFileCreateInfo* info); // Call ResourceDispatcherHost's CancelRequest method to execute cancel diff --git a/chrome/browser/download/save_package.cc b/chrome/browser/download/save_package.cc index 0c29107..c4722bd 100644 --- a/chrome/browser/download/save_package.cc +++ b/chrome/browser/download/save_package.cc @@ -35,7 +35,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/tab_contents/tab_util.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" #include "chrome/common/url_constants.h" @@ -54,6 +53,7 @@ #include "net/url_request/url_request_context.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageSerializerClient.h" #include "ui/base/l10n/l10n_util.h" +#include "net/url_request/url_request_context_getter.h" using base::Time; using WebKit::WebPageSerializerClient; diff --git a/chrome/browser/download/save_package.h b/chrome/browser/download/save_package.h index 927358e..a30560d 100644 --- a/chrome/browser/download/save_package.h +++ b/chrome/browser/download/save_package.h @@ -30,7 +30,6 @@ class MessageLoop; class PrefService; class Profile; class TabContents; -class URLRequestContextGetter; class TabContents; namespace base { @@ -38,6 +37,10 @@ class Thread; class Time; } +namespace net { +class URLRequestContextGetter; +} + struct SaveFileCreateInfo; struct SavePackageParam; @@ -264,7 +267,7 @@ class SavePackage : public base::RefCountedThreadSafe<SavePackage>, // The request context which provides application-specific context for // net::URLRequest instances. - scoped_refptr<URLRequestContextGetter> request_context_getter_; + scoped_refptr<net::URLRequestContextGetter> request_context_getter_; // Non-owning pointer for handling file writing on the file thread. SaveFileManager* file_manager_; diff --git a/chrome/browser/extensions/extension_cookies_api.cc b/chrome/browser/extensions/extension_cookies_api.cc index 09d87a8..bc0059f 100644 --- a/chrome/browser/extensions/extension_cookies_api.cc +++ b/chrome/browser/extensions/extension_cookies_api.cc @@ -16,12 +16,12 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_error_utils.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/browser_thread.h" #include "content/common/notification_service.h" #include "content/common/notification_type.h" #include "net/base/cookie_monster.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" namespace keys = extension_cookies_api_constants; @@ -134,7 +134,7 @@ bool CookiesFunction::ParseUrl(const DictionaryValue* details, GURL* url, } bool CookiesFunction::ParseStoreContext(const DictionaryValue* details, - URLRequestContextGetter** context, + net::URLRequestContextGetter** context, std::string* store_id) { DCHECK(details && (context || store_id)); Profile* store_profile = NULL; @@ -190,7 +190,7 @@ bool GetCookieFunction::RunImpl() { // Get the cookie name string or return false. EXTENSION_FUNCTION_VALIDATE(details->GetString(keys::kNameKey, &name_)); - URLRequestContextGetter* store_context = NULL; + net::URLRequestContextGetter* store_context = NULL; if (!ParseStoreContext(details, &store_context, &store_id_)) return false; @@ -252,7 +252,7 @@ bool GetAllCookiesFunction::RunImpl() { if (details_->HasKey(keys::kUrlKey) && !ParseUrl(details_, &url_, false)) return false; - URLRequestContextGetter* store_context = NULL; + net::URLRequestContextGetter* store_context = NULL; if (!ParseStoreContext(details_, &store_context, &store_id_)) return false; DCHECK(store_context); @@ -349,7 +349,7 @@ bool SetCookieFunction::RunImpl() { base::Time::UnixEpoch() : base::Time::FromDoubleT(expiration_date); } - URLRequestContextGetter* store_context = NULL; + net::URLRequestContextGetter* store_context = NULL; if (!ParseStoreContext(details, &store_context, NULL)) return false; DCHECK(store_context); @@ -422,7 +422,7 @@ bool RemoveCookieFunction::RunImpl() { // Get the cookie name string or return false. EXTENSION_FUNCTION_VALIDATE(details->GetString(keys::kNameKey, &name_)); - URLRequestContextGetter* store_context = NULL; + net::URLRequestContextGetter* store_context = NULL; if (!ParseStoreContext(details, &store_context, &store_id_)) return false; DCHECK(store_context); diff --git a/chrome/browser/extensions/extension_cookies_api.h b/chrome/browser/extensions/extension_cookies_api.h index 7c72cde..286c8ba 100644 --- a/chrome/browser/extensions/extension_cookies_api.h +++ b/chrome/browser/extensions/extension_cookies_api.h @@ -22,7 +22,10 @@ #include "net/base/cookie_monster.h" class DictionaryValue; + +namespace net { class URLRequestContextGetter; +} // Observes CookieMonster notifications and routes them as events to the // extension system. @@ -86,7 +89,7 @@ class CookiesFunction : public AsyncExtensionFunction { // At least one of the output parameters store and store_id should be // non-NULL. bool ParseStoreContext(const DictionaryValue* details, - URLRequestContextGetter** context, + net::URLRequestContextGetter** context, std::string* store_id); }; @@ -105,7 +108,7 @@ class GetCookieFunction : public CookiesFunction { std::string name_; GURL url_; std::string store_id_; - scoped_refptr<URLRequestContextGetter> store_context_; + scoped_refptr<net::URLRequestContextGetter> store_context_; }; // Implements the cookies.getAll() extension function. @@ -123,7 +126,7 @@ class GetAllCookiesFunction : public CookiesFunction { DictionaryValue* details_; GURL url_; std::string store_id_; - scoped_refptr<URLRequestContextGetter> store_context_; + scoped_refptr<net::URLRequestContextGetter> store_context_; }; // Implements the cookies.set() extension function. @@ -148,7 +151,7 @@ class SetCookieFunction : public CookiesFunction { base::Time expiration_time_; bool success_; std::string store_id_; - scoped_refptr<URLRequestContextGetter> store_context_; + scoped_refptr<net::URLRequestContextGetter> store_context_; }; // Implements the cookies.remove() extension function. @@ -167,7 +170,7 @@ class RemoveCookieFunction : public CookiesFunction { std::string name_; bool success_; std::string store_id_; - scoped_refptr<URLRequestContextGetter> store_context_; + scoped_refptr<net::URLRequestContextGetter> store_context_; }; // Implements the cookies.getAllCookieStores() extension function. diff --git a/chrome/browser/extensions/extension_data_deleter.cc b/chrome/browser/extensions/extension_data_deleter.cc index 288d66c..d442fa0 100644 --- a/chrome/browser/extensions/extension_data_deleter.cc +++ b/chrome/browser/extensions/extension_data_deleter.cc @@ -6,11 +6,11 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/extensions/extension.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/in_process_webkit/webkit_context.h" #include "net/base/cookie_monster.h" #include "net/base/net_errors.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "webkit/database/database_tracker.h" #include "webkit/database/database_util.h" #include "webkit/fileapi/file_system_context.h" diff --git a/chrome/browser/extensions/extension_data_deleter.h b/chrome/browser/extensions/extension_data_deleter.h index 908c1f6..8085138 100644 --- a/chrome/browser/extensions/extension_data_deleter.h +++ b/chrome/browser/extensions/extension_data_deleter.h @@ -20,9 +20,12 @@ class FileSystemContext; } class Profile; -class URLRequestContextGetter; class WebKitContext; +namespace net { +class URLRequestContextGetter; +} + // A helper class that takes care of removing local storage, databases and // cookies for a given extension. This is used by // ExtensionService::ClearExtensionData() upon uninstalling an extension. @@ -68,7 +71,7 @@ class ExtensionDataDeleter scoped_refptr<webkit_database::DatabaseTracker> database_tracker_; // Provides access to the extension request context. - scoped_refptr<URLRequestContextGetter> extension_request_context_; + scoped_refptr<net::URLRequestContextGetter> extension_request_context_; // The URL of the extension we're removing data for. GURL extension_url_; diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index faced99..0bfa658 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -41,7 +41,6 @@ #include "chrome/common/extensions/extension_resource.h" #include "chrome/common/extensions/url_pattern.h" #include "chrome/common/json_value_serializer.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "chrome/test/testing_profile.h" @@ -57,6 +56,7 @@ #include "net/base/cookie_monster.h" #include "net/base/cookie_options.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" #include "webkit/database/database_tracker.h" diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc index 5b8785d..22dd95c 100644 --- a/chrome/browser/google/google_url_tracker.cc +++ b/chrome/browser/google/google_url_tracker.cc @@ -14,13 +14,13 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/net/url_request_context_getter.h" #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/notification_service.h" #include "grit/generated_resources.h" #include "net/base/load_flags.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" diff --git a/chrome/browser/google/google_url_tracker_unittest.cc b/chrome/browser/google/google_url_tracker_unittest.cc index b836a03..86f959d 100644 --- a/chrome/browser/google/google_url_tracker_unittest.cc +++ b/chrome/browser/google/google_url_tracker_unittest.cc @@ -11,13 +11,13 @@ #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" #include "chrome/common/net/test_url_fetcher_factory.h" #include "chrome/common/net/url_fetcher.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/pref_names.h" #include "chrome/test/testing_browser_process.h" #include "chrome/test/testing_pref_service.h" #include "content/browser/browser_thread.h" #include "content/common/notification_service.h" #include "net/url_request/url_request.h" +#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_test_util.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chrome/browser/importer/toolbar_importer_utils.cc b/chrome/browser/importer/toolbar_importer_utils.cc index e028ad5..c751e0a 100644 --- a/chrome/browser/importer/toolbar_importer_utils.cc +++ b/chrome/browser/importer/toolbar_importer_utils.cc @@ -9,9 +9,9 @@ #include "base/string_split.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/net/url_request_context_getter.h" #include "googleurl/src/gurl.h" #include "net/base/cookie_store.h" +#include "net/url_request/url_request_context_getter.h" namespace { const char kGoogleDomainUrl[] = "http://.google.com/"; diff --git a/chrome/browser/intranet_redirect_detector.cc b/chrome/browser/intranet_redirect_detector.cc index 2ac9ab5..67e14fe 100644 --- a/chrome/browser/intranet_redirect_detector.cc +++ b/chrome/browser/intranet_redirect_detector.cc @@ -11,12 +11,12 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/pref_names.h" #include "content/common/notification_service.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_request_context_getter.h" #include "net/url_request/url_request_status.h" const size_t IntranetRedirectDetector::kNumCharsInHostnames = 10; diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index f73a5f2..f5f6811 100644 --- a/chrome/browser/io_thread.cc +++ b/chrome/browser/io_thread.cc @@ -236,12 +236,12 @@ ConstructSystemRequestContext(IOThread::Globals* globals, } // namespace -class SystemURLRequestContextGetter : public URLRequestContextGetter { +class SystemURLRequestContextGetter : public net::URLRequestContextGetter { public: explicit SystemURLRequestContextGetter(IOThread* io_thread); virtual ~SystemURLRequestContextGetter(); - // Implementation for UrlRequestContextGetter. + // Implementation for net::UrlRequestContextGetter. virtual net::URLRequestContext* GetURLRequestContext(); virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const; @@ -378,7 +378,7 @@ void IOThread::ChangedToOnTheRecord() { &IOThread::ChangedToOnTheRecordOnIOThread)); } -URLRequestContextGetter* IOThread::system_url_request_context_getter() { +net::URLRequestContextGetter* IOThread::system_url_request_context_getter() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (!system_url_request_context_getter_) { system_proxy_config_service_.reset( diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h index 4fa9a3e..019b594 100644 --- a/chrome/browser/io_thread.h +++ b/chrome/browser/io_thread.h @@ -22,7 +22,6 @@ class ListValue; class PrefProxyConfigTracker; class PrefService; class SystemURLRequestContextGetter; -class URLRequestContextGetter; namespace chrome_browser_net { class ConnectInterceptor; @@ -41,6 +40,7 @@ class ProxyScriptFetcher; class ProxyService; class SSLConfigService; class URLRequestContext; +class URLRequestContextGetter; class URLSecurityManager; } // namespace net @@ -115,7 +115,7 @@ class IOThread : public BrowserProcessSubThread { void ChangedToOnTheRecord(); // Returns a getter for the URLRequestContext. Only called on the UI thread. - URLRequestContextGetter* system_url_request_context_getter(); + net::URLRequestContextGetter* system_url_request_context_getter(); // Clear all network stack history, including the host cache, as well as // speculative data about subresources of visited sites, and startup-time @@ -199,7 +199,8 @@ class IOThread : public BrowserProcessSubThread { scoped_refptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; - scoped_refptr<URLRequestContextGetter> system_url_request_context_getter_; + scoped_refptr<net::URLRequestContextGetter> + system_url_request_context_getter_; // Keeps track of all live ChromeURLRequestContextGetters, so the // ChromeURLRequestContexts can be released during diff --git a/chrome/browser/memory_purger.cc b/chrome/browser/memory_purger.cc index c817ac3..291aa4d 100644 --- a/chrome/browser/memory_purger.cc +++ b/chrome/browser/memory_purger.cc @@ -13,7 +13,6 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/browser/webdata/web_data_service.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/render_messages.h" #include "content/browser/in_process_webkit/webkit_context.h" #include "content/browser/renderer_host/backing_store_manager.h" @@ -22,6 +21,7 @@ #include "content/common/notification_service.h" #include "net/proxy/proxy_resolver.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "third_party/tcmalloc/chromium/src/google/malloc_extension.h" #include "v8/include/v8.h" @@ -38,12 +38,12 @@ class PurgeMemoryIOHelper } void AddRequestContextGetter( - scoped_refptr<URLRequestContextGetter> request_context_getter); + scoped_refptr<net::URLRequestContextGetter> request_context_getter); void PurgeMemoryOnIOThread(); private: - typedef scoped_refptr<URLRequestContextGetter> RequestContextGetter; + typedef scoped_refptr<net::URLRequestContextGetter> RequestContextGetter; typedef std::set<RequestContextGetter> RequestContextGetters; RequestContextGetters request_context_getters_; @@ -53,7 +53,7 @@ class PurgeMemoryIOHelper }; void PurgeMemoryIOHelper::AddRequestContextGetter( - scoped_refptr<URLRequestContextGetter> request_context_getter) { + scoped_refptr<net::URLRequestContextGetter> request_context_getter) { request_context_getters_.insert(request_context_getter); } diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h index 464db23..c880bbd 100644 --- a/chrome/browser/net/chrome_url_request_context.h +++ b/chrome/browser/net/chrome_url_request_context.h @@ -17,12 +17,12 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prerender/prerender_manager.h" #include "chrome/common/extensions/extension_icon_set.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/appcache/chrome_appcache_service.h" #include "content/browser/chrome_blob_storage_context.h" #include "content/browser/host_zoom_map.h" #include "net/base/cookie_policy.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "webkit/database/database_tracker.h" #include "webkit/fileapi/file_system_context.h" @@ -174,13 +174,13 @@ class ChromeURLRequestContext : public net::URLRequestContext { DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContext); }; -// A URLRequestContextGetter subclass used by the browser. This returns a +// A net::URLRequestContextGetter subclass used by the browser. This returns a // subclass of net::URLRequestContext which can be used to store extra // information about requests. // // Most methods are expected to be called on the UI thread, except for // the destructor and GetURLRequestContext(). -class ChromeURLRequestContextGetter : public URLRequestContextGetter, +class ChromeURLRequestContextGetter : public net::URLRequestContextGetter, public NotificationObserver { public: // Constructs a ChromeURLRequestContextGetter that will use |factory| to @@ -195,7 +195,7 @@ class ChromeURLRequestContextGetter : public URLRequestContextGetter, // thread (it will assert otherwise). DONTUSEME_GetCookieStore() and // GetIOMessageLoopProxy however can be called from any thread. // - // URLRequestContextGetter implementation. + // net::URLRequestContextGetter implementation. virtual net::URLRequestContext* GetURLRequestContext(); virtual net::CookieStore* DONTUSEME_GetCookieStore(); virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const; diff --git a/chrome/browser/net/cookie_policy_browsertest.cc b/chrome/browser/net/cookie_policy_browsertest.cc index 7915167..41aa66e 100644 --- a/chrome/browser/net/cookie_policy_browsertest.cc +++ b/chrome/browser/net/cookie_policy_browsertest.cc @@ -7,20 +7,20 @@ #include "chrome/browser/content_settings/host_content_settings_map.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "net/base/cookie_store.h" #include "net/base/mock_host_resolver.h" #include "net/test/test_server.h" #include "net/url_request/url_request_context.cc" +#include "net/url_request/url_request_context_getter.h" namespace { class GetCookiesTask : public Task { public: GetCookiesTask(const GURL& url, - URLRequestContextGetter* context_getter, + net::URLRequestContextGetter* context_getter, base::WaitableEvent* event, std::string* cookies) : url_(url), @@ -37,7 +37,7 @@ class GetCookiesTask : public Task { private: const GURL& url_; - URLRequestContextGetter* const context_getter_; + net::URLRequestContextGetter* const context_getter_; base::WaitableEvent* const event_; std::string* const cookies_; @@ -52,7 +52,7 @@ class CookiePolicyBrowserTest : public InProcessBrowserTest { std::string cookies; base::WaitableEvent event(true /* manual reset */, false /* not initially signaled */); - URLRequestContextGetter* context_getter = + net::URLRequestContextGetter* context_getter = browser()->profile()->GetRequestContext(); EXPECT_TRUE( BrowserThread::PostTask( diff --git a/chrome/browser/net/gaia/token_service.cc b/chrome/browser/net/gaia/token_service.cc index 5a1a888..98a07da 100644 --- a/chrome/browser/net/gaia/token_service.cc +++ b/chrome/browser/net/gaia/token_service.cc @@ -10,9 +10,9 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/net/gaia/gaia_auth_fetcher.h" #include "chrome/common/net/gaia/gaia_constants.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/browser_thread.h" #include "content/common/notification_service.h" +#include "net/url_request/url_request_context_getter.h" // Unfortunately kNumServices must be defined in the .h. // TODO(chron): Sync doesn't use the TalkToken anymore so we can stop diff --git a/chrome/browser/net/gaia/token_service.h b/chrome/browser/net/gaia/token_service.h index 1b1437b..26d41ce 100644 --- a/chrome/browser/net/gaia/token_service.h +++ b/chrome/browser/net/gaia/token_service.h @@ -47,9 +47,12 @@ #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" -class URLRequestContextGetter; class Profile; +namespace net { +class URLRequestContextGetter; +} + // The TokenService is a Profile member, so all calls are expected // from the UI thread. class TokenService : public GaiaAuthConsumer, @@ -163,7 +166,7 @@ class TokenService : public GaiaAuthConsumer, // Web data service to access tokens from. scoped_refptr<WebDataService> web_data_service_; // Getter to use for fetchers. - scoped_refptr<URLRequestContextGetter> getter_; + scoped_refptr<net::URLRequestContextGetter> getter_; // Request handle to load Gaia tokens from DB. WebDataService::Handle token_loading_query_; diff --git a/chrome/browser/net/preconnect.cc b/chrome/browser/net/preconnect.cc index 686b807..71c7630 100644 --- a/chrome/browser/net/preconnect.cc +++ b/chrome/browser/net/preconnect.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -7,7 +7,6 @@ #include "base/logging.h" #include "base/metrics/histogram.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/browser_thread.h" #include "net/base/net_log.h" #include "net/base/ssl_config_service.h" @@ -16,6 +15,7 @@ #include "net/http/http_stream_factory.h" #include "net/http/http_transaction_factory.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" namespace chrome_browser_net { @@ -37,7 +37,7 @@ void PreconnectOnIOThread( const GURL& url, UrlInfo::ResolutionMotivation motivation, int count) { - URLRequestContextGetter* getter = Profile::GetDefaultRequestContext(); + net::URLRequestContextGetter* getter = Profile::GetDefaultRequestContext(); if (!getter) return; if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { diff --git a/chrome/browser/net/resolve_proxy_msg_helper.cc b/chrome/browser/net/resolve_proxy_msg_helper.cc index 01cb3bf..b2ad9f9 100644 --- a/chrome/browser/net/resolve_proxy_msg_helper.cc +++ b/chrome/browser/net/resolve_proxy_msg_helper.cc @@ -6,10 +6,10 @@ #include "base/compiler_specific.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/common/child_process_messages.h" #include "net/base/net_errors.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" ResolveProxyMsgHelper::ResolveProxyMsgHelper(net::ProxyService* proxy_service) : proxy_service_(NULL), @@ -91,7 +91,7 @@ bool ResolveProxyMsgHelper::GetProxyService( } // If there is no default request context (say during shut down). - URLRequestContextGetter* context_getter = + net::URLRequestContextGetter* context_getter = Profile::GetDefaultRequestContext(); if (!context_getter) return false; diff --git a/chrome/browser/net/sdch_dictionary_fetcher.cc b/chrome/browser/net/sdch_dictionary_fetcher.cc index 2db03ed..4cd8211 100644 --- a/chrome/browser/net/sdch_dictionary_fetcher.cc +++ b/chrome/browser/net/sdch_dictionary_fetcher.cc @@ -53,7 +53,7 @@ void SdchDictionaryFetcher::StartFetching() { DCHECK(task_is_pending_); task_is_pending_ = false; - URLRequestContextGetter* context = Profile::GetDefaultRequestContext(); + net::URLRequestContextGetter* context = Profile::GetDefaultRequestContext(); if (!context) { // Shutdown in progress. // Simulate handling of all dictionary requests by clearing queue. diff --git a/chrome/browser/net/websocket_experiment/websocket_experiment_task.cc b/chrome/browser/net/websocket_experiment/websocket_experiment_task.cc index 55661d0..c410778 100644 --- a/chrome/browser/net/websocket_experiment/websocket_experiment_task.cc +++ b/chrome/browser/net/websocket_experiment/websocket_experiment_task.cc @@ -7,11 +7,11 @@ #include "base/hash_tables.h" #include "base/metrics/histogram.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/browser_thread.h" #include "net/base/host_resolver.h" #include "net/base/load_flags.h" #include "net/base/net_errors.h" +#include "net/url_request/url_request_context_getter.h" #include "net/websockets/websocket.h" using base::Histogram; @@ -34,7 +34,7 @@ static std::string GetProtocolVersionName( URLFetcher* WebSocketExperimentTask::Context::CreateURLFetcher( const Config& config, URLFetcher::Delegate* delegate) { - URLRequestContextGetter* getter = + net::URLRequestContextGetter* getter = Profile::GetDefaultRequestContext(); // Profile::GetDefaultRequestContext() is initialized lazily, on the UI // thread. So here, where we access it from the IO thread, if the task runs @@ -53,7 +53,7 @@ URLFetcher* WebSocketExperimentTask::Context::CreateURLFetcher( net::WebSocket* WebSocketExperimentTask::Context::CreateWebSocket( const Config& config, net::WebSocketDelegate* delegate) { - URLRequestContextGetter* getter = + net::URLRequestContextGetter* getter = Profile::GetDefaultRequestContext(); // Profile::GetDefaultRequestContext() is initialized lazily, on the UI // thread. So here, where we access it from the IO thread, if the task runs diff --git a/chrome/browser/policy/browser_policy_connector.cc b/chrome/browser/policy/browser_policy_connector.cc index ce6c17f..b11d16e 100644 --- a/chrome/browser/policy/browser_policy_connector.cc +++ b/chrome/browser/policy/browser_policy_connector.cc @@ -150,7 +150,7 @@ void BrowserPolicyConnector::Observe(NotificationType type, void BrowserPolicyConnector::Initialize( PrefService* local_state, - URLRequestContextGetter* request_context) { + net::URLRequestContextGetter* request_context) { // TODO(jkummerow, mnissler): Move this out of the browser startup path. DCHECK(local_state); DCHECK(request_context); diff --git a/chrome/browser/policy/browser_policy_connector.h b/chrome/browser/policy/browser_policy_connector.h index 3ad0d3c..2271f213 100644 --- a/chrome/browser/policy/browser_policy_connector.h +++ b/chrome/browser/policy/browser_policy_connector.h @@ -14,7 +14,10 @@ class PrefService; class TestingBrowserProcess; class TokenService; + +namespace net { class URLRequestContextGetter; +} namespace policy { @@ -59,7 +62,7 @@ class BrowserPolicyConnector : public NotificationObserver { // Activates the cloud policy subsystem. Called when the default request // context is available. void Initialize(PrefService* local_state, - URLRequestContextGetter* request_context); + net::URLRequestContextGetter* request_context); scoped_ptr<ConfigurationPolicyProvider> managed_platform_provider_; scoped_ptr<ConfigurationPolicyProvider> recommended_platform_provider_; diff --git a/chrome/browser/policy/cloud_policy_subsystem.cc b/chrome/browser/policy/cloud_policy_subsystem.cc index 0cc1ed9..59bc04f 100644 --- a/chrome/browser/policy/cloud_policy_subsystem.cc +++ b/chrome/browser/policy/cloud_policy_subsystem.cc @@ -63,7 +63,7 @@ CloudPolicySubsystem::~CloudPolicySubsystem() { void CloudPolicySubsystem::Initialize( PrefService* prefs, const char* refresh_rate_pref_name, - URLRequestContextGetter* request_context) { + net::URLRequestContextGetter* request_context) { DCHECK(!prefs_); prefs_ = prefs; diff --git a/chrome/browser/policy/cloud_policy_subsystem.h b/chrome/browser/policy/cloud_policy_subsystem.h index 9275476..3b49339 100644 --- a/chrome/browser/policy/cloud_policy_subsystem.h +++ b/chrome/browser/policy/cloud_policy_subsystem.h @@ -11,7 +11,10 @@ #include "content/common/notification_observer.h" class PrefService; + +namespace net { class URLRequestContextGetter; +} namespace policy { @@ -34,7 +37,7 @@ class CloudPolicySubsystem : public NotificationObserver { // Initializes the subsystem. void Initialize(PrefService* prefs, const char* refresh_rate_pref_name, - URLRequestContextGetter* request_context); + net::URLRequestContextGetter* request_context); // Shuts the subsystem down. This must be called before threading and network // infrastructure goes away. diff --git a/chrome/browser/policy/device_management_service.cc b/chrome/browser/policy/device_management_service.cc index aec9432..27fe57a 100644 --- a/chrome/browser/policy/device_management_service.cc +++ b/chrome/browser/policy/device_management_service.cc @@ -7,7 +7,6 @@ #include "chrome/browser/io_thread.h" #include "chrome/browser/net/chrome_net_log.h" #include "chrome/browser/policy/device_management_backend_impl.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/browser_thread.h" #include "net/base/cookie_monster.h" #include "net/base/host_resolver.h" @@ -17,6 +16,7 @@ #include "net/http/http_network_layer.h" #include "net/proxy/proxy_service.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" #include "webkit/glue/webkit_glue.h" @@ -70,19 +70,20 @@ const std::string& DeviceManagementRequestContext::GetUserAgent( } // Request context holder. -class DeviceManagementRequestContextGetter : public URLRequestContextGetter { +class DeviceManagementRequestContextGetter + : public net::URLRequestContextGetter { public: DeviceManagementRequestContextGetter( - URLRequestContextGetter* base_context_getter) + net::URLRequestContextGetter* base_context_getter) : base_context_getter_(base_context_getter) {} - // Overridden from URLRequestContextGetter: + // Overridden from net::URLRequestContextGetter: virtual net::URLRequestContext* GetURLRequestContext(); virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const; private: scoped_refptr<net::URLRequestContext> context_; - scoped_refptr<URLRequestContextGetter> base_context_getter_; + scoped_refptr<net::URLRequestContextGetter> base_context_getter_; }; @@ -116,7 +117,7 @@ DeviceManagementBackend* DeviceManagementService::CreateBackend() { } void DeviceManagementService::Initialize( - URLRequestContextGetter* request_context_getter) { + net::URLRequestContextGetter* request_context_getter) { DCHECK(!request_context_getter_); request_context_getter_ = new DeviceManagementRequestContextGetter(request_context_getter); diff --git a/chrome/browser/policy/device_management_service.h b/chrome/browser/policy/device_management_service.h index c5f5869..7e23cc8 100644 --- a/chrome/browser/policy/device_management_service.h +++ b/chrome/browser/policy/device_management_service.h @@ -16,7 +16,10 @@ #include "googleurl/src/gurl.h" class Profile; + +namespace net { class URLRequestContextGetter; +} namespace policy { @@ -56,7 +59,7 @@ class DeviceManagementService : public URLFetcher::Delegate { // Provides the backend with a request context so it can make actual network // requests. This will also fire any requests queued earlier. - void Initialize(URLRequestContextGetter* request_context_getter); + void Initialize(net::URLRequestContextGetter* request_context_getter); // Makes the service stop all requests and drop the reference to the request // context. @@ -89,7 +92,7 @@ class DeviceManagementService : public URLFetcher::Delegate { const std::string server_url_; // The request context we use. - scoped_refptr<URLRequestContextGetter> request_context_getter_; + scoped_refptr<net::URLRequestContextGetter> request_context_getter_; // The jobs we currently have in flight. JobFetcherMap pending_jobs_; diff --git a/chrome/browser/policy/profile_policy_connector.cc b/chrome/browser/policy/profile_policy_connector.cc index aba4fbb..ae6fc38 100644 --- a/chrome/browser/policy/profile_policy_connector.cc +++ b/chrome/browser/policy/profile_policy_connector.cc @@ -14,8 +14,8 @@ #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/pref_names.h" +#include "net/url_request/url_request_context_getter.h" namespace { diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc index e8a5699..2c6d792 100644 --- a/chrome/browser/prerender/prerender_browsertest.cc +++ b/chrome/browser/prerender/prerender_browsertest.cc @@ -13,12 +13,12 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/test/in_process_browser_test.h" #include "chrome/test/ui_test_utils.h" #include "content/browser/tab_contents/tab_contents.h" #include "grit/generated_resources.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "ui/base/l10n/l10n_util.h" #include <queue> diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc index 8de86d8..a5b6996 100644 --- a/chrome/browser/profiles/profile.cc +++ b/chrome/browser/profiles/profile.cc @@ -75,7 +75,7 @@ using base::TimeDelta; // A pointer to the request context for the default profile. See comments on // Profile::GetDefaultRequestContext. -URLRequestContextGetter* Profile::default_request_context_; +net::URLRequestContextGetter* Profile::default_request_context_; namespace { @@ -129,7 +129,7 @@ void Profile::RegisterUserPrefs(PrefService* prefs) { } // static -URLRequestContextGetter* Profile::GetDefaultRequestContext() { +net::URLRequestContextGetter* Profile::GetDefaultRequestContext() { return default_request_context_; } @@ -403,11 +403,11 @@ class OffTheRecordProfileImpl : public Profile, return file_system_context_.get(); } - virtual URLRequestContextGetter* GetRequestContext() { + virtual net::URLRequestContextGetter* GetRequestContext() { return io_data_.GetMainRequestContextGetter(); } - virtual URLRequestContextGetter* GetRequestContextForPossibleApp( + virtual net::URLRequestContextGetter* GetRequestContextForPossibleApp( const Extension* installed_app) { if (CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableExperimentalAppManifests) && @@ -418,16 +418,16 @@ class OffTheRecordProfileImpl : public Profile, return GetRequestContext(); } - virtual URLRequestContextGetter* GetRequestContextForMedia() { + virtual net::URLRequestContextGetter* GetRequestContextForMedia() { // In OTR mode, media request context is the same as the original one. return io_data_.GetMainRequestContextGetter(); } - URLRequestContextGetter* GetRequestContextForExtensions() { + net::URLRequestContextGetter* GetRequestContextForExtensions() { return io_data_.GetExtensionsRequestContextGetter(); } - URLRequestContextGetter* GetRequestContextForIsolatedApp( + net::URLRequestContextGetter* GetRequestContextForIsolatedApp( const std::string& app_id) { return io_data_.GetIsolatedAppRequestContextGetter(app_id); } diff --git a/chrome/browser/profiles/profile.h b/chrome/browser/profiles/profile.h index a1ac13e..e7d1741 100644 --- a/chrome/browser/profiles/profile.h +++ b/chrome/browser/profiles/profile.h @@ -90,7 +90,6 @@ class TemplateURLFetcher; class TemplateURLModel; class TokenService; class TransportSecurityPersister; -class URLRequestContextGetter; class UserScriptMaster; class UserStyleSheetWatcher; class VisitedLinkEventListener; @@ -99,6 +98,10 @@ class WebDataService; class WebKitContext; class PromoResourceService; +namespace net { +class URLRequestContextGetter; +} + typedef intptr_t ProfileId; class Profile { @@ -148,7 +151,7 @@ class Profile { // from any thread. This CAN return NULL if a first request context has not // yet been created. If necessary, listen on the UI thread for // NOTIFY_DEFAULT_REQUEST_CONTEXT_AVAILABLE. - static URLRequestContextGetter* GetDefaultRequestContext(); + static net::URLRequestContextGetter* GetDefaultRequestContext(); // Returns a unique Id that can be used to identify this profile at runtime. // This Id is not persistent and will not survive a restart of the browser. @@ -317,27 +320,27 @@ class Profile { // Returns the request context information associated with this profile. Call // this only on the UI thread, since it can send notifications that should // happen on the UI thread. - virtual URLRequestContextGetter* GetRequestContext() = 0; + virtual net::URLRequestContextGetter* GetRequestContext() = 0; // Returns the request context appropriate for the given app. If installed_app // is null or installed_app->is_storage_isolated() returns false, this is // equivalent to calling GetRequestContext(). // TODO(creis): After isolated app storage is no longer an experimental // feature, consider making this the default contract for GetRequestContext. - virtual URLRequestContextGetter* GetRequestContextForPossibleApp( + virtual net::URLRequestContextGetter* GetRequestContextForPossibleApp( const Extension* installed_app) = 0; // Returns the request context for media resources asociated with this // profile. - virtual URLRequestContextGetter* GetRequestContextForMedia() = 0; + virtual net::URLRequestContextGetter* GetRequestContextForMedia() = 0; // Returns the request context used for extension-related requests. This // is only used for a separate cookie store currently. - virtual URLRequestContextGetter* GetRequestContextForExtensions() = 0; + virtual net::URLRequestContextGetter* GetRequestContextForExtensions() = 0; // Returns the request context used within an installed app that has // requested isolated storage. - virtual URLRequestContextGetter* GetRequestContextForIsolatedApp( + virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( const std::string& app_id) = 0; // Called by the ExtensionService that lives in this profile. Gives the @@ -536,7 +539,7 @@ class Profile { #ifdef UNIT_TEST // Use with caution. GetDefaultRequestContext may be called on any thread! - static void set_default_request_context(URLRequestContextGetter* c) { + static void set_default_request_context(net::URLRequestContextGetter* c) { default_request_context_ = c; } #endif @@ -575,7 +578,7 @@ class Profile { protected: friend class OffTheRecordProfileImpl; - static URLRequestContextGetter* default_request_context_; + static net::URLRequestContextGetter* default_request_context_; private: bool restored_last_session_; diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc index ff46694..02fcf7c 100644 --- a/chrome/browser/profiles/profile_impl.cc +++ b/chrome/browser/profiles/profile_impl.cc @@ -794,8 +794,8 @@ FilePath ProfileImpl::GetPrefFilePath() { return pref_file_path; } -URLRequestContextGetter* ProfileImpl::GetRequestContext() { - URLRequestContextGetter* request_context = +net::URLRequestContextGetter* ProfileImpl::GetRequestContext() { + net::URLRequestContextGetter* request_context = io_data_.GetMainRequestContextGetter(); // The first request context is always a normal (non-OTR) request context. // Even when Chromium is started in OTR mode, a normal profile is always @@ -813,7 +813,7 @@ URLRequestContextGetter* ProfileImpl::GetRequestContext() { return request_context; } -URLRequestContextGetter* ProfileImpl::GetRequestContextForPossibleApp( +net::URLRequestContextGetter* ProfileImpl::GetRequestContextForPossibleApp( const Extension* installed_app) { if (CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableExperimentalAppManifests) && @@ -824,7 +824,7 @@ URLRequestContextGetter* ProfileImpl::GetRequestContextForPossibleApp( return GetRequestContext(); } -URLRequestContextGetter* ProfileImpl::GetRequestContextForMedia() { +net::URLRequestContextGetter* ProfileImpl::GetRequestContextForMedia() { return io_data_.GetMediaRequestContextGetter(); } @@ -837,11 +837,11 @@ FaviconService* ProfileImpl::GetFaviconService(ServiceAccessType sat) { return favicon_service_.get(); } -URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { +net::URLRequestContextGetter* ProfileImpl::GetRequestContextForExtensions() { return io_data_.GetExtensionsRequestContextGetter(); } -URLRequestContextGetter* ProfileImpl::GetRequestContextForIsolatedApp( +net::URLRequestContextGetter* ProfileImpl::GetRequestContextForIsolatedApp( const std::string& app_id) { return io_data_.GetIsolatedAppRequestContextGetter(app_id); } diff --git a/chrome/browser/profiles/profile_impl.h b/chrome/browser/profiles/profile_impl.h index ffc3fe8..e25079e 100644 --- a/chrome/browser/profiles/profile_impl.h +++ b/chrome/browser/profiles/profile_impl.h @@ -80,12 +80,12 @@ class ProfileImpl : public Profile, virtual PersonalDataManager* GetPersonalDataManager(); virtual fileapi::FileSystemContext* GetFileSystemContext(); virtual bool HasCreatedDownloadManager() const; - virtual URLRequestContextGetter* GetRequestContext(); - virtual URLRequestContextGetter* GetRequestContextForPossibleApp( + virtual net::URLRequestContextGetter* GetRequestContext(); + virtual net::URLRequestContextGetter* GetRequestContextForPossibleApp( const Extension* installed_app); - virtual URLRequestContextGetter* GetRequestContextForMedia(); - virtual URLRequestContextGetter* GetRequestContextForExtensions(); - virtual URLRequestContextGetter* GetRequestContextForIsolatedApp( + virtual net::URLRequestContextGetter* GetRequestContextForMedia(); + virtual net::URLRequestContextGetter* GetRequestContextForExtensions(); + virtual net::URLRequestContextGetter* GetRequestContextForIsolatedApp( const std::string& app_id); virtual void RegisterExtensionWithRequestContexts(const Extension* extension); virtual void UnregisterExtensionWithRequestContexts( diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc index 29c18b2..b893b25 100644 --- a/chrome/browser/profiles/profile_manager.cc +++ b/chrome/browser/profiles/profile_manager.cc @@ -17,13 +17,13 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/logging_chrome.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/browser_thread.h" #include "content/common/notification_service.h" #include "content/common/notification_type.h" #include "grit/generated_resources.h" #include "net/http/http_transaction_factory.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_job.h" #include "net/url_request/url_request_job_tracker.h" @@ -42,7 +42,8 @@ void SuspendURLRequestJobs() { (*i)->Kill(); } -void SuspendRequestContext(URLRequestContextGetter* request_context_getter) { +void SuspendRequestContext( + net::URLRequestContextGetter* request_context_getter) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); scoped_refptr<net::URLRequestContext> request_context = @@ -51,7 +52,8 @@ void SuspendRequestContext(URLRequestContextGetter* request_context_getter) { request_context->http_transaction_factory()->Suspend(true); } -void ResumeRequestContext(URLRequestContextGetter* request_context_getter) { +void ResumeRequestContext( + net::URLRequestContextGetter* request_context_getter) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); scoped_refptr<net::URLRequestContext> request_context = @@ -258,7 +260,7 @@ void ProfileManager::OnSuspend() { NewRunnableFunction(&SuspendURLRequestJobs)); DCHECK(posted); - scoped_refptr<URLRequestContextGetter> request_context; + scoped_refptr<net::URLRequestContextGetter> request_context; for (const_iterator i(begin()); i != end(); ++i) { request_context = (*i)->GetRequestContext(); posted = BrowserThread::PostTask( @@ -276,7 +278,7 @@ void ProfileManager::OnSuspend() { void ProfileManager::OnResume() { DCHECK(CalledOnValidThread()); - scoped_refptr<URLRequestContextGetter> request_context; + scoped_refptr<net::URLRequestContextGetter> request_context; for (const_iterator i(begin()); i != end(); ++i) { request_context = (*i)->GetRequestContext(); bool posted = BrowserThread::PostTask( diff --git a/chrome/browser/remoting/directory_add_request.cc b/chrome/browser/remoting/directory_add_request.cc index 691c7a2..9c3d6c6 100644 --- a/chrome/browser/remoting/directory_add_request.cc +++ b/chrome/browser/remoting/directory_add_request.cc @@ -10,8 +10,8 @@ #include "base/json/json_writer.h" #include "base/values.h" #include "chrome/common/net/http_return.h" -#include "chrome/common/net/url_request_context_getter.h" #include "net/http/http_request_headers.h" +#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_status.h" namespace remoting { @@ -19,7 +19,7 @@ namespace remoting { static const char kRemotingDirectoryUrl[] = "https://www.googleapis.com/chromoting/v1/@me/hosts"; -DirectoryAddRequest::DirectoryAddRequest(URLRequestContextGetter* getter) +DirectoryAddRequest::DirectoryAddRequest(net::URLRequestContextGetter* getter) : getter_(getter) { } diff --git a/chrome/browser/remoting/directory_add_request.h b/chrome/browser/remoting/directory_add_request.h index 07fa091..8bcfaf4 100644 --- a/chrome/browser/remoting/directory_add_request.h +++ b/chrome/browser/remoting/directory_add_request.h @@ -42,7 +42,7 @@ class DirectoryAddRequest : public URLFetcher::Delegate { // to the user. typedef Callback2<Result, const std::string&>::Type DoneCallback; - explicit DirectoryAddRequest(URLRequestContextGetter* getter); + explicit DirectoryAddRequest(net::URLRequestContextGetter* getter); ~DirectoryAddRequest(); // Add this computer as a host. Use the token for @@ -63,7 +63,7 @@ class DirectoryAddRequest : public URLFetcher::Delegate { private: friend class DirectoryAddRequestTest; - URLRequestContextGetter* getter_; + net::URLRequestContextGetter* getter_; scoped_ptr<DoneCallback> done_callback_; scoped_ptr<URLFetcher> fetcher_; diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index e174b60..0369c7e 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -54,7 +54,6 @@ #include "chrome/common/extensions/extension_icon_set.h" #include "chrome/common/extensions/extension_messages.h" #include "chrome/common/logging_chrome.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" #include "chrome/common/safebrowsing_messages.h" @@ -104,6 +103,7 @@ #include "ipc/ipc_platform_file.h" #include "ipc/ipc_switches.h" #include "media/base/media_switches.h" +#include "net/url_request/url_request_context_getter.h" #include "ui/base/ui_base_switches.h" #include "ui/gfx/gl/gl_switches.h" #include "webkit/fileapi/file_system_path_manager.h" @@ -258,7 +258,7 @@ class RendererURLRequestContextOverride virtual net::URLRequestContext* GetRequestContext( ResourceType::Type resource_type) { - URLRequestContextGetter* request_context = request_context_; + net::URLRequestContextGetter* request_context = request_context_; // If the request has resource type of ResourceType::MEDIA, we use a request // context specific to media for handling it because these resources have // specific needs for caching. @@ -270,8 +270,8 @@ class RendererURLRequestContextOverride private: virtual ~RendererURLRequestContextOverride() {} - scoped_refptr<URLRequestContextGetter> request_context_; - scoped_refptr<URLRequestContextGetter> media_request_context_; + scoped_refptr<net::URLRequestContextGetter> request_context_; + scoped_refptr<net::URLRequestContextGetter> media_request_context_; }; } // namespace diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.cc b/chrome/browser/renderer_host/chrome_render_message_filter.cc index 7075ff3..a50e519 100644 --- a/chrome/browser/renderer_host/chrome_render_message_filter.cc +++ b/chrome/browser/renderer_host/chrome_render_message_filter.cc @@ -31,7 +31,7 @@ using WebKit::WebCache; ChromeRenderMessageFilter::ChromeRenderMessageFilter( int render_process_id, Profile* profile, - URLRequestContextGetter* request_context) + net::URLRequestContextGetter* request_context) : resource_dispatcher_host_(g_browser_process->resource_dispatcher_host()), render_process_id_(render_process_id), profile_(profile), diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.h b/chrome/browser/renderer_host/chrome_render_message_filter.h index 34f88d5..944c2d6 100644 --- a/chrome/browser/renderer_host/chrome_render_message_filter.h +++ b/chrome/browser/renderer_host/chrome_render_message_filter.h @@ -15,7 +15,10 @@ typedef PrefMember<bool> BooleanPrefMember; class FilePath; class Profile; class ResourceDispatcherHost; + +namespace net { class URLRequestContextGetter; +} // This class filters out incoming Chrome-specific IPC messages for the renderer // process on the IPC thread. @@ -23,7 +26,7 @@ class ChromeRenderMessageFilter : public BrowserMessageFilter { public: ChromeRenderMessageFilter(int render_process_id, Profile* profile, - URLRequestContextGetter* request_context); + net::URLRequestContextGetter* request_context); // BrowserMessageFilter methods: virtual bool OnMessageReceived(const IPC::Message& message, @@ -82,7 +85,7 @@ class ChromeRenderMessageFilter : public BrowserMessageFilter { // The Profile associated with our renderer process. This should only be // accessed on the UI thread! Profile* profile_; - scoped_refptr<URLRequestContextGetter> request_context_; + scoped_refptr<net::URLRequestContextGetter> request_context_; // |allow_outdated_plugins_| is a weak pointer because it must be deleted on // the UI thread, but the dtor is called on the IO thread. The dtor posts a diff --git a/chrome/browser/safe_browsing/client_side_detection_service.cc b/chrome/browser/safe_browsing/client_side_detection_service.cc index b55fc01..d36151e 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service.cc +++ b/chrome/browser/safe_browsing/client_side_detection_service.cc @@ -18,10 +18,10 @@ #include "chrome/browser/safe_browsing/csd.pb.h" #include "chrome/common/net/http_return.h" #include "chrome/common/net/url_fetcher.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/browser_thread.h" #include "googleurl/src/gurl.h" #include "net/base/load_flags.h" +#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_status.h" namespace safe_browsing { @@ -51,7 +51,7 @@ ClientSideDetectionService::CacheState::CacheState(bool phish, base::Time time) ClientSideDetectionService::ClientSideDetectionService( const FilePath& model_path, - URLRequestContextGetter* request_context_getter) + net::URLRequestContextGetter* request_context_getter) : model_path_(model_path), model_status_(UNKNOWN_STATUS), model_file_(base::kInvalidPlatformFileValue), @@ -71,7 +71,7 @@ ClientSideDetectionService::~ClientSideDetectionService() { /* static */ ClientSideDetectionService* ClientSideDetectionService::Create( const FilePath& model_path, - URLRequestContextGetter* request_context_getter) { + net::URLRequestContextGetter* request_context_getter) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); scoped_ptr<ClientSideDetectionService> service( new ClientSideDetectionService(model_path, request_context_getter)); diff --git a/chrome/browser/safe_browsing/client_side_detection_service.h b/chrome/browser/safe_browsing/client_side_detection_service.h index 9c0dc6ba..8a1abee 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service.h +++ b/chrome/browser/safe_browsing/client_side_detection_service.h @@ -38,9 +38,8 @@ #include "googleurl/src/gurl.h" #include "net/base/net_util.h" -class URLRequestContextGetter; - namespace net { +class URLRequestContextGetter; class URLRequestStatus; } // namespace net @@ -60,7 +59,7 @@ class ClientSideDetectionService : public URLFetcher::Delegate { // The caller takes ownership of the object. This function may return NULL. static ClientSideDetectionService* Create( const FilePath& model_path, - URLRequestContextGetter* request_context_getter); + net::URLRequestContextGetter* request_context_getter); // From the URLFetcher::Delegate interface. virtual void OnURLFetchComplete(const URLFetcher* source, @@ -112,8 +111,9 @@ class ClientSideDetectionService : public URLFetcher::Delegate { protected: // Use Create() method to create an instance of this object. - ClientSideDetectionService(const FilePath& model_path, - URLRequestContextGetter* request_context_getter); + ClientSideDetectionService( + const FilePath& model_path, + net::URLRequestContextGetter* request_context_getter); private: friend class ClientSideDetectionServiceTest; @@ -252,7 +252,7 @@ class ClientSideDetectionService : public URLFetcher::Delegate { base::ScopedCallbackFactory<ClientSideDetectionService> callback_factory_; // The context we use to issue network requests. - scoped_refptr<URLRequestContextGetter> request_context_getter_; + scoped_refptr<net::URLRequestContextGetter> request_context_getter_; // The network blocks that we consider private IP address ranges. std::vector<AddressRange> private_networks_; diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc index 86c1328..342b9d6 100644 --- a/chrome/browser/safe_browsing/protocol_manager.cc +++ b/chrome/browser/safe_browsing/protocol_manager.cc @@ -19,10 +19,10 @@ #include "chrome/browser/safe_browsing/safe_browsing_service.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/env_vars.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/browser_thread.h" #include "net/base/escape.h" #include "net/base/load_flags.h" +#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_status.h" using base::Time; @@ -47,7 +47,7 @@ class SBProtocolManagerFactoryImpl : public SBProtocolManagerFactory { const std::string& client_name, const std::string& client_key, const std::string& wrapped_key, - URLRequestContextGetter* request_context_getter, + net::URLRequestContextGetter* request_context_getter, const std::string& info_url_prefix, const std::string& mackey_url_prefix, bool disable_auto_update) { @@ -71,7 +71,7 @@ SafeBrowsingProtocolManager* SafeBrowsingProtocolManager::Create( const std::string& client_name, const std::string& client_key, const std::string& wrapped_key, - URLRequestContextGetter* request_context_getter, + net::URLRequestContextGetter* request_context_getter, const std::string& info_url_prefix, const std::string& mackey_url_prefix, bool disable_auto_update) { @@ -89,7 +89,7 @@ SafeBrowsingProtocolManager::SafeBrowsingProtocolManager( const std::string& client_name, const std::string& client_key, const std::string& wrapped_key, - URLRequestContextGetter* request_context_getter, + net::URLRequestContextGetter* request_context_getter, const std::string& http_url_prefix, const std::string& https_url_prefix, bool disable_auto_update) diff --git a/chrome/browser/safe_browsing/protocol_manager.h b/chrome/browser/safe_browsing/protocol_manager.h index 4a72f93..61f0713 100644 --- a/chrome/browser/safe_browsing/protocol_manager.h +++ b/chrome/browser/safe_browsing/protocol_manager.h @@ -55,7 +55,7 @@ class SBProtocolManagerFactory { const std::string& client_name, const std::string& client_key, const std::string& wrapped_key, - URLRequestContextGetter* request_context_getter, + net::URLRequestContextGetter* request_context_getter, const std::string& info_url_prefix, const std::string& mackey_url_prefix, bool disable_auto_update) = 0; @@ -93,7 +93,7 @@ class SafeBrowsingProtocolManager : public URLFetcher::Delegate { const std::string& client_name, const std::string& client_key, const std::string& wrapped_key, - URLRequestContextGetter* request_context_getter, + net::URLRequestContextGetter* request_context_getter, const std::string& info_url_prefix, const std::string& mackey_url_prefix, bool disable_auto_update); @@ -198,14 +198,15 @@ class SafeBrowsingProtocolManager : public URLFetcher::Delegate { // network requests using |request_context_getter|. When |disable_auto_update| // is true, protocol manager won't schedule next update until // ForceScheduleNextUpdate is called. - SafeBrowsingProtocolManager(SafeBrowsingService* sb_service, - const std::string& client_name, - const std::string& client_key, - const std::string& wrapped_key, - URLRequestContextGetter* request_context_getter, - const std::string& http_url_prefix, - const std::string& https_url_prefix, - bool disable_auto_update); + SafeBrowsingProtocolManager( + SafeBrowsingService* sb_service, + const std::string& client_name, + const std::string& client_key, + const std::string& wrapped_key, + net::URLRequestContextGetter* request_context_getter, + const std::string& http_url_prefix, + const std::string& https_url_prefix, + bool disable_auto_update); private: friend class SBProtocolManagerFactoryImpl; @@ -394,7 +395,7 @@ class SafeBrowsingProtocolManager : public URLFetcher::Delegate { std::string additional_query_; // The context we use to issue network requests. - scoped_refptr<URLRequestContextGetter> request_context_getter_; + scoped_refptr<net::URLRequestContextGetter> request_context_getter_; // URL prefix where browser fetches safebrowsing chunk updates, hashes, and // reports hits to the safebrowsing list for UMA users. diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc index e31ffba..8650f2b 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -23,12 +23,12 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/browser/browser_thread.h" #include "content/browser/tab_contents/tab_contents.h" #include "net/base/registry_controlled_domain.h" +#include "net/url_request/url_request_context_getter.h" #if defined(OS_WIN) #include "chrome/installer/util/browser_distribution.h" @@ -533,7 +533,7 @@ SafeBrowsingService::~SafeBrowsingService() { void SafeBrowsingService::OnIOInitialize( const std::string& client_key, const std::string& wrapped_key, - URLRequestContextGetter* request_context_getter) { + net::URLRequestContextGetter* request_context_getter) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); enabled_ = true; @@ -870,7 +870,7 @@ void SafeBrowsingService::Start() { } // We will issue network fetches using the default profile's request context. - scoped_refptr<URLRequestContextGetter> request_context_getter( + scoped_refptr<net::URLRequestContextGetter> request_context_getter( GetDefaultProfile()->GetRequestContext()); CommandLine* cmdline = CommandLine::ForCurrentProcess(); diff --git a/chrome/browser/safe_browsing/safe_browsing_service.h b/chrome/browser/safe_browsing/safe_browsing_service.h index d482de3..1fbac1c 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.h +++ b/chrome/browser/safe_browsing/safe_browsing_service.h @@ -29,12 +29,15 @@ class PrefService; class SafeBrowsingDatabase; class SafeBrowsingProtocolManager; class SafeBrowsingServiceFactory; -class URLRequestContextGetter; namespace base { class Thread; } +namespace net { +class URLRequestContextGetter; +} + // Construction needs to happen on the main thread. class SafeBrowsingService : public base::RefCountedThreadSafe<SafeBrowsingService> { @@ -277,7 +280,7 @@ class SafeBrowsingService // Called to initialize objects that are used on the io_thread. void OnIOInitialize(const std::string& client_key, const std::string& wrapped_key, - URLRequestContextGetter* request_context_getter); + net::URLRequestContextGetter* request_context_getter); // Called to shutdown operations on the io_thread. void OnIOShutdown(); diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc index 94610118..5434a53 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc @@ -169,7 +169,7 @@ class TestProtocolManager : public SafeBrowsingProtocolManager { const std::string& client_name, const std::string& client_key, const std::string& wrapped_key, - URLRequestContextGetter* request_context_getter, + net::URLRequestContextGetter* request_context_getter, const std::string& info_url_prefix, const std::string& mackey_url_prefix, bool disable_auto_update) @@ -225,7 +225,7 @@ class TestSBProtocolManagerFactory : public SBProtocolManagerFactory { const std::string& client_name, const std::string& client_key, const std::string& wrapped_key, - URLRequestContextGetter* request_context_getter, + net::URLRequestContextGetter* request_context_getter, const std::string& info_url_prefix, const std::string& mackey_url_prefix, bool disable_auto_update) { diff --git a/chrome/browser/spellcheck_host.cc b/chrome/browser/spellcheck_host.cc index 900e4c7..aed3d9b 100644 --- a/chrome/browser/spellcheck_host.cc +++ b/chrome/browser/spellcheck_host.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -16,7 +16,7 @@ scoped_refptr<SpellCheckHost> SpellCheckHost::Create( SpellCheckHostObserver* observer, const std::string& language, - URLRequestContextGetter* request_context_getter) { + net::URLRequestContextGetter* request_context_getter) { scoped_refptr<SpellCheckHostImpl> host = new SpellCheckHostImpl(observer, language, diff --git a/chrome/browser/spellcheck_host.h b/chrome/browser/spellcheck_host.h index da88994..d77226b 100644 --- a/chrome/browser/spellcheck_host.h +++ b/chrome/browser/spellcheck_host.h @@ -15,7 +15,10 @@ class Profile; class SpellCheckHostObserver; + +namespace net { class URLRequestContextGetter; +} // An abstract interface that provides operations that controls the spellchecker // attached to the browser. This class provides the operations listed below: @@ -48,7 +51,7 @@ class SpellCheckHost static scoped_refptr<SpellCheckHost> Create( SpellCheckHostObserver* observer, const std::string& language, - URLRequestContextGetter* request_context_getter); + net::URLRequestContextGetter* request_context_getter); // Clears an observer which is set on creation. // Used to prevent calling back to a deleted object. diff --git a/chrome/browser/spellcheck_host_impl.cc b/chrome/browser/spellcheck_host_impl.cc index cdaaf17..f1069e1 100644 --- a/chrome/browser/spellcheck_host_impl.cc +++ b/chrome/browser/spellcheck_host_impl.cc @@ -16,10 +16,10 @@ #include "chrome/browser/spellchecker_platform_engine.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/spellcheck_common.h" #include "content/common/notification_service.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_request_context_getter.h" #include "third_party/hunspell/google/bdict.h" #include "ui/base/l10n/l10n_util.h" #if defined(OS_MACOSX) @@ -76,7 +76,7 @@ FilePath GetFallbackFilePath(const FilePath& first_choice) { SpellCheckHostImpl::SpellCheckHostImpl( SpellCheckHostObserver* observer, const std::string& language, - URLRequestContextGetter* request_context_getter) + net::URLRequestContextGetter* request_context_getter) : observer_(observer), language_(language), file_(base::kInvalidPlatformFileValue), diff --git a/chrome/browser/spellcheck_host_impl.h b/chrome/browser/spellcheck_host_impl.h index 0b66935..47efcca 100644 --- a/chrome/browser/spellcheck_host_impl.h +++ b/chrome/browser/spellcheck_host_impl.h @@ -40,7 +40,7 @@ class SpellCheckHostImpl : public SpellCheckHost, public: SpellCheckHostImpl(SpellCheckHostObserver* observer, const std::string& language, - URLRequestContextGetter* request_context_getter); + net::URLRequestContextGetter* request_context_getter); void Initialize(); @@ -132,7 +132,7 @@ class SpellCheckHostImpl : public SpellCheckHost, // Used for downloading the dictionary file. We don't hold a reference, and // it is only valid to use it on the UI thread. - URLRequestContextGetter* request_context_getter_; + net::URLRequestContextGetter* request_context_getter_; // Used for downloading the dictionary file. scoped_ptr<URLFetcher> fetcher_; diff --git a/chrome/browser/sync/glue/http_bridge.cc b/chrome/browser/sync/glue/http_bridge.cc index 610de89..15aa530 100644 --- a/chrome/browser/sync/glue/http_bridge.cc +++ b/chrome/browser/sync/glue/http_bridge.cc @@ -22,7 +22,7 @@ namespace browser_sync { HttpBridge::RequestContextGetter::RequestContextGetter( - URLRequestContextGetter* baseline_context_getter) + net::URLRequestContextGetter* baseline_context_getter) : baseline_context_getter_(baseline_context_getter) { } @@ -49,7 +49,7 @@ HttpBridge::RequestContextGetter::GetIOMessageLoopProxy() const { } HttpBridgeFactory::HttpBridgeFactory( - URLRequestContextGetter* baseline_context_getter) { + net::URLRequestContextGetter* baseline_context_getter) { DCHECK(baseline_context_getter != NULL); request_context_getter_ = new HttpBridge::RequestContextGetter(baseline_context_getter); diff --git a/chrome/browser/sync/glue/http_bridge.h b/chrome/browser/sync/glue/http_bridge.h index f0e0f1c..a678b28 100644 --- a/chrome/browser/sync/glue/http_bridge.h +++ b/chrome/browser/sync/glue/http_bridge.h @@ -15,9 +15,9 @@ #include "chrome/browser/sync/engine/http_post_provider_factory.h" #include "chrome/browser/sync/engine/syncapi.h" #include "chrome/common/net/url_fetcher.h" -#include "chrome/common/net/url_request_context_getter.h" #include "googleurl/src/gurl.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "testing/gtest/include/gtest/gtest_prod.h" class MessageLoop; @@ -74,15 +74,15 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, }; // Lazy-getter for RequestContext objects. - class RequestContextGetter : public URLRequestContextGetter { + class RequestContextGetter : public net::URLRequestContextGetter { public: explicit RequestContextGetter( - URLRequestContextGetter* baseline_context_getter); + net::URLRequestContextGetter* baseline_context_getter); void set_user_agent(const std::string& ua) { user_agent_ = ua; } bool is_user_agent_set() const { return !user_agent_.empty(); } - // URLRequestContextGetter implementation. + // net::URLRequestContextGetter implementation. virtual net::URLRequestContext* GetURLRequestContext(); virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const; @@ -92,7 +92,7 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, // User agent to apply to the net::URLRequestContext. std::string user_agent_; - scoped_refptr<URLRequestContextGetter> baseline_context_getter_; + scoped_refptr<net::URLRequestContextGetter> baseline_context_getter_; // Lazily initialized by GetURLRequestContext(). scoped_refptr<RequestContext> context_; @@ -128,7 +128,7 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, const std::string& data); #if defined(UNIT_TEST) - URLRequestContextGetter* GetRequestContextGetter() const { + net::URLRequestContextGetter* GetRequestContextGetter() const { return context_getter_for_request_; } #endif @@ -193,7 +193,8 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, class HttpBridgeFactory : public sync_api::HttpPostProviderFactory { public: - explicit HttpBridgeFactory(URLRequestContextGetter* baseline_context_getter); + explicit HttpBridgeFactory( + net::URLRequestContextGetter* baseline_context_getter); virtual ~HttpBridgeFactory(); // sync_api::HttpPostProviderFactory: diff --git a/chrome/browser/sync/glue/http_bridge_unittest.cc b/chrome/browser/sync/glue/http_bridge_unittest.cc index 4104d2f..09734c4 100644 --- a/chrome/browser/sync/glue/http_bridge_unittest.cc +++ b/chrome/browser/sync/glue/http_bridge_unittest.cc @@ -97,7 +97,7 @@ class DummyURLFetcher : public TestURLFetcher { // back with dummy response info. class ShuntedHttpBridge : public HttpBridge { public: - ShuntedHttpBridge(URLRequestContextGetter* baseline_context_getter, + ShuntedHttpBridge(net::URLRequestContextGetter* baseline_context_getter, HttpBridgeTest* test) : HttpBridge(new HttpBridge::RequestContextGetter( baseline_context_getter)), @@ -139,7 +139,7 @@ TEST_F(HttpBridgeTest, TestUsesSameHttpNetworkSession) { // Test the HttpBridge without actually making any network requests. TEST_F(HttpBridgeTest, TestMakeSynchronousPostShunted) { - scoped_refptr<URLRequestContextGetter> ctx_getter( + scoped_refptr<net::URLRequestContextGetter> ctx_getter( new TestURLRequestContextGetter()); scoped_refptr<HttpBridge> http_bridge(new ShuntedHttpBridge( ctx_getter, this)); diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc index b3b1358..302724f 100644 --- a/chrome/browser/sync/glue/sync_backend_host.cc +++ b/chrome/browser/sync/glue/sync_backend_host.cc @@ -91,7 +91,7 @@ void SyncBackendHost::Initialize( SyncFrontend* frontend, const GURL& sync_service_url, const syncable::ModelTypeSet& types, - URLRequestContextGetter* baseline_context_getter, + net::URLRequestContextGetter* baseline_context_getter, const SyncCredentials& credentials, bool delete_sync_data_folder) { if (!core_thread_.Start()) @@ -194,7 +194,7 @@ JsBackend* SyncBackendHost::GetJsBackend() { } sync_api::HttpPostProviderFactory* SyncBackendHost::MakeHttpBridgeFactory( - URLRequestContextGetter* getter) { + net::URLRequestContextGetter* getter) { return new HttpBridgeFactory(getter); } diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h index b249f7ff..a6e6acf 100644 --- a/chrome/browser/sync/glue/sync_backend_host.h +++ b/chrome/browser/sync/glue/sync_backend_host.h @@ -26,8 +26,8 @@ #include "chrome/browser/sync/js_event_router.h" #include "chrome/browser/sync/syncable/model_type.h" #include "chrome/common/net/gaia/google_service_auth_error.h" -#include "chrome/common/net/url_request_context_getter.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_request_context_getter.h" class CancelableTask; class Profile; @@ -121,7 +121,7 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar { void Initialize(SyncFrontend* frontend, const GURL& service_url, const syncable::ModelTypeSet& types, - URLRequestContextGetter* baseline_context_getter, + net::URLRequestContextGetter* baseline_context_getter, const sync_api::SyncCredentials& credentials, bool delete_sync_data_folder); @@ -537,7 +537,7 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar { // Factory method for HttpPostProviderFactories. virtual sync_api::HttpPostProviderFactory* MakeHttpBridgeFactory( - URLRequestContextGetter* getter); + net::URLRequestContextGetter* getter); MessageLoop* core_loop() { return core_thread_.message_loop(); } diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/chrome/browser/sync/test_profile_sync_service.cc index f0d0bfe..2d122cc 100644 --- a/chrome/browser/sync/test_profile_sync_service.cc +++ b/chrome/browser/sync/test_profile_sync_service.cc @@ -87,7 +87,7 @@ void SyncBackendHostForProfileSyncTest:: sync_api::HttpPostProviderFactory* SyncBackendHostForProfileSyncTest::MakeHttpBridgeFactory( - URLRequestContextGetter* getter) { + net::URLRequestContextGetter* getter) { return new browser_sync::TestHttpBridgeFactory; } diff --git a/chrome/browser/sync/test_profile_sync_service.h b/chrome/browser/sync/test_profile_sync_service.h index 4c01473..1af5d85 100644 --- a/chrome/browser/sync/test_profile_sync_service.h +++ b/chrome/browser/sync/test_profile_sync_service.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -53,7 +53,7 @@ class SyncBackendHostForProfileSyncTest void SimulateSyncCycleCompletedInitialSyncEnded(); virtual sync_api::HttpPostProviderFactory* MakeHttpBridgeFactory( - URLRequestContextGetter* getter); + net::URLRequestContextGetter* getter); virtual void InitCore(const Core::DoInitializeOptions& options); diff --git a/chrome/browser/ui/webui/chrome_url_data_manager.cc b/chrome/browser/ui/webui/chrome_url_data_manager.cc index 4e2d2f1..7819ecc 100644 --- a/chrome/browser/ui/webui/chrome_url_data_manager.cc +++ b/chrome/browser/ui/webui/chrome_url_data_manager.cc @@ -31,7 +31,7 @@ ChromeURLDataManager::DataSources* ChromeURLDataManager::data_sources_ = NULL; // Invoked on the IO thread to do the actual adding of the DataSource. static void AddDataSourceOnIOThread( - scoped_refptr<URLRequestContextGetter> context_getter, + scoped_refptr<net::URLRequestContextGetter> context_getter, scoped_refptr<ChromeURLDataManager::DataSource> data_source) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); static_cast<ChromeURLRequestContext*>( diff --git a/chrome/browser/ui/webui/gpu_internals_ui.cc b/chrome/browser/ui/webui/gpu_internals_ui.cc index 5c26927..d74ba70 100644 --- a/chrome/browser/ui/webui/gpu_internals_ui.cc +++ b/chrome/browser/ui/webui/gpu_internals_ui.cc @@ -31,7 +31,6 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/jstemplate_builder.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/url_constants.h" #include "content/browser/browser_thread.h" #include "content/browser/gpu_process_host.h" @@ -41,6 +40,7 @@ #include "grit/browser_resources.h" #include "grit/generated_resources.h" #include "net/base/escape.h" +#include "net/url_request/url_request_context_getter.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" diff --git a/chrome/browser/ui/webui/net_internals_ui.cc b/chrome/browser/ui/webui/net_internals_ui.cc index e6d034c..a4ec74b 100644 --- a/chrome/browser/ui/webui/net_internals_ui.cc +++ b/chrome/browser/ui/webui/net_internals_ui.cc @@ -33,7 +33,6 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/jstemplate_builder.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "content/browser/browser_thread.h" @@ -55,6 +54,7 @@ #include "net/http/http_stream_factory.h" #include "net/proxy/proxy_service.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" @@ -241,7 +241,7 @@ class NetInternalsMessageHandler::IOThreadImpl IOThreadImpl( const base::WeakPtr<NetInternalsMessageHandler>& handler, IOThread* io_thread, - URLRequestContextGetter* context_getter); + net::URLRequestContextGetter* context_getter); // Creates a callback that will run |method| on the IO thread. // @@ -339,7 +339,7 @@ class NetInternalsMessageHandler::IOThreadImpl // The global IOThread, which contains the global NetLog to observer. IOThread* io_thread_; - scoped_refptr<URLRequestContextGetter> context_getter_; + scoped_refptr<net::URLRequestContextGetter> context_getter_; // Helper that runs the suite of connection tests. scoped_ptr<ConnectionTester> connection_tester_; @@ -658,7 +658,7 @@ void NetInternalsMessageHandler::ReadLogFileTask::Run() { NetInternalsMessageHandler::IOThreadImpl::IOThreadImpl( const base::WeakPtr<NetInternalsMessageHandler>& handler, IOThread* io_thread, - URLRequestContextGetter* context_getter) + net::URLRequestContextGetter* context_getter) : ThreadSafeObserver(net::NetLog::LOG_ALL_BUT_BYTES), handler_(handler), io_thread_(io_thread), diff --git a/chrome/browser/web_resource/web_resource_service.cc b/chrome/browser/web_resource/web_resource_service.cc index 2739f01..717c850 100644 --- a/chrome/browser/web_resource/web_resource_service.cc +++ b/chrome/browser/web_resource/web_resource_service.cc @@ -71,7 +71,7 @@ class WebResourceService::WebResourceFetcher // cookies, for example. url_fetcher_->set_load_flags(net::LOAD_DISABLE_CACHE | net::LOAD_DO_NOT_SAVE_COOKIES); - URLRequestContextGetter* url_request_context_getter = + net::URLRequestContextGetter* url_request_context_getter = web_resource_service_->profile_->GetRequestContext(); url_fetcher_->set_request_context(url_request_context_getter); url_fetcher_->Start(); |