diff options
145 files changed, 488 insertions, 375 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(); diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi index 86cf4a1..16f3ecf 100644 --- a/chrome/chrome_common.gypi +++ b/chrome/chrome_common.gypi @@ -350,8 +350,6 @@ 'common/net/raw_host_resolver_proc.h', 'common/net/url_fetcher.cc', 'common/net/url_fetcher.h', - 'common/net/url_request_context_getter.cc', - 'common/net/url_request_context_getter.h', 'common/net/gaia/gaia_auth_consumer.cc', 'common/net/gaia/gaia_auth_consumer.h', 'common/net/gaia/gaia_auth_fetcher.cc', diff --git a/chrome/common/net/gaia/gaia_auth_fetcher.cc b/chrome/common/net/gaia/gaia_auth_fetcher.cc index 520c135..522c7d9 100644 --- a/chrome/common/net/gaia/gaia_auth_fetcher.cc +++ b/chrome/common/net/gaia/gaia_auth_fetcher.cc @@ -14,8 +14,8 @@ #include "chrome/common/net/gaia/gaia_constants.h" #include "chrome/common/net/gaia/google_service_auth_error.h" #include "chrome/common/net/http_return.h" -#include "chrome/common/net/url_request_context_getter.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 "third_party/libjingle/source/talk/base/urlencode.h" @@ -95,7 +95,7 @@ const char GaiaAuthFetcher::kGetUserInfoUrl[] = GaiaAuthFetcher::GaiaAuthFetcher(GaiaAuthConsumer* consumer, const std::string& source, - URLRequestContextGetter* getter) + net::URLRequestContextGetter* getter) : consumer_(consumer), getter_(getter), source_(source), @@ -117,7 +117,7 @@ void GaiaAuthFetcher::CancelRequest() { // static URLFetcher* GaiaAuthFetcher::CreateGaiaFetcher( - URLRequestContextGetter* getter, + net::URLRequestContextGetter* getter, const std::string& body, const GURL& gaia_gurl, URLFetcher::Delegate* delegate) { diff --git a/chrome/common/net/gaia/gaia_auth_fetcher.h b/chrome/common/net/gaia/gaia_auth_fetcher.h index 07c28cb..f6f092b 100644 --- a/chrome/common/net/gaia/gaia_auth_fetcher.h +++ b/chrome/common/net/gaia/gaia_auth_fetcher.h @@ -46,7 +46,7 @@ class GaiaAuthFetcher : public URLFetcher::Delegate { // tokens. GaiaAuthFetcher(GaiaAuthConsumer* consumer, const std::string& source, - URLRequestContextGetter* getter); + net::URLRequestContextGetter* getter); virtual ~GaiaAuthFetcher(); // GaiaAuthConsumer will be called on the original thread @@ -168,7 +168,7 @@ class GaiaAuthFetcher : public URLFetcher::Delegate { static std::string MakeGetUserInfoBody(const std::string& lsid); // Create a fetcher useable for making any Gaia request. - static URLFetcher* CreateGaiaFetcher(URLRequestContextGetter* getter, + static URLFetcher* CreateGaiaFetcher(net::URLRequestContextGetter* getter, const std::string& body, const GURL& gaia_gurl_, URLFetcher::Delegate* delegate); @@ -176,7 +176,7 @@ class GaiaAuthFetcher : public URLFetcher::Delegate { // These fields are common to GaiaAuthFetcher, same every request GaiaAuthConsumer* const consumer_; - URLRequestContextGetter* const getter_; + net::URLRequestContextGetter* const getter_; std::string source_; const GURL client_login_gurl_; const GURL issue_auth_token_gurl_; diff --git a/chrome/common/net/gaia/gaia_oauth_client.cc b/chrome/common/net/gaia/gaia_oauth_client.cc index 505da56..ccda6a73 100644 --- a/chrome/common/net/gaia/gaia_oauth_client.cc +++ b/chrome/common/net/gaia/gaia_oauth_client.cc @@ -9,9 +9,9 @@ #include "base/values.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 "googleurl/src/gurl.h" #include "net/base/escape.h" +#include "net/url_request/url_request_context_getter.h" namespace { const char kAccessTokenValue[] = "access_token"; @@ -26,7 +26,7 @@ class GaiaOAuthClient::Core public URLFetcher::Delegate { public: Core(const std::string& gaia_url, - URLRequestContextGetter* request_context_getter) + net::URLRequestContextGetter* request_context_getter) : gaia_url_(gaia_url), num_retries_(0), request_context_getter_(request_context_getter), @@ -65,7 +65,7 @@ class GaiaOAuthClient::Core GURL gaia_url_; int num_retries_; - scoped_refptr<URLRequestContextGetter> request_context_getter_; + scoped_refptr<net::URLRequestContextGetter> request_context_getter_; GaiaOAuthClient::Delegate* delegate_; scoped_ptr<URLFetcher> request_; }; @@ -186,7 +186,7 @@ void GaiaOAuthClient::Core::HandleResponse( } GaiaOAuthClient::GaiaOAuthClient(const std::string& gaia_url, - URLRequestContextGetter* context_getter) { + net::URLRequestContextGetter* context_getter) { core_ = new Core(gaia_url, context_getter); } diff --git a/chrome/common/net/gaia/gaia_oauth_client.h b/chrome/common/net/gaia/gaia_oauth_client.h index f014fe9..6a132ac 100644 --- a/chrome/common/net/gaia/gaia_oauth_client.h +++ b/chrome/common/net/gaia/gaia_oauth_client.h @@ -11,7 +11,9 @@ #include "base/memory/ref_counted.h" #include "base/message_loop_proxy.h" +namespace net { class URLRequestContextGetter; +} // A helper class to get and refresh OAuth tokens given an authorization code. namespace gaia { @@ -45,7 +47,7 @@ class GaiaOAuthClient { virtual void OnNetworkError(int response_code) = 0; }; GaiaOAuthClient(const std::string& gaia_url, - URLRequestContextGetter* context_getter); + net::URLRequestContextGetter* context_getter); ~GaiaOAuthClient(); // In the below methods, |max_retries| specifies the maximum number of times diff --git a/chrome/common/net/url_fetcher.cc b/chrome/common/net/url_fetcher.cc index b9261ad..2969564 100644 --- a/chrome/common/net/url_fetcher.cc +++ b/chrome/common/net/url_fetcher.cc @@ -13,7 +13,6 @@ #include "base/stl_util-inl.h" #include "base/string_util.h" #include "base/threading/thread.h" -#include "chrome/common/net/url_request_context_getter.h" #include "googleurl/src/gurl.h" #include "net/base/load_flags.h" #include "net/base/io_buffer.h" @@ -22,6 +21,7 @@ #include "net/http/http_response_headers.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_throttler_manager.h" static const int kBufferSize = 4096; @@ -127,7 +127,7 @@ class URLFetcher::Core std::string data_; // Results of the request scoped_refptr<net::IOBuffer> buffer_; // Read buffer - scoped_refptr<URLRequestContextGetter> request_context_getter_; + scoped_refptr<net::URLRequestContextGetter> request_context_getter_; // Cookie/cache info for the request ResponseCookies cookies_; // Response cookies net::HttpRequestHeaders extra_request_headers_; @@ -551,7 +551,7 @@ void URLFetcher::set_extra_request_headers( } void URLFetcher::set_request_context( - URLRequestContextGetter* request_context_getter) { + net::URLRequestContextGetter* request_context_getter) { core_->request_context_getter_ = request_context_getter; } diff --git a/chrome/common/net/url_fetcher.h b/chrome/common/net/url_fetcher.h index e075f21..3ed0e64 100644 --- a/chrome/common/net/url_fetcher.h +++ b/chrome/common/net/url_fetcher.h @@ -24,10 +24,10 @@ class GURL; typedef std::vector<std::string> ResponseCookies; -class URLRequestContextGetter; namespace net { class HttpResponseHeaders; +class URLRequestContextGetter; class URLRequestStatus; } // namespace net @@ -160,7 +160,7 @@ class URLFetcher { // Set the net::URLRequestContext on the request. Must be called before the // request is started. void set_request_context( - URLRequestContextGetter* request_context_getter); + net::URLRequestContextGetter* request_context_getter); // If |retry| is false, 5xx responses will be propagated to the observer, // if it is true URLFetcher will automatically re-execute the request, diff --git a/chrome/common/net/url_fetcher_unittest.cc b/chrome/common/net/url_fetcher_unittest.cc index e4da035..6d581fa 100644 --- a/chrome/common/net/url_fetcher_unittest.cc +++ b/chrome/common/net/url_fetcher_unittest.cc @@ -7,9 +7,9 @@ #include "base/threading/thread.h" #include "build/build_config.h" #include "chrome/common/net/url_fetcher.h" -#include "chrome/common/net/url_request_context_getter.h" #include "net/http/http_response_headers.h" #include "net/test/test_server.h" +#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_test_util.h" #include "net/url_request/url_request_throttler_manager.h" #include "testing/gtest/include/gtest/gtest.h" @@ -44,7 +44,7 @@ class CurriedTask : public Task { DISALLOW_COPY_AND_ASSIGN(CurriedTask); }; -class TestURLRequestContextGetter : public URLRequestContextGetter { +class TestURLRequestContextGetter : public net::URLRequestContextGetter { public: explicit TestURLRequestContextGetter( base::MessageLoopProxy* io_message_loop_proxy) @@ -247,7 +247,7 @@ class CancelTestURLRequestContext : public TestURLRequestContext { } }; -class CancelTestURLRequestContextGetter : public URLRequestContextGetter { +class CancelTestURLRequestContextGetter : public net::URLRequestContextGetter { public: explicit CancelTestURLRequestContextGetter( base::MessageLoopProxy* io_message_loop_proxy) diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher.cc b/chrome/service/cloud_print/cloud_print_url_fetcher.cc index 1482b50..56b67cc1 100644 --- a/chrome/service/cloud_print/cloud_print_url_fetcher.cc +++ b/chrome/service/cloud_print/cloud_print_url_fetcher.cc @@ -144,7 +144,7 @@ void CloudPrintURLFetcher::StartRequestHelper( CloudPrintURLFetcher::~CloudPrintURLFetcher() {} -URLRequestContextGetter* CloudPrintURLFetcher::GetRequestContextGetter() { +net::URLRequestContextGetter* CloudPrintURLFetcher::GetRequestContextGetter() { ServiceURLRequestContextGetter* getter = g_service_process->GetServiceURLRequestContextGetter(); // Now set up the user agent for cloudprint. diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher.h b/chrome/service/cloud_print/cloud_print_url_fetcher.h index 525a19d..d952ec2 100644 --- a/chrome/service/cloud_print/cloud_print_url_fetcher.h +++ b/chrome/service/cloud_print/cloud_print_url_fetcher.h @@ -102,7 +102,7 @@ class CloudPrintURLFetcher virtual ~CloudPrintURLFetcher(); // Virtual for testing. - virtual URLRequestContextGetter* GetRequestContextGetter(); + virtual net::URLRequestContextGetter* GetRequestContextGetter(); private: void StartRequestHelper(const GURL& url, diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc index 0866984..1e2c053 100644 --- a/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc +++ b/chrome/service/cloud_print/cloud_print_url_fetcher_unittest.cc @@ -7,11 +7,11 @@ #include "base/message_loop_proxy.h" #include "base/synchronization/waitable_event.h" #include "base/threading/thread.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/service/cloud_print/cloud_print_url_fetcher.h" #include "chrome/service/service_process.h" #include "googleurl/src/gurl.h" #include "net/test/test_server.h" +#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_status.h" #include "net/url_request/url_request_test_util.h" #include "net/url_request/url_request_throttler_manager.h" @@ -25,7 +25,7 @@ namespace { const FilePath::CharType kDocRoot[] = FILE_PATH_LITERAL("chrome/test/data"); int g_request_context_getter_instances = 0; -class TestURLRequestContextGetter : public URLRequestContextGetter { +class TestURLRequestContextGetter : public net::URLRequestContextGetter { public: explicit TestURLRequestContextGetter( base::MessageLoopProxy* io_message_loop_proxy) @@ -59,7 +59,7 @@ class TestCloudPrintURLFetcher : public CloudPrintURLFetcher { : io_message_loop_proxy_(io_message_loop_proxy) { } - virtual URLRequestContextGetter* GetRequestContextGetter() { + virtual net::URLRequestContextGetter* GetRequestContextGetter() { return new TestURLRequestContextGetter(io_message_loop_proxy_.get()); } private: diff --git a/chrome/service/net/service_url_request_context.h b/chrome/service/net/service_url_request_context.h index becc21a..6d3463d 100644 --- a/chrome/service/net/service_url_request_context.h +++ b/chrome/service/net/service_url_request_context.h @@ -8,7 +8,6 @@ #include <string> -#include "chrome/common/net/url_request_context_getter.h" #include "net/base/cookie_monster.h" #include "net/base/cookie_policy.h" #include "net/base/host_resolver.h" @@ -20,6 +19,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" namespace base { class MessageLoopProxy; @@ -44,7 +44,7 @@ class ServiceURLRequestContext : public net::URLRequestContext { std::string user_agent_; }; -class ServiceURLRequestContextGetter : public URLRequestContextGetter { +class ServiceURLRequestContextGetter : public net::URLRequestContextGetter { public: virtual net::URLRequestContext* GetURLRequestContext(); virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const; diff --git a/chrome/test/live_sync/live_sync_test.cc b/chrome/test/live_sync/live_sync_test.cc index e47979f..d12624f 100644 --- a/chrome/test/live_sync/live_sync_test.cc +++ b/chrome/test/live_sync/live_sync_test.cc @@ -23,7 +23,6 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/net/url_fetcher.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/net/test_url_fetcher_factory.h" #include "chrome/test/testing_browser_process.h" #include "chrome/test/ui_test_utils.h" @@ -36,6 +35,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 "net/url_request/url_request_status.h" namespace switches { @@ -80,7 +80,7 @@ class SyncServerStatusChecker : public URLFetcher::Delegate { class SetProxyConfigTask : public Task { public: SetProxyConfigTask(base::WaitableEvent* done, - URLRequestContextGetter* url_request_context_getter, + net::URLRequestContextGetter* url_request_context_getter, const net::ProxyConfig& proxy_config) : done_(done), url_request_context_getter_(url_request_context_getter), @@ -97,7 +97,7 @@ class SetProxyConfigTask : public Task { private: base::WaitableEvent* done_; - URLRequestContextGetter* url_request_context_getter_; + net::URLRequestContextGetter* url_request_context_getter_; net::ProxyConfig proxy_config_; }; @@ -466,7 +466,7 @@ bool LiveSyncTest::AwaitQuiescence() { return ProfileSyncServiceHarness::AwaitQuiescence(clients()); } -void LiveSyncTest::SetProxyConfig(URLRequestContextGetter* context_getter, +void LiveSyncTest::SetProxyConfig(net::URLRequestContextGetter* context_getter, const net::ProxyConfig& proxy_config) { base::WaitableEvent done(false, false); BrowserThread::PostTask( diff --git a/chrome/test/live_sync/live_sync_test.h b/chrome/test/live_sync/live_sync_test.h index 145719d..85c1a93 100644 --- a/chrome/test/live_sync/live_sync_test.h +++ b/chrome/test/live_sync/live_sync_test.h @@ -22,12 +22,12 @@ class CommandLine; class Profile; class ProfileSyncServiceHarness; -class URLRequestContextGetter; class FakeURLFetcherFactory; namespace net { class ProxyConfig; class ScopedDefaultHostResolverProc; +class URLRequestContextGetter; } // This is the base class for integration tests for all sync data types. Derived @@ -169,7 +169,7 @@ class LiveSyncTest : public InProcessBrowserTest { // Used to disable and enable network connectivity by providing and // clearing an invalid proxy configuration. - void SetProxyConfig(URLRequestContextGetter* context, + void SetProxyConfig(net::URLRequestContextGetter* context, const net::ProxyConfig& proxy_config); // Helper method used to set up fake responses for kClientLoginUrl, diff --git a/chrome/test/test_url_request_context_getter.h b/chrome/test/test_url_request_context_getter.h index 50491a1..f795945 100644 --- a/chrome/test/test_url_request_context_getter.h +++ b/chrome/test/test_url_request_context_getter.h @@ -7,7 +7,7 @@ #pragma once #include "base/memory/ref_counted.h" -#include "chrome/common/net/url_request_context_getter.h" +#include "net/url_request/url_request_context_getter.h" namespace base { class MessageLoopProxy; @@ -18,12 +18,12 @@ class MessageLoopProxy; // a leak if your test does not have a BrowserThread::IO in it because // URLRequestContextGetter is defined as a ReferenceCounted object with a // special trait that deletes it on the IO thread. -class TestURLRequestContextGetter : public URLRequestContextGetter { +class TestURLRequestContextGetter : public net::URLRequestContextGetter { public: TestURLRequestContextGetter(); virtual ~TestURLRequestContextGetter(); - // URLRequestContextGetter: + // net::URLRequestContextGetter: virtual net::URLRequestContext* GetURLRequestContext(); virtual scoped_refptr<base::MessageLoopProxy> GetIOMessageLoopProxy() const; diff --git a/chrome/test/testing_browser_process.cc b/chrome/test/testing_browser_process.cc index 5546417..4f78299 100644 --- a/chrome/test/testing_browser_process.cc +++ b/chrome/test/testing_browser_process.cc @@ -13,7 +13,7 @@ #include "chrome/browser/policy/dummy_configuration_policy_provider.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile_manager.h" -#include "chrome/common/net/url_request_context_getter.h" +#include "net/url_request/url_request_context_getter.h" #include "ui/base/clipboard/clipboard.h" TestingBrowserProcess::TestingBrowserProcess() @@ -118,7 +118,7 @@ TestingBrowserProcess::safe_browsing_detection_service() { return NULL; } -URLRequestContextGetter* TestingBrowserProcess::system_request_context() { +net::URLRequestContextGetter* TestingBrowserProcess::system_request_context() { return NULL; } diff --git a/chrome/test/testing_browser_process.h b/chrome/test/testing_browser_process.h index d4761c4..605291f 100644 --- a/chrome/test/testing_browser_process.h +++ b/chrome/test/testing_browser_process.h @@ -82,7 +82,7 @@ class TestingBrowserProcess : public BrowserProcess { virtual safe_browsing::ClientSideDetectionService* safe_browsing_detection_service(); - virtual URLRequestContextGetter* system_request_context(); + virtual net::URLRequestContextGetter* system_request_context(); #if defined(OS_CHROMEOS) virtual chromeos::ProxyConfigServiceImpl* diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc index 9d32203..89c13cd 100644 --- a/chrome/test/testing_profile.cc +++ b/chrome/test/testing_profile.cc @@ -38,7 +38,6 @@ #include "chrome/browser/ui/webui/chrome_url_data_manager.h" #include "chrome/browser/ui/webui/ntp_resource_cache.h" #include "chrome/common/chrome_constants.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/url_constants.h" #include "chrome/test/test_url_request_context_getter.h" #include "chrome/test/testing_pref_service.h" @@ -49,6 +48,7 @@ #include "content/common/notification_service.h" #include "net/base/cookie_monster.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_test_util.h" #include "testing/gmock/include/gmock/gmock.h" #include "webkit/database/database_tracker.h" @@ -124,7 +124,8 @@ class TestExtensionURLRequestContext : public net::URLRequestContext { } }; -class TestExtensionURLRequestContextGetter : public URLRequestContextGetter { +class TestExtensionURLRequestContextGetter + : public net::URLRequestContextGetter { public: virtual net::URLRequestContext* GetURLRequestContext() { if (!context_) @@ -526,11 +527,11 @@ bool TestingProfile::HasCreatedDownloadManager() const { return false; } -URLRequestContextGetter* TestingProfile::GetRequestContext() { +net::URLRequestContextGetter* TestingProfile::GetRequestContext() { return request_context_.get(); } -URLRequestContextGetter* TestingProfile::GetRequestContextForPossibleApp( +net::URLRequestContextGetter* TestingProfile::GetRequestContextForPossibleApp( const Extension* installed_app) { if (installed_app != NULL && installed_app->is_storage_isolated()) return GetRequestContextForIsolatedApp(installed_app->id()); @@ -547,11 +548,11 @@ void TestingProfile::ResetRequestContext() { request_context_ = NULL; } -URLRequestContextGetter* TestingProfile::GetRequestContextForMedia() { +net::URLRequestContextGetter* TestingProfile::GetRequestContextForMedia() { return NULL; } -URLRequestContextGetter* TestingProfile::GetRequestContextForExtensions() { +net::URLRequestContextGetter* TestingProfile::GetRequestContextForExtensions() { if (!extensions_request_context_) extensions_request_context_ = new TestExtensionURLRequestContextGetter(); return extensions_request_context_.get(); @@ -565,7 +566,7 @@ UserStyleSheetWatcher* TestingProfile::GetUserStyleSheetWatcher() { return NULL; } -URLRequestContextGetter* TestingProfile::GetRequestContextForIsolatedApp( +net::URLRequestContextGetter* TestingProfile::GetRequestContextForIsolatedApp( const std::string& app_id) { // We don't test isolated app storage here yet, so returning the same dummy // context is sufficient for now. diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h index 7ac4651..b370cde 100644 --- a/chrome/test/testing_profile.h +++ b/chrome/test/testing_profile.h @@ -40,9 +40,12 @@ class SessionService; class TemplateURLModel; class TestingPrefService; class ThemeService; -class URLRequestContextGetter; class WebKitContext; +namespace net { +class URLRequestContextGetter; +} + class TestingProfile : public Profile { public: TestingProfile(); @@ -187,17 +190,17 @@ class TestingProfile : public Profile { // leaking if they called this method without the necessary IO thread. This // getter is currently only capable of returning a Context that helps test // the CookieMonster. See implementation comments for more details. - virtual URLRequestContextGetter* GetRequestContext(); - virtual URLRequestContextGetter* GetRequestContextForPossibleApp( + virtual net::URLRequestContextGetter* GetRequestContext(); + virtual net::URLRequestContextGetter* GetRequestContextForPossibleApp( const Extension* installed_app); void CreateRequestContext(); // Clears out the created request context (which must be done before shutting // down the IO thread to avoid leaks). void ResetRequestContext(); - 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 net::SSLConfigService* GetSSLConfigService(); @@ -334,8 +337,8 @@ class TestingProfile : public Profile { // Internally, this is a TestURLRequestContextGetter that creates a dummy // request context. Currently, only the CookieMonster is hooked up. - scoped_refptr<URLRequestContextGetter> request_context_; - scoped_refptr<URLRequestContextGetter> extensions_request_context_; + scoped_refptr<net::URLRequestContextGetter> request_context_; + scoped_refptr<net::URLRequestContextGetter> extensions_request_context_; std::wstring id_; diff --git a/chrome_frame/metrics_service.cc b/chrome_frame/metrics_service.cc index a1242cb..edacdd7 100644 --- a/chrome_frame/metrics_service.cc +++ b/chrome_frame/metrics_service.cc @@ -62,7 +62,6 @@ #include "base/utf_string_conversions.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/net/url_fetcher.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/installer/util/browser_distribution.h" #include "chrome/installer/util/chrome_frame_distribution.h" #include "chrome/installer/util/google_update_settings.h" @@ -81,6 +80,7 @@ #include "net/http/http_cache.h" #include "net/http/http_network_session.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" using base::Time; @@ -205,7 +205,8 @@ class ChromeFrameUploadRequestContext : public net::URLRequestContext { // This class provides an interface to retrieve the URL request context for // metrics HTTP upload requests initiated by ChromeFrame. -class ChromeFrameUploadRequestContextGetter : public URLRequestContextGetter { +class ChromeFrameUploadRequestContextGetter + : public net::URLRequestContextGetter { public: explicit ChromeFrameUploadRequestContextGetter(MessageLoop* io_loop) : io_loop_(io_loop) {} diff --git a/content/browser/appcache/appcache_dispatcher_host.cc b/content/browser/appcache/appcache_dispatcher_host.cc index 840cd37..b4dc118 100644 --- a/content/browser/appcache/appcache_dispatcher_host.cc +++ b/content/browser/appcache/appcache_dispatcher_host.cc @@ -20,7 +20,7 @@ AppCacheDispatcherHost::AppCacheDispatcherHost( } AppCacheDispatcherHost::AppCacheDispatcherHost( - URLRequestContextGetter* request_context_getter, + net::URLRequestContextGetter* request_context_getter, int process_id) : ALLOW_THIS_IN_INITIALIZER_LIST(frontend_proxy_(this)), request_context_getter_(request_context_getter), diff --git a/content/browser/appcache/appcache_dispatcher_host.h b/content/browser/appcache/appcache_dispatcher_host.h index 284ef7a..8ff8044 100644 --- a/content/browser/appcache/appcache_dispatcher_host.h +++ b/content/browser/appcache/appcache_dispatcher_host.h @@ -17,10 +17,10 @@ #include "webkit/appcache/appcache_backend_impl.h" class ChromeAppCacheService; -class URLRequestContextGetter; namespace net { class URLRequestContext; +class URLRequestContextGetter; } // namespace net // Handles appcache related messages sent to the main browser process from @@ -34,7 +34,7 @@ class AppCacheDispatcherHost : public BrowserMessageFilter { int process_id); // Constructor for use on the UI thread. - AppCacheDispatcherHost(URLRequestContextGetter* request_context_getter, + AppCacheDispatcherHost(net::URLRequestContextGetter* request_context_getter, int process_id); ~AppCacheDispatcherHost(); @@ -81,7 +81,7 @@ class AppCacheDispatcherHost : public BrowserMessageFilter { // Temporary until OnChannelConnected() can be called from the IO thread, // which will extract the AppCacheService from the net::URLRequestContext. scoped_refptr<net::URLRequestContext> request_context_; - scoped_refptr<URLRequestContextGetter> request_context_getter_; + scoped_refptr<net::URLRequestContextGetter> request_context_getter_; scoped_ptr<appcache::GetStatusCallback> get_status_callback_; scoped_ptr<appcache::StartUpdateCallback> start_update_callback_; diff --git a/content/browser/file_system/file_system_dispatcher_host.h b/content/browser/file_system/file_system_dispatcher_host.h index c5bbafe..8e22b45 100644 --- a/content/browser/file_system/file_system_dispatcher_host.h +++ b/content/browser/file_system/file_system_dispatcher_host.h @@ -23,10 +23,10 @@ class HostContentSettingsMap; class Profile; class Receiver; class RenderMessageFilter; -class URLRequestContextGetter; namespace net { class URLRequestContext; +class URLRequestContextGetter; } // namespace net namespace fileapi { @@ -95,7 +95,7 @@ class FileSystemDispatcherHost : public BrowserMessageFilter { // This holds the URLRequestContextGetter until Init() can be called from the // IO thread, which will extract the net::URLRequestContext from it. - scoped_refptr<URLRequestContextGetter> request_context_getter_; + scoped_refptr<net::URLRequestContextGetter> request_context_getter_; scoped_refptr<net::URLRequestContext> request_context_; DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcherHost); diff --git a/content/browser/geolocation/arbitrator_dependency_factories_for_test.cc b/content/browser/geolocation/arbitrator_dependency_factories_for_test.cc index 78a90c8..210d6139 100644 --- a/content/browser/geolocation/arbitrator_dependency_factories_for_test.cc +++ b/content/browser/geolocation/arbitrator_dependency_factories_for_test.cc @@ -17,7 +17,7 @@ LocationProviderBase* GeolocationArbitratorDependencyFactoryWithLocationProvider:: NewNetworkLocationProvider( AccessTokenStore* access_token_store, - URLRequestContextGetter* context, + net::URLRequestContextGetter* context, const GURL& url, const string16& access_token) { return factory_function_(); diff --git a/content/browser/geolocation/arbitrator_dependency_factories_for_test.h b/content/browser/geolocation/arbitrator_dependency_factories_for_test.h index 6023ad3..f05c00b7 100644 --- a/content/browser/geolocation/arbitrator_dependency_factories_for_test.h +++ b/content/browser/geolocation/arbitrator_dependency_factories_for_test.h @@ -19,7 +19,7 @@ class GeolocationArbitratorDependencyFactoryWithLocationProvider virtual LocationProviderBase* NewNetworkLocationProvider( AccessTokenStore* access_token_store, - URLRequestContextGetter* context, + net::URLRequestContextGetter* context, const GURL& url, const string16& access_token); diff --git a/content/browser/geolocation/arbitrator_dependency_factory.cc b/content/browser/geolocation/arbitrator_dependency_factory.cc index b8a5853..7dd9c34 100644 --- a/content/browser/geolocation/arbitrator_dependency_factory.cc +++ b/content/browser/geolocation/arbitrator_dependency_factory.cc @@ -14,7 +14,7 @@ GeolocationArbitratorDependencyFactory:: } // DefaultGeolocationArbitratorDependencyFactory -URLRequestContextGetter* +net::URLRequestContextGetter* DefaultGeolocationArbitratorDependencyFactory::GetContextGetter() { return Profile::GetDefaultRequestContext(); } @@ -32,7 +32,7 @@ DefaultGeolocationArbitratorDependencyFactory::NewAccessTokenStore() { LocationProviderBase* DefaultGeolocationArbitratorDependencyFactory::NewNetworkLocationProvider( AccessTokenStore* access_token_store, - URLRequestContextGetter* context, + net::URLRequestContextGetter* context, const GURL& url, const string16& access_token) { return ::NewNetworkLocationProvider(access_token_store, context, diff --git a/content/browser/geolocation/arbitrator_dependency_factory.h b/content/browser/geolocation/arbitrator_dependency_factory.h index d026c23..1adaeaf 100644 --- a/content/browser/geolocation/arbitrator_dependency_factory.h +++ b/content/browser/geolocation/arbitrator_dependency_factory.h @@ -12,12 +12,15 @@ class AccessTokenStore; class GURL; class LocationProviderBase; -class URLRequestContextGetter; namespace base { class Time; } +namespace net { +class URLRequestContextGetter; +} + // Allows injection of factory methods for creating the location providers. // RefCounted for simplicity of writing tests. class GeolocationArbitratorDependencyFactory @@ -27,11 +30,11 @@ class GeolocationArbitratorDependencyFactory typedef base::Time (*GetTimeNow)(); virtual GetTimeNow GetTimeFunction() = 0; - virtual URLRequestContextGetter* GetContextGetter() = 0; + virtual net::URLRequestContextGetter* GetContextGetter() = 0; virtual AccessTokenStore* NewAccessTokenStore() = 0; virtual LocationProviderBase* NewNetworkLocationProvider( AccessTokenStore* access_token_store, - URLRequestContextGetter* context, + net::URLRequestContextGetter* context, const GURL& url, const string16& access_token) = 0; virtual LocationProviderBase* NewSystemLocationProvider() = 0; @@ -47,12 +50,12 @@ class DefaultGeolocationArbitratorDependencyFactory : public GeolocationArbitratorDependencyFactory { public: // GeolocationArbitratorDependencyFactory - virtual URLRequestContextGetter* GetContextGetter(); + virtual net::URLRequestContextGetter* GetContextGetter(); virtual GetTimeNow GetTimeFunction(); virtual AccessTokenStore* NewAccessTokenStore(); virtual LocationProviderBase* NewNetworkLocationProvider( AccessTokenStore* access_token_store, - URLRequestContextGetter* context, + net::URLRequestContextGetter* context, const GURL& url, const string16& access_token); virtual LocationProviderBase* NewSystemLocationProvider(); diff --git a/content/browser/geolocation/geolocation_provider_unittest.cc b/content/browser/geolocation/geolocation_provider_unittest.cc index 5cce1fc..da6317d 100644 --- a/content/browser/geolocation/geolocation_provider_unittest.cc +++ b/content/browser/geolocation/geolocation_provider_unittest.cc @@ -91,7 +91,7 @@ class MockDependencyFactory : public GeolocationArbitratorDependencyFactory { access_token_store_(access_token_store) { } - virtual URLRequestContextGetter* GetContextGetter() { + virtual net::URLRequestContextGetter* GetContextGetter() { return NULL; } @@ -105,7 +105,7 @@ class MockDependencyFactory : public GeolocationArbitratorDependencyFactory { virtual LocationProviderBase* NewNetworkLocationProvider( AccessTokenStore* access_token_store, - URLRequestContextGetter* context, + net::URLRequestContextGetter* context, const GURL& url, const string16& access_token) { return new StartStopMockLocationProvider(test_loop_); diff --git a/content/browser/geolocation/location_arbitrator.h b/content/browser/geolocation/location_arbitrator.h index 3409f81e..264ca1a 100644 --- a/content/browser/geolocation/location_arbitrator.h +++ b/content/browser/geolocation/location_arbitrator.h @@ -9,18 +9,22 @@ #include "base/memory/scoped_vector.h" #include "base/string16.h" #include "base/time.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/geolocation/access_token_store.h" #include "content/browser/geolocation/location_provider.h" #include "content/browser/geolocation/geolocation_observer.h" #include "content/common/geoposition.h" #include "googleurl/src/gurl.h" +#include "net/url_request/url_request_context_getter.h" class AccessTokenStore; class GeolocationArbitratorDependencyFactory; class GURL; class LocationProviderBase; + +namespace net { class URLRequestContextGetter; +} + struct Geoposition; // This class is responsible for handling updates from multiple underlying @@ -82,7 +86,7 @@ class GeolocationArbitrator : public LocationProviderBase::ListenerInterface { scoped_refptr<GeolocationArbitratorDependencyFactory> dependency_factory_; scoped_refptr<AccessTokenStore> access_token_store_; - scoped_refptr<URLRequestContextGetter> context_getter_; + scoped_refptr<net::URLRequestContextGetter> context_getter_; GetTimeNow get_time_now_; GeolocationObserver* observer_; ScopedVector<LocationProviderBase> providers_; diff --git a/content/browser/geolocation/location_arbitrator_unittest.cc b/content/browser/geolocation/location_arbitrator_unittest.cc index dcea225..327af85 100644 --- a/content/browser/geolocation/location_arbitrator_unittest.cc +++ b/content/browser/geolocation/location_arbitrator_unittest.cc @@ -68,7 +68,7 @@ class MockDependencyFactory : public GeolocationArbitratorDependencyFactory { virtual GeolocationArbitrator::GetTimeNow GetTimeFunction() { return GetTimeNowForTest; } - virtual URLRequestContextGetter* GetContextGetter() { + virtual net::URLRequestContextGetter* GetContextGetter() { return NULL; } virtual AccessTokenStore* NewAccessTokenStore() { @@ -76,7 +76,7 @@ class MockDependencyFactory : public GeolocationArbitratorDependencyFactory { } virtual LocationProviderBase* NewNetworkLocationProvider( AccessTokenStore* access_token_store, - URLRequestContextGetter* context, + net::URLRequestContextGetter* context, const GURL& url, const string16& access_token) { return new MockLocationProvider(&cell_); diff --git a/content/browser/geolocation/location_provider.h b/content/browser/geolocation/location_provider.h index 402ae75..2c33e7d 100644 --- a/content/browser/geolocation/location_provider.h +++ b/content/browser/geolocation/location_provider.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. @@ -21,7 +21,10 @@ class AccessTokenStore; struct Geoposition; class GURL; + +namespace net { class URLRequestContextGetter; +} // The base class used by all location providers. class LocationProviderBase : public base::NonThreadSafe { @@ -89,7 +92,7 @@ class LocationProviderBase : public base::NonThreadSafe { // over the platform-dependent implementations. LocationProviderBase* NewNetworkLocationProvider( AccessTokenStore* access_token_store, - URLRequestContextGetter* context, + net::URLRequestContextGetter* context, const GURL& url, const string16& access_token); LocationProviderBase* NewSystemLocationProvider(); diff --git a/content/browser/geolocation/network_location_provider.cc b/content/browser/geolocation/network_location_provider.cc index d209396..3759b1a 100644 --- a/content/browser/geolocation/network_location_provider.cc +++ b/content/browser/geolocation/network_location_provider.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. @@ -106,7 +106,7 @@ bool NetworkLocationProvider::PositionCache::MakeKey( // NetworkLocationProvider factory function LocationProviderBase* NewNetworkLocationProvider( AccessTokenStore* access_token_store, - URLRequestContextGetter* context, + net::URLRequestContextGetter* context, const GURL& url, const string16& access_token) { return new NetworkLocationProvider( @@ -116,7 +116,7 @@ LocationProviderBase* NewNetworkLocationProvider( // NetworkLocationProvider NetworkLocationProvider::NetworkLocationProvider( AccessTokenStore* access_token_store, - URLRequestContextGetter* url_context_getter, + net::URLRequestContextGetter* url_context_getter, const GURL& url, const string16& access_token) : access_token_store_(access_token_store), diff --git a/content/browser/geolocation/network_location_provider.h b/content/browser/geolocation/network_location_provider.h index 41a726e..a7a4eb9 100644 --- a/content/browser/geolocation/network_location_provider.h +++ b/content/browser/geolocation/network_location_provider.h @@ -69,7 +69,7 @@ class NetworkLocationProvider }; NetworkLocationProvider(AccessTokenStore* access_token_store, - URLRequestContextGetter* context, + net::URLRequestContextGetter* context, const GURL& url, const string16& access_token); virtual ~NetworkLocationProvider(); diff --git a/content/browser/geolocation/network_location_request.cc b/content/browser/geolocation/network_location_request.cc index ec02d18..74c9a0d 100644 --- a/content/browser/geolocation/network_location_request.cc +++ b/content/browser/geolocation/network_location_request.cc @@ -9,9 +9,9 @@ #include "base/string_number_conversions.h" #include "base/utf_string_conversions.h" #include "base/values.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/common/geoposition.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 { @@ -75,11 +75,12 @@ void AddWifiData(const WifiData& wifi_data, int NetworkLocationRequest::url_fetcher_id_for_tests = 0; -NetworkLocationRequest::NetworkLocationRequest(URLRequestContextGetter* context, - const GURL& url, - ListenerInterface* listener) - : url_context_(context), listener_(listener), - url_(url) { +NetworkLocationRequest::NetworkLocationRequest( + net::URLRequestContextGetter* context, + const GURL& url, + ListenerInterface* listener) + : url_context_(context), listener_(listener), + url_(url) { DCHECK(listener); } diff --git a/content/browser/geolocation/network_location_request.h b/content/browser/geolocation/network_location_request.h index 073ed05..18caaa5 100644 --- a/content/browser/geolocation/network_location_request.h +++ b/content/browser/geolocation/network_location_request.h @@ -15,8 +15,12 @@ #include "content/browser/geolocation/device_data_provider.h" #include "googleurl/src/gurl.h" -class URLRequestContextGetter; class URLFetcher; + +namespace net { +class URLRequestContextGetter; +} + struct Geoposition; struct Position; @@ -44,7 +48,7 @@ class NetworkLocationRequest : private URLFetcher::Delegate { }; // |url| is the server address to which the request wil be sent. - NetworkLocationRequest(URLRequestContextGetter* context, + NetworkLocationRequest(net::URLRequestContextGetter* context, const GURL& url, ListenerInterface* listener); virtual ~NetworkLocationRequest(); @@ -70,7 +74,7 @@ class NetworkLocationRequest : private URLFetcher::Delegate { const ResponseCookies& cookies, const std::string& data); - scoped_refptr<URLRequestContextGetter> url_context_; + scoped_refptr<net::URLRequestContextGetter> url_context_; ListenerInterface* listener_; const GURL url_; scoped_ptr<URLFetcher> url_fetcher_; diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc index e6f245d3..d7a02fb 100644 --- a/content/browser/plugin_process_host.cc +++ b/content/browser/plugin_process_host.cc @@ -27,7 +27,6 @@ #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 "chrome/common/render_messages.h" #include "content/browser/browser_thread.h" #include "content/browser/plugin_service.h" @@ -39,6 +38,7 @@ #include "net/base/io_buffer.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" +#include "net/url_request/url_request_context_getter.h" #include "ui/base/ui_base_switches.h" #include "ui/gfx/native_widget_types.h" #include "ui/gfx/gl/gl_switches.h" diff --git a/content/browser/renderer_host/mock_render_process_host.h b/content/browser/renderer_host/mock_render_process_host.h index ff6e599..5dc8ed4 100644 --- a/content/browser/renderer_host/mock_render_process_host.h +++ b/content/browser/renderer_host/mock_render_process_host.h @@ -13,7 +13,10 @@ class MockRenderProcessHostFactory; class TransportDIB; + +namespace net { class URLRequestContextGetter; +} // A mock render process host that has no corresponding renderer process. All // IPC messages are sent into the message sink for inspection by tests. diff --git a/content/browser/renderer_host/pepper_message_filter.h b/content/browser/renderer_host/pepper_message_filter.h index 456fd82..35adc97 100644 --- a/content/browser/renderer_host/pepper_message_filter.h +++ b/content/browser/renderer_host/pepper_message_filter.h @@ -14,10 +14,10 @@ #include "ppapi/c/private/ppb_flash_net_connector.h" class Profile; -class URLRequestContextGetter; namespace net { class AddressList; +class URLRequestContextGetter; } class PepperMessageFilter : public BrowserMessageFilter { @@ -63,7 +63,7 @@ class PepperMessageFilter : public BrowserMessageFilter { #endif // ENABLE_FLAPPER_HACKS Profile* profile_; - scoped_refptr<URLRequestContextGetter> request_context_; + scoped_refptr<net::URLRequestContextGetter> request_context_; }; #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_MESSAGE_FILTER_H_ diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc index 14805f4..68a81f2 100644 --- a/content/browser/renderer_host/render_message_filter.cc +++ b/content/browser/renderer_host/render_message_filter.cc @@ -265,7 +265,7 @@ RenderMessageFilter::RenderMessageFilter( int render_process_id, PluginService* plugin_service, Profile* profile, - URLRequestContextGetter* request_context, + net::URLRequestContextGetter* request_context, RenderWidgetHelper* render_widget_helper) : resource_dispatcher_host_(g_browser_process->resource_dispatcher_host()), plugin_service_(plugin_service), @@ -779,7 +779,7 @@ void RenderMessageFilter::UpdateHostZoomLevelsOnUIThread( ChromeURLRequestContext* RenderMessageFilter::GetRequestContextForURL( const GURL& url) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - URLRequestContextGetter* context_getter = + net::URLRequestContextGetter* context_getter = url.SchemeIs(chrome::kExtensionScheme) ? extensions_request_context_ : request_context_; return static_cast<ChromeURLRequestContext*>( diff --git a/content/browser/renderer_host/render_message_filter.h b/content/browser/renderer_host/render_message_filter.h index 7325a60..10cc962 100644 --- a/content/browser/renderer_host/render_message_filter.h +++ b/content/browser/renderer_host/render_message_filter.h @@ -34,7 +34,6 @@ class HostZoomMap; class NotificationsPrefsCache; class Profile; class RenderWidgetHelper; -class URLRequestContextGetter; struct ViewHostMsg_CreateWindow_Params; struct ViewHostMsg_CreateWorker_Params; @@ -50,6 +49,7 @@ class SharedMemory; namespace net { class CookieStore; +class URLRequestContextGetter; } // This class filters out incoming IPC messages for the renderer process on the @@ -60,7 +60,7 @@ class RenderMessageFilter : public BrowserMessageFilter { RenderMessageFilter(int render_process_id, PluginService* plugin_service, Profile* profile, - URLRequestContextGetter* request_context, + net::URLRequestContextGetter* request_context, RenderWidgetHelper* render_widget_helper); // BrowserMessageFilter methods: @@ -240,10 +240,10 @@ class RenderMessageFilter : public BrowserMessageFilter { HostContentSettingsMap* content_settings_; // Contextual information to be used for requests created here. - scoped_refptr<URLRequestContextGetter> request_context_; + scoped_refptr<net::URLRequestContextGetter> request_context_; // A request context that holds a cookie store for chrome-extension URLs. - scoped_refptr<URLRequestContextGetter> extensions_request_context_; + scoped_refptr<net::URLRequestContextGetter> extensions_request_context_; scoped_refptr<RenderWidgetHelper> render_widget_helper_; diff --git a/content/browser/renderer_host/render_process_host.h b/content/browser/renderer_host/render_process_host.h index d389bdf..a954d02 100644 --- a/content/browser/renderer_host/render_process_host.h +++ b/content/browser/renderer_host/render_process_host.h @@ -18,13 +18,16 @@ #include "ui/gfx/surface/transport_dib.h" class Profile; -class URLRequestContextGetter; struct ViewMsg_ClosePage_Params; namespace base { class SharedMemory; } +namespace net { +class URLRequestContextGetter; +} + // Virtual interface that represents the browser side of the browser <-> // renderer communication channel. There will generally be one // RenderProcessHost per renderer process. diff --git a/content/browser/renderer_host/render_view_host.cc b/content/browser/renderer_host/render_view_host.cc index bf91d391..f305870 100644 --- a/content/browser/renderer_host/render_view_host.cc +++ b/content/browser/renderer_host/render_view_host.cc @@ -24,7 +24,6 @@ #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension_messages.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/render_messages.h" #include "chrome/common/print_messages.h" #include "chrome/common/safebrowsing_messages.h" @@ -48,6 +47,7 @@ #include "content/common/result_codes.h" #include "content/common/view_messages.h" #include "net/base/net_util.h" +#include "net/url_request/url_request_context_getter.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" #include "ui/gfx/native_widget_types.h" diff --git a/content/browser/renderer_host/render_view_host.h b/content/browser/renderer_host/render_view_host.h index d40b8c7..ff2a4d6 100644 --- a/content/browser/renderer_host/render_view_host.h +++ b/content/browser/renderer_host/render_view_host.h @@ -63,7 +63,9 @@ namespace WebKit { struct WebMediaPlayerAction; } // namespace WebKit +namespace net { class URLRequestContextGetter; +} // // RenderViewHost diff --git a/content/browser/renderer_host/resource_message_filter.cc b/content/browser/renderer_host/resource_message_filter.cc index a4b4b8a..fe490f8 100644 --- a/content/browser/renderer_host/resource_message_filter.cc +++ b/content/browser/renderer_host/resource_message_filter.cc @@ -42,7 +42,7 @@ ChromeURLRequestContext* ResourceMessageFilter::GetURLRequestContext( rv = url_request_context_override_->GetRequestContext(type); if (!rv) { - URLRequestContextGetter* context_getter = + net::URLRequestContextGetter* context_getter = Profile::GetDefaultRequestContext(); if (context_getter) rv = context_getter->GetURLRequestContext(); diff --git a/content/browser/renderer_host/socket_stream_dispatcher_host.cc b/content/browser/renderer_host/socket_stream_dispatcher_host.cc index c1e6ad4..2bfb58c 100644 --- a/content/browser/renderer_host/socket_stream_dispatcher_host.cc +++ b/content/browser/renderer_host/socket_stream_dispatcher_host.cc @@ -6,11 +6,11 @@ #include "base/logging.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/renderer_host/socket_stream_host.h" #include "content/common/socket_stream.h" #include "content/common/socket_stream_messages.h" #include "content/common/resource_messages.h" +#include "net/url_request/url_request_context_getter.h" #include "net/websockets/websocket_job.h" #include "net/websockets/websocket_throttle.h" @@ -154,7 +154,7 @@ net::URLRequestContext* SocketStreamDispatcherHost::GetURLRequestContext() { ResourceType::SUB_RESOURCE); } if (!rv) { - URLRequestContextGetter* context_getter = + net::URLRequestContextGetter* context_getter = Profile::GetDefaultRequestContext(); if (context_getter) rv = context_getter->GetURLRequestContext(); diff --git a/content/browser/speech/speech_recognition_request.cc b/content/browser/speech/speech_recognition_request.cc index f80d026..7d66aa7 100644 --- a/content/browser/speech/speech_recognition_request.cc +++ b/content/browser/speech/speech_recognition_request.cc @@ -10,10 +10,10 @@ #include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/values.h" -#include "chrome/common/net/url_request_context_getter.h" #include "net/base/escape.h" #include "net/base/load_flags.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 "ui/base/l10n/l10n_util.h" @@ -113,7 +113,7 @@ namespace speech_input { int SpeechRecognitionRequest::url_fetcher_id_for_tests = 0; SpeechRecognitionRequest::SpeechRecognitionRequest( - URLRequestContextGetter* context, Delegate* delegate) + net::URLRequestContextGetter* context, Delegate* delegate) : url_context_(context), delegate_(delegate) { DCHECK(delegate); diff --git a/content/browser/speech/speech_recognition_request.h b/content/browser/speech/speech_recognition_request.h index 7992e6e..5b00563 100644 --- a/content/browser/speech/speech_recognition_request.h +++ b/content/browser/speech/speech_recognition_request.h @@ -16,7 +16,10 @@ #include "googleurl/src/gurl.h" class URLFetcher; + +namespace net { class URLRequestContextGetter; +} namespace speech_input { @@ -38,7 +41,7 @@ class SpeechRecognitionRequest : public URLFetcher::Delegate { }; // |url| is the server address to which the request wil be sent. - SpeechRecognitionRequest(URLRequestContextGetter* context, + SpeechRecognitionRequest(net::URLRequestContextGetter* context, Delegate* delegate); virtual ~SpeechRecognitionRequest(); @@ -66,7 +69,7 @@ class SpeechRecognitionRequest : public URLFetcher::Delegate { const std::string& data); private: - scoped_refptr<URLRequestContextGetter> url_context_; + scoped_refptr<net::URLRequestContextGetter> url_context_; Delegate* delegate_; scoped_ptr<URLFetcher> url_fetcher_; diff --git a/content/browser/speech/speech_recognition_request_unittest.cc b/content/browser/speech/speech_recognition_request_unittest.cc index 865f099..1097709 100644 --- a/content/browser/speech/speech_recognition_request_unittest.cc +++ b/content/browser/speech/speech_recognition_request_unittest.cc @@ -3,9 +3,9 @@ // found in the LICENSE file. #include "base/utf_string_conversions.h" -#include "chrome/common/net/url_request_context_getter.h" #include "chrome/common/net/test_url_fetcher_factory.h" #include "content/browser/speech/speech_recognition_request.h" +#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_status.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/content/browser/speech/speech_recognizer.cc b/content/browser/speech/speech_recognizer.cc index d84e634..1807db0 100644 --- a/content/browser/speech/speech_recognizer.cc +++ b/content/browser/speech/speech_recognizer.cc @@ -6,8 +6,8 @@ #include "base/time.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/browser_thread.h" +#include "net/url_request/url_request_context_getter.h" using media::AudioInputController; using std::string; diff --git a/content/browser/tab_contents/interstitial_page.cc b/content/browser/tab_contents/interstitial_page.cc index aca0108..d18a9d9 100644 --- a/content/browser/tab_contents/interstitial_page.cc +++ b/content/browser/tab_contents/interstitial_page.cc @@ -17,7 +17,6 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/renderer_preferences_util.h" #include "chrome/common/bindings_policy.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/browser_thread.h" #include "content/browser/renderer_host/render_process_host.h" #include "content/browser/renderer_host/render_view_host.h" @@ -34,6 +33,7 @@ #include "content/common/page_transition_types.h" #include "content/common/view_messages.h" #include "net/base/escape.h" +#include "net/url_request/url_request_context_getter.h" using WebKit::WebDragOperation; using WebKit::WebDragOperationsMask; diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc index 61bc4b5..26b6ea3 100644 --- a/content/browser/tab_contents/tab_contents.cc +++ b/content/browser/tab_contents/tab_contents.cc @@ -61,7 +61,6 @@ #include "chrome/common/extensions/extension_messages.h" #include "chrome/common/extensions/extension_resource.h" #include "chrome/common/extensions/url_pattern.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" @@ -87,6 +86,7 @@ #include "content/common/view_messages.h" #include "net/base/net_util.h" #include "net/base/registry_controlled_domain.h" +#include "net/url_request/url_request_context_getter.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/codec/png_codec.h" diff --git a/content/browser/worker_host/worker_message_filter.cc b/content/browser/worker_host/worker_message_filter.cc index 7edb8de..980f22c 100644 --- a/content/browser/worker_host/worker_message_filter.cc +++ b/content/browser/worker_host/worker_message_filter.cc @@ -1,19 +1,19 @@ -// 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. #include "content/browser/worker_host/worker_message_filter.h" #include "chrome/browser/net/chrome_url_request_context.h" -#include "chrome/common/net/url_request_context_getter.h" #include "content/browser/worker_host/message_port_service.h" #include "content/browser/worker_host/worker_service.h" #include "content/common/view_messages.h" #include "content/common/worker_messages.h" +#include "net/url_request/url_request_context_getter.h" WorkerMessageFilter::WorkerMessageFilter( int render_process_id, - URLRequestContextGetter* request_context, + net::URLRequestContextGetter* request_context, ResourceDispatcherHost* resource_dispatcher_host, CallbackWithReturnValue<int>::Type* next_routing_id) : render_process_id_(render_process_id), diff --git a/content/browser/worker_host/worker_message_filter.h b/content/browser/worker_host/worker_message_filter.h index f2de440..3ffb2bb 100644 --- a/content/browser/worker_host/worker_message_filter.h +++ b/content/browser/worker_host/worker_message_filter.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. @@ -9,7 +9,11 @@ #include "content/browser/browser_message_filter.h" class ResourceDispatcherHost; + +namespace net { class URLRequestContextGetter; +} + struct ViewHostMsg_CreateWorker_Params; class WorkerMessageFilter : public BrowserMessageFilter { @@ -18,7 +22,7 @@ class WorkerMessageFilter : public BrowserMessageFilter { // OnChannelClosing. WorkerMessageFilter( int render_process_id, - URLRequestContextGetter* request_context, + net::URLRequestContextGetter* request_context, ResourceDispatcherHost* resource_dispatcher_host, CallbackWithReturnValue<int>::Type* next_routing_id); @@ -49,7 +53,7 @@ class WorkerMessageFilter : public BrowserMessageFilter { void OnCreateMessagePort(int* route_id, int* message_port_id); int render_process_id_; - scoped_refptr<URLRequestContextGetter> request_context_; + scoped_refptr<net::URLRequestContextGetter> request_context_; ResourceDispatcherHost* resource_dispatcher_host_; // This is guaranteed to be valid until OnChannelClosing is closed, and it's diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc index 84b29ad..283874f 100644 --- a/content/browser/worker_host/worker_process_host.cc +++ b/content/browser/worker_host/worker_process_host.cc @@ -87,7 +87,7 @@ class WorkerCrashTask : public Task { WorkerProcessHost::WorkerProcessHost( ResourceDispatcherHost* resource_dispatcher_host, - URLRequestContextGetter* request_context) + net::URLRequestContextGetter* request_context) : BrowserChildProcessHost(WORKER_PROCESS, resource_dispatcher_host), request_context_(request_context) { } @@ -506,7 +506,7 @@ WorkerProcessHost::WorkerInstance::WorkerInstance( int parent_process_id, int parent_appcache_host_id, int64 main_resource_appcache_id, - URLRequestContextGetter* request_context) + net::URLRequestContextGetter* request_context) : url_(url), shared_(shared), incognito_(incognito), diff --git a/content/browser/worker_host/worker_process_host.h b/content/browser/worker_host/worker_process_host.h index 7277098..327ca20 100644 --- a/content/browser/worker_host/worker_process_host.h +++ b/content/browser/worker_host/worker_process_host.h @@ -15,7 +15,9 @@ #include "content/browser/worker_host/worker_document_set.h" #include "googleurl/src/gurl.h" +namespace net { class URLRequestContextGetter; +} // The WorkerProcessHost is the interface that represents the browser side of // the browser <-> worker communication channel. There will be one @@ -37,7 +39,7 @@ class WorkerProcessHost : public BrowserChildProcessHost { int parent_process_id, int parent_appcache_host_id, int64 main_resource_appcache_id, - URLRequestContextGetter* request_context); + net::URLRequestContextGetter* request_context); ~WorkerInstance(); // Unique identifier for a worker client. @@ -85,7 +87,7 @@ class WorkerProcessHost : public BrowserChildProcessHost { WorkerDocumentSet* worker_document_set() const { return worker_document_set_; } - URLRequestContextGetter* request_context() const { + net::URLRequestContextGetter* request_context() const { return request_context_; } @@ -100,14 +102,14 @@ class WorkerProcessHost : public BrowserChildProcessHost { int parent_process_id_; int parent_appcache_host_id_; int64 main_resource_appcache_id_; - scoped_refptr<URLRequestContextGetter> request_context_; + scoped_refptr<net::URLRequestContextGetter> request_context_; FilterList filters_; scoped_refptr<WorkerDocumentSet> worker_document_set_; }; WorkerProcessHost( ResourceDispatcherHost* resource_dispatcher_host, - URLRequestContextGetter* request_context); + net::URLRequestContextGetter* request_context); ~WorkerProcessHost(); // Starts the process. Returns true iff it succeeded. @@ -129,7 +131,7 @@ class WorkerProcessHost : public BrowserChildProcessHost { void DocumentDetached(WorkerMessageFilter* filter, unsigned long long document_id); - URLRequestContextGetter* request_context() const { + net::URLRequestContextGetter* request_context() const { return request_context_; } @@ -174,7 +176,7 @@ class WorkerProcessHost : public BrowserChildProcessHost { Instances instances_; - scoped_refptr<URLRequestContextGetter> request_context_; + scoped_refptr<net::URLRequestContextGetter> request_context_; // A reference to the filter associated with this worker process. We need to // keep this around since we'll use it when forward messages to the worker diff --git a/content/browser/worker_host/worker_service.cc b/content/browser/worker_host/worker_service.cc index e7a2cf6..dd30448 100644 --- a/content/browser/worker_host/worker_service.cc +++ b/content/browser/worker_host/worker_service.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 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. @@ -67,10 +67,11 @@ void WorkerService::OnWorkerMessageFilterClosing(WorkerMessageFilter* filter) { TryStartingQueuedWorker(); } -void WorkerService::CreateWorker(const ViewHostMsg_CreateWorker_Params& params, - int route_id, - WorkerMessageFilter* filter, - URLRequestContextGetter* request_context) { +void WorkerService::CreateWorker( + const ViewHostMsg_CreateWorker_Params& params, + int route_id, + WorkerMessageFilter* filter, + net::URLRequestContextGetter* request_context) { ChromeURLRequestContext* context = static_cast<ChromeURLRequestContext*>( request_context->GetURLRequestContext()); diff --git a/content/browser/worker_host/worker_service.h b/content/browser/worker_host/worker_service.h index 8bbc800..7869dd6 100644 --- a/content/browser/worker_host/worker_service.h +++ b/content/browser/worker_host/worker_service.h @@ -11,7 +11,10 @@ #include "content/browser/worker_host/worker_process_host.h" #include "googleurl/src/gurl.h" +namespace net { class URLRequestContextGetter; +} + struct ViewHostMsg_CreateWorker_Params; // A singelton for managing HTML5 web workers. @@ -24,7 +27,7 @@ class WorkerService { void CreateWorker(const ViewHostMsg_CreateWorker_Params& params, int route_id, WorkerMessageFilter* filter, - URLRequestContextGetter* request_context); + net::URLRequestContextGetter* request_context); void LookupSharedWorker(const ViewHostMsg_CreateWorker_Params& params, int route_id, WorkerMessageFilter* filter, diff --git a/net/net.gyp b/net/net.gyp index 445846b..9dc4a7b 100644 --- a/net/net.gyp +++ b/net/net.gyp @@ -701,6 +701,8 @@ 'url_request/url_request_about_job.h', 'url_request/url_request_context.cc', 'url_request/url_request_context.h', + 'url_request/url_request_context_getter.cc', + 'url_request/url_request_context_getter.h', 'url_request/url_request_context_storage.cc', 'url_request/url_request_context_storage.h', 'url_request/url_request_data_job.cc', diff --git a/chrome/common/net/url_request_context_getter.cc b/net/url_request/url_request_context_getter.cc index f5600f7..2313c23 100644 --- a/chrome/common/net/url_request_context_getter.cc +++ b/net/url_request/url_request_context_getter.cc @@ -2,11 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "net/url_request/url_request_context_getter.h" + #include "base/message_loop_proxy.h" -#include "chrome/common/net/url_request_context_getter.h" #include "net/url_request/url_request_context.h" -net::CookieStore* URLRequestContextGetter::DONTUSEME_GetCookieStore() { +namespace net { +CookieStore* URLRequestContextGetter::DONTUSEME_GetCookieStore() { return NULL; } @@ -28,3 +30,5 @@ void URLRequestContextGetter::OnDestruct() const { // If no IO message loop proxy was available, we will just leak memory. // This is also true if the IO thread is gone. } + +} // namespace net diff --git a/chrome/common/net/url_request_context_getter.h b/net/url_request/url_request_context_getter.h index 67fb154..b6c5464 100644 --- a/chrome/common/net/url_request_context_getter.h +++ b/net/url_request/url_request_context_getter.h @@ -16,7 +16,6 @@ class MessageLoopProxy; namespace net { class CookieStore; class URLRequestContext; -} struct URLRequestContextGetterTraits; @@ -25,11 +24,11 @@ class URLRequestContextGetter : public base::RefCountedThreadSafe<URLRequestContextGetter, URLRequestContextGetterTraits> { public: - virtual net::URLRequestContext* GetURLRequestContext() = 0; + virtual URLRequestContext* GetURLRequestContext() = 0; // See http://crbug.com/77835 for why this shouldn't be used. Instead use // GetURLRequestContext()->cookie_store(); - virtual net::CookieStore* DONTUSEME_GetCookieStore(); + virtual CookieStore* DONTUSEME_GetCookieStore(); // Returns a MessageLoopProxy corresponding to the thread on which the // request IO happens (the thread on which the returned net::URLRequestContext @@ -70,4 +69,6 @@ struct URLRequestContextGetterTraits { } }; +} // namespace net + #endif // CHROME_COMMON_NET_URL_REQUEST_CONTEXT_GETTER_H_ |