diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-28 13:11:52 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-28 13:11:52 +0000 |
commit | edfe7faba2f8685eb84b1821ba6fa054297e71fc (patch) | |
tree | b818efe30d5c178c8358cf75baffe371b5374109 | |
parent | c0528f5013e9039d699dba6682bce248672d3937 (diff) | |
download | chromium_src-edfe7faba2f8685eb84b1821ba6fa054297e71fc.zip chromium_src-edfe7faba2f8685eb84b1821ba6fa054297e71fc.tar.gz chromium_src-edfe7faba2f8685eb84b1821ba6fa054297e71fc.tar.bz2 |
net: Add namespace net to URLRequest and URLRequestJob classes.
BUG=64263
TEST=compiled locally and trybots
Review URL: http://codereview.chromium.org/5298008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67497 0039d316-1c4b-4281-b951-d872f2087c98
68 files changed, 288 insertions, 181 deletions
diff --git a/chrome/browser/appcache/view_appcache_internals_job_factory.h b/chrome/browser/appcache/view_appcache_internals_job_factory.h index 66ae0e2..45fdff3 100644 --- a/chrome/browser/appcache/view_appcache_internals_job_factory.h +++ b/chrome/browser/appcache/view_appcache_internals_job_factory.h @@ -6,14 +6,17 @@ #define CHROME_BROWSER_APPCACHE_VIEW_APPCACHE_INTERNALS_JOB_FACTORY_H_ #pragma once -class GURL; +namespace net { class URLRequest; class URLRequestJob; +} // namespace net + +class GURL; class ViewAppCacheInternalsJobFactory { public: static bool IsSupportedURL(const GURL& url); - static URLRequestJob* CreateJobForRequest(URLRequest* request); + static net::URLRequestJob* CreateJobForRequest(net::URLRequest* request); }; #endif // CHROME_BROWSER_APPCACHE_VIEW_APPCACHE_INTERNALS_JOB_FACTORY_H_ diff --git a/chrome/browser/automation/url_request_automation_job.h b/chrome/browser/automation/url_request_automation_job.h index 5ce9553..06401d7 100644 --- a/chrome/browser/automation/url_request_automation_job.h +++ b/chrome/browser/automation/url_request_automation_job.h @@ -25,7 +25,7 @@ struct AutomationURLResponse; // URLRequestJob implementation that loads the resources using // automation. -class URLRequestAutomationJob : public URLRequestJob { +class URLRequestAutomationJob : public net::URLRequestJob { public: URLRequestAutomationJob(URLRequest* request, int tab, int request_id, AutomationResourceMessageFilter* filter, diff --git a/chrome/browser/chromeos/gview_request_interceptor.h b/chrome/browser/chromeos/gview_request_interceptor.h index adbbd25..0e698fb 100644 --- a/chrome/browser/chromeos/gview_request_interceptor.h +++ b/chrome/browser/chromeos/gview_request_interceptor.h @@ -25,12 +25,12 @@ class GViewRequestInterceptor : public URLRequest::Interceptor { // Always returns NULL because we don't want to attempt a redirect // before seeing the detected mime type of the request. - virtual URLRequestJob* MaybeIntercept(URLRequest* request); + virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request); // Determines if the requested document can be viewed by the Google // Document Viewer. If it can, returns a URLRequestJob that // redirects the browser to the view URL. - virtual URLRequestJob* MaybeInterceptResponse(URLRequest* request); + virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request); // Singleton accessor. static URLRequest::Interceptor* GetGViewRequestInterceptor(); diff --git a/chrome/browser/chromeos/login/registration_screen.h b/chrome/browser/chromeos/login/registration_screen.h index 6c10f9f..0ae0b71 100644 --- a/chrome/browser/chromeos/login/registration_screen.h +++ b/chrome/browser/chromeos/login/registration_screen.h @@ -14,11 +14,14 @@ #include "chrome/browser/chromeos/login/web_page_screen.h" #include "chrome/browser/chromeos/login/web_page_view.h" +namespace net { +class URLRequest; +class URLRequestJob; +} // namespace net + class GURL; class Profile; class SiteContents; -class URLRequest; -class URLRequestJob; class WizardScreenDelegate; namespace chromeos { @@ -74,8 +77,8 @@ class RegistrationScreen : public ViewScreen<RegistrationView>, static void set_registration_host_page_url(const GURL& url); // Handler factory for URLRequestFilter::AddHostnameHandler. - static URLRequestJob* Factory(URLRequest* request, - const std::string& scheme); + static net::URLRequestJob* Factory(net::URLRequest* request, + const std::string& scheme); private: // ViewScreen implementation: diff --git a/chrome/browser/debugger/devtools_netlog_observer.h b/chrome/browser/debugger/devtools_netlog_observer.h index 78317ad..2fad712 100644 --- a/chrome/browser/debugger/devtools_netlog_observer.h +++ b/chrome/browser/debugger/devtools_netlog_observer.h @@ -11,8 +11,11 @@ #include "chrome/browser/net/chrome_net_log.h" #include "webkit/glue/resource_loader_bridge.h" -class IOThread; +namespace net { class URLRequest; +} // namespace net + +class IOThread; struct ResourceResponse; // DevToolsNetLogObserver watches the NetLog event stream and collects the @@ -35,7 +38,7 @@ class DevToolsNetLogObserver: public ChromeNetLog::Observer { // Must be called on the IO thread. May return NULL if no observers // are active. static DevToolsNetLogObserver* GetInstance(); - static void PopulateResponseInfo(URLRequest*, ResourceResponse*); + static void PopulateResponseInfo(net::URLRequest*, ResourceResponse*); private: typedef base::hash_map<uint32, scoped_refptr<ResourceInfo> > diff --git a/chrome/browser/dom_ui/chrome_url_data_manager.cc b/chrome/browser/dom_ui/chrome_url_data_manager.cc index b793ed8..11f0d88 100644 --- a/chrome/browser/dom_ui/chrome_url_data_manager.cc +++ b/chrome/browser/dom_ui/chrome_url_data_manager.cc @@ -39,7 +39,7 @@ // resource requests asynchronously. // It hands off URL requests to ChromeURLDataManager, which asynchronously // calls back once the data is available. -class URLRequestChromeJob : public URLRequestJob { +class URLRequestChromeJob : public net::URLRequestJob { public: explicit URLRequestChromeJob(URLRequest* request); diff --git a/chrome/browser/dom_ui/chrome_url_data_manager.h b/chrome/browser/dom_ui/chrome_url_data_manager.h index 389b5fd..c6b6e76 100644 --- a/chrome/browser/dom_ui/chrome_url_data_manager.h +++ b/chrome/browser/dom_ui/chrome_url_data_manager.h @@ -17,9 +17,12 @@ class FilePath; class GURL; class MessageLoop; class RefCountedMemory; -class URLRequest; class URLRequestChromeJob; + +namespace net { +class URLRequest; class URLRequestJob; +} // namespace net // To serve dynamic data off of chrome: URLs, implement the // ChromeURLDataManager::DataSource interface and register your handler @@ -114,7 +117,8 @@ class ChromeURLDataManager { void AddFileSource(const std::string& source_name, const FilePath& path); void RemoveFileSource(const std::string& source_name); - static URLRequestJob* Factory(URLRequest* request, const std::string& scheme); + static net::URLRequestJob* Factory(net::URLRequest* request, + const std::string& scheme); private: friend class URLRequestChromeJob; diff --git a/chrome/browser/dom_ui/mediaplayer_ui.h b/chrome/browser/dom_ui/mediaplayer_ui.h index c339799..5c5b4bc 100644 --- a/chrome/browser/dom_ui/mediaplayer_ui.h +++ b/chrome/browser/dom_ui/mediaplayer_ui.h @@ -75,13 +75,13 @@ class MediaPlayer : public NotificationObserver, // Always returns NULL because we don't want to attempt a redirect // before seeing the detected mime type of the request. // Implementation of URLRequest::Interceptor. - virtual URLRequestJob* MaybeIntercept(URLRequest* request); + virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request); // Determines if the requested document can be viewed by the // MediaPlayer. If it can, returns a URLRequestJob that // redirects the browser to the view URL. // Implementation of URLRequest::Interceptor. - virtual URLRequestJob* MaybeInterceptResponse(URLRequest* request); + virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request); // Used to detect when the mediaplayer is closed. void Observe(NotificationType type, diff --git a/chrome/browser/dom_ui/shared_resources_data_source.h b/chrome/browser/dom_ui/shared_resources_data_source.h index 712795e..a162b43 100644 --- a/chrome/browser/dom_ui/shared_resources_data_source.h +++ b/chrome/browser/dom_ui/shared_resources_data_source.h @@ -8,9 +8,12 @@ #include "chrome/browser/dom_ui/chrome_url_data_manager.h" -class GURL; +namespace net { class URLRequest; class URLRequestJob; +} // namespace net + +class GURL; // A DataSource for chrome://resources/ URLs. class SharedResourcesDataSource : public ChromeURLDataManager::DataSource { diff --git a/chrome/browser/extensions/autoupdate_interceptor.h b/chrome/browser/extensions/autoupdate_interceptor.h index 42ae024..219941a 100644 --- a/chrome/browser/extensions/autoupdate_interceptor.h +++ b/chrome/browser/extensions/autoupdate_interceptor.h @@ -22,7 +22,7 @@ class AutoUpdateInterceptor // When computing matches, this ignores query parameters (since the autoupdate // fetch code appends a bunch of them to manifest fetches). - virtual URLRequestJob* MaybeIntercept(URLRequest* request); + virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request); // When requests for |url| arrive, respond with the contents of |path|. The // hostname of |url| must be "localhost" to avoid DNS lookups, and the scheme diff --git a/chrome/browser/extensions/user_script_listener.h b/chrome/browser/extensions/user_script_listener.h index 3ac83ed..f1cdb75 100644 --- a/chrome/browser/extensions/user_script_listener.h +++ b/chrome/browser/extensions/user_script_listener.h @@ -13,9 +13,12 @@ #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +namespace net { +class URLRequest; +} // namespace net + class Extension; class URLPattern; -class URLRequest; struct GlobalRequestID; // This class handles delaying of resource loads that depend on unloaded user @@ -38,7 +41,7 @@ class UserScriptListener // ResourceQueueDelegate: virtual bool ShouldDelayRequest( - URLRequest* request, + net::URLRequest* request, const ResourceDispatcherHostRequestInfo& request_info, const GlobalRequestID& request_id); virtual void WillShutdownResourceQueue(); diff --git a/chrome/browser/login_prompt.h b/chrome/browser/login_prompt.h index e5a8928..db7b081 100644 --- a/chrome/browser/login_prompt.h +++ b/chrome/browser/login_prompt.h @@ -17,11 +17,11 @@ namespace net { class AuthChallengeInfo; -} +class URLRequest; +} // namespace net class ConstrainedWindow; class GURL; -class URLRequest; // This is the base implementation for the OS-specific classes that route // authentication info to the URLRequest that needs it. These functions must @@ -30,13 +30,13 @@ class LoginHandler : public base::RefCountedThreadSafe<LoginHandler>, public LoginModelObserver, public NotificationObserver { public: - LoginHandler(net::AuthChallengeInfo* auth_info, URLRequest* request); + LoginHandler(net::AuthChallengeInfo* auth_info, net::URLRequest* request); virtual ~LoginHandler(); // Builds the platform specific LoginHandler. Used from within // CreateLoginPrompt() which creates tasks. static LoginHandler* Create(net::AuthChallengeInfo* auth_info, - URLRequest* request); + net::URLRequest* request); // Initializes the underlying platform specific view. virtual void BuildViewForPasswordManager(PasswordManager* manager, @@ -125,7 +125,7 @@ class LoginHandler : public base::RefCountedThreadSafe<LoginHandler>, // The request that wants login data. // This should only be accessed on the IO loop. - URLRequest* request_; + net::URLRequest* request_; // The PasswordForm sent to the PasswordManager. This is so we can refer to it // when later notifying the password manager if the credentials were accepted @@ -200,11 +200,11 @@ class AuthSuppliedLoginNotificationDetails : public LoginNotificationDetails { // caller must invoke OnRequestCancelled() on this LoginHandler before // destroying the URLRequest. LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, - URLRequest* request); + net::URLRequest* request); // Helper to remove the ref from an URLRequest to the LoginHandler. // Should only be called from the IO thread, since it accesses an URLRequest. -void ResetLoginHandlerForRequest(URLRequest* request); +void ResetLoginHandlerForRequest(net::URLRequest* request); // Get the signon_realm under which the identity should be saved. std::string GetSignonRealm(const GURL& url, diff --git a/chrome/browser/net/connect_interceptor.cc b/chrome/browser/net/connect_interceptor.cc index dc74172..40afc6e 100644 --- a/chrome/browser/net/connect_interceptor.cc +++ b/chrome/browser/net/connect_interceptor.cc @@ -17,7 +17,8 @@ ConnectInterceptor::~ConnectInterceptor() { URLRequest::UnregisterRequestInterceptor(this); } -URLRequestJob* ConnectInterceptor::MaybeIntercept(URLRequest* request) { +net::URLRequestJob* ConnectInterceptor::MaybeIntercept( + net::URLRequest* request) { // Learn what URLs are likely to be needed during next startup. // Pass actual URL, rather than WithEmptyPath, as we often won't need to do // the canonicalization. @@ -48,12 +49,13 @@ URLRequestJob* ConnectInterceptor::MaybeIntercept(URLRequest* request) { return NULL; } -URLRequestJob* ConnectInterceptor::MaybeInterceptResponse(URLRequest* request) { +net::URLRequestJob* ConnectInterceptor::MaybeInterceptResponse( + net::URLRequest* request) { return NULL; } -URLRequestJob* ConnectInterceptor::MaybeInterceptRedirect( - URLRequest* request, +net::URLRequestJob* ConnectInterceptor::MaybeInterceptRedirect( + net::URLRequest* request, const GURL& location) { return NULL; } diff --git a/chrome/browser/net/connect_interceptor.h b/chrome/browser/net/connect_interceptor.h index 1f8eb70..ee4422b 100644 --- a/chrome/browser/net/connect_interceptor.h +++ b/chrome/browser/net/connect_interceptor.h @@ -23,10 +23,10 @@ class ConnectInterceptor : public URLRequest::Interceptor { protected: // URLRequest::Interceptor overrides // Learn about referrers, and optionally preconnect based on history. - virtual URLRequestJob* MaybeIntercept(URLRequest* request); - virtual URLRequestJob* MaybeInterceptResponse(URLRequest* request); - virtual URLRequestJob* MaybeInterceptRedirect(URLRequest* request, - const GURL& location); + virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request); + virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request); + virtual net::URLRequestJob* MaybeInterceptRedirect(net::URLRequest* request, + const GURL& location); private: DISALLOW_COPY_AND_ASSIGN(ConnectInterceptor); diff --git a/chrome/browser/net/load_timing_observer.h b/chrome/browser/net/load_timing_observer.h index fad011b..ec3c2e5 100644 --- a/chrome/browser/net/load_timing_observer.h +++ b/chrome/browser/net/load_timing_observer.h @@ -13,7 +13,10 @@ #include "net/base/net_log.h" #include "webkit/glue/resource_loader_bridge.h" +namespace net { class URLRequest; +} // namespace net + struct ResourceResponse; // LoadTimingObserver watches the NetLog event stream and collects the network @@ -52,7 +55,7 @@ class LoadTimingObserver : public ChromeNetLog::Observer { net::NetLog::EventPhase phase, net::NetLog::EventParameters* params); - static void PopulateTimingInfo(URLRequest* request, + static void PopulateTimingInfo(net::URLRequest* request, ResourceResponse* response); private: diff --git a/chrome/browser/net/metadata_url_request.cc b/chrome/browser/net/metadata_url_request.cc index 57eac50..dacfc5d 100644 --- a/chrome/browser/net/metadata_url_request.cc +++ b/chrome/browser/net/metadata_url_request.cc @@ -17,7 +17,7 @@ namespace { -class MetadataRequestHandler : public URLRequestJob { +class MetadataRequestHandler : public net::URLRequestJob { public: explicit MetadataRequestHandler(URLRequest* request); diff --git a/chrome/browser/net/prerender_interceptor.cc b/chrome/browser/net/prerender_interceptor.cc index f4df5b4..c1e5698 100644 --- a/chrome/browser/net/prerender_interceptor.cc +++ b/chrome/browser/net/prerender_interceptor.cc @@ -34,12 +34,13 @@ PrerenderInterceptor::~PrerenderInterceptor() { URLRequest::UnregisterRequestInterceptor(this); } -URLRequestJob* PrerenderInterceptor::MaybeIntercept(URLRequest* request) { +net::URLRequestJob* PrerenderInterceptor::MaybeIntercept( + net::URLRequest* request) { return NULL; } -URLRequestJob* PrerenderInterceptor::MaybeInterceptResponse( - URLRequest* request) { +net::URLRequestJob* PrerenderInterceptor::MaybeInterceptResponse( + net::URLRequest* request) { // TODO(gavinp): unfortunately, we can't figure out the origin // of this request here on systems where the referrer is blocked by // configuration. diff --git a/chrome/browser/net/prerender_interceptor.h b/chrome/browser/net/prerender_interceptor.h index 3c0f262..02cdbff 100644 --- a/chrome/browser/net/prerender_interceptor.h +++ b/chrome/browser/net/prerender_interceptor.h @@ -26,8 +26,8 @@ class PrerenderInterceptor : public URLRequest::Interceptor { // URLRequest::Interceptor overrides. We only care about // MaybeInterceptResponse, but must capture MaybeIntercept since // it is pure virtual. - virtual URLRequestJob* MaybeIntercept(URLRequest* request); - virtual URLRequestJob* MaybeInterceptResponse(URLRequest* request); + virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request); + virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request); private: friend class PrerenderInterceptorTest; diff --git a/chrome/browser/net/url_request_failed_dns_job.h b/chrome/browser/net/url_request_failed_dns_job.h index a0c4542..14e5402 100644 --- a/chrome/browser/net/url_request_failed_dns_job.h +++ b/chrome/browser/net/url_request_failed_dns_job.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. // This class simulates what wininet does when a dns lookup fails. @@ -9,15 +9,15 @@ #include "net/url_request/url_request_job.h" -class URLRequestFailedDnsJob : public URLRequestJob { +class URLRequestFailedDnsJob : public net::URLRequestJob { public: - explicit URLRequestFailedDnsJob(URLRequest* request) + explicit URLRequestFailedDnsJob(net::URLRequest* request) : URLRequestJob(request) { } virtual void Start(); - static URLRequestJob* Factory(URLRequest* request, - const std::string& scheme); + static net::URLRequestJob* Factory(net::URLRequest* request, + const std::string& scheme); // A test URL that can be used in UI tests. static const char kTestUrl[]; diff --git a/chrome/browser/net/url_request_slow_download_job.h b/chrome/browser/net/url_request_slow_download_job.h index 9d92338..22da86a 100644 --- a/chrome/browser/net/url_request_slow_download_job.h +++ b/chrome/browser/net/url_request_slow_download_job.h @@ -16,7 +16,7 @@ class URLRequestSlowDownloadJob : public URLRequestJob { public: - explicit URLRequestSlowDownloadJob(URLRequest* request); + explicit URLRequestSlowDownloadJob(net::URLRequest* request); // Timer callback, used to check to see if we should finish our download and // send the second chunk. @@ -28,8 +28,8 @@ class URLRequestSlowDownloadJob : public URLRequestJob { virtual void GetResponseInfo(net::HttpResponseInfo* info); virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int *bytes_read); - static URLRequestJob* Factory(URLRequest* request, - const std::string& scheme); + static net::URLRequestJob* Factory(net::URLRequest* request, + const std::string& scheme); // Test URLs. static const char kUnknownSizeUrl[]; diff --git a/chrome/browser/net/url_request_tracking.h b/chrome/browser/net/url_request_tracking.h index 4eb3dfd..0e7a7156 100644 --- a/chrome/browser/net/url_request_tracking.h +++ b/chrome/browser/net/url_request_tracking.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -6,7 +6,9 @@ #define CHROME_BROWSER_NET_URL_REQUEST_TRACKING_H_ #pragma once +namespace net { class URLRequest; +} // namespace net namespace chrome_browser_net { @@ -24,12 +26,12 @@ namespace chrome_browser_net { // the request. This is normally the renderer corresponding to the load. If a // plugin process does a request through a renderer process this will be the // plugin (the originator of the request). -void SetOriginProcessUniqueIDForRequest(int id, URLRequest* request); +void SetOriginProcessUniqueIDForRequest(int id, net::URLRequest* request); // Returns the child process' unique ID that has been previously set by // SetOriginProcessUniqueIDForRequest. If no ID has been set, the return // value is -1. We use this to identify requests made by the browser process. -int GetOriginProcessUniqueIDForRequest(const URLRequest* request); +int GetOriginProcessUniqueIDForRequest(const net::URLRequest* request); } // namespace chrome_browser_net diff --git a/chrome/browser/net/view_blob_internals_job_factory.h b/chrome/browser/net/view_blob_internals_job_factory.h index 874e2bd..e2a118b 100644 --- a/chrome/browser/net/view_blob_internals_job_factory.h +++ b/chrome/browser/net/view_blob_internals_job_factory.h @@ -6,15 +6,17 @@ #define CHROME_BROWSER_NET_VIEW_BLOB_INTERNALS_JOB_FACTORY_H_ #pragma once -class GURL; +namespace net { class URLRequest; class URLRequestJob; +} // namespace net + +class GURL; class ViewBlobInternalsJobFactory { public: static bool IsSupportedURL(const GURL& url); - static URLRequestJob* CreateJobForRequest(URLRequest* request); + static net::URLRequestJob* CreateJobForRequest(net::URLRequest* request); }; #endif // CHROME_BROWSER_NET_VIEW_BLOB_INTERNALS_JOB_FACTORY_H_ - diff --git a/chrome/browser/net/view_http_cache_job_factory.cc b/chrome/browser/net/view_http_cache_job_factory.cc index 3793df3..8e14a11 100644 --- a/chrome/browser/net/view_http_cache_job_factory.cc +++ b/chrome/browser/net/view_http_cache_job_factory.cc @@ -16,7 +16,7 @@ namespace { // A job subclass that dumps an HTTP cache entry. -class ViewHttpCacheJob : public URLRequestJob { +class ViewHttpCacheJob : public net::URLRequestJob { public: explicit ViewHttpCacheJob(URLRequest* request) : URLRequestJob(request), data_offset_(0), cancel_(false), busy_(false), diff --git a/chrome/browser/net/view_http_cache_job_factory.h b/chrome/browser/net/view_http_cache_job_factory.h index 6291902..eb164c5 100644 --- a/chrome/browser/net/view_http_cache_job_factory.h +++ b/chrome/browser/net/view_http_cache_job_factory.h @@ -6,14 +6,17 @@ #define CHROME_BROWSER_NET_VIEW_HTTP_CACHE_JOB_FACTORY_H_ #pragma once -class GURL; +namespace net { class URLRequest; class URLRequestJob; +} // namespace net + +class GURL; class ViewHttpCacheJobFactory { public: static bool IsSupportedURL(const GURL& url); - static URLRequestJob* CreateJobForRequest(URLRequest* request); + static net::URLRequestJob* CreateJobForRequest(net::URLRequest* request); }; #endif // CHROME_BROWSER_NET_VIEW_HTTP_CACHE_JOB_FACTORY_H_ diff --git a/chrome/browser/renderer_host/buffered_resource_handler.h b/chrome/browser/renderer_host/buffered_resource_handler.h index 69e64c5..05cbd48 100644 --- a/chrome/browser/renderer_host/buffered_resource_handler.h +++ b/chrome/browser/renderer_host/buffered_resource_handler.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -12,14 +12,17 @@ class MessageLoop; class ResourceDispatcherHost; + +namespace net { class URLRequest; +} // namespace net // Used to buffer a request until enough data has been received. class BufferedResourceHandler : public ResourceHandler { public: BufferedResourceHandler(ResourceHandler* handler, ResourceDispatcherHost* host, - URLRequest* request); + net::URLRequest* request); // ResourceHandler implementation: virtual bool OnUploadProgress(int request_id, uint64 position, uint64 size); @@ -79,7 +82,7 @@ class BufferedResourceHandler : public ResourceHandler { scoped_refptr<ResourceHandler> real_handler_; scoped_refptr<ResourceResponse> response_; ResourceDispatcherHost* host_; - URLRequest* request_; + net::URLRequest* request_; scoped_refptr<net::IOBuffer> read_buffer_; scoped_refptr<net::IOBuffer> my_buffer_; int read_buffer_size_; diff --git a/chrome/browser/renderer_host/download_resource_handler.h b/chrome/browser/renderer_host/download_resource_handler.h index 302a9e0..95c09da2 100644 --- a/chrome/browser/renderer_host/download_resource_handler.h +++ b/chrome/browser/renderer_host/download_resource_handler.h @@ -15,9 +15,12 @@ class DownloadFileManager; class ResourceDispatcherHost; -class URLRequest; struct DownloadBuffer; +namespace net { +class URLRequest; +} // namespace net + // Forwards data to the download thread. class DownloadResourceHandler : public ResourceHandler { public: @@ -27,7 +30,7 @@ class DownloadResourceHandler : public ResourceHandler { int request_id, const GURL& url, DownloadFileManager* download_file_manager, - URLRequest* request, + net::URLRequest* request, bool save_as, const DownloadSaveInfo& save_info); @@ -79,7 +82,7 @@ class DownloadResourceHandler : public ResourceHandler { GURL url_; int64 content_length_; DownloadFileManager* download_file_manager_; - URLRequest* request_; + net::URLRequest* request_; bool save_as_; // Request was initiated via "Save As" by the user. DownloadSaveInfo save_info_; DownloadBuffer* buffer_; diff --git a/chrome/browser/renderer_host/download_throttling_resource_handler.h b/chrome/browser/renderer_host/download_throttling_resource_handler.h index 308792f..22de040 100644 --- a/chrome/browser/renderer_host/download_throttling_resource_handler.h +++ b/chrome/browser/renderer_host/download_throttling_resource_handler.h @@ -14,7 +14,10 @@ class DownloadResourceHandler; class ResourceDispatcherHost; + +namespace net { class URLRequest; +} // namespace net // DownloadThrottlingResourceHandler is used to determine if a download should // be allowed. When a DownloadThrottlingResourceHandler is created it pauses the @@ -29,7 +32,7 @@ class DownloadThrottlingResourceHandler public DownloadRequestLimiter::Callback { public: DownloadThrottlingResourceHandler(ResourceDispatcherHost* host, - URLRequest* request, + net::URLRequest* request, const GURL& url, int render_process_host_id, int render_view_id, @@ -63,7 +66,7 @@ class DownloadThrottlingResourceHandler void CopyTmpBufferToDownloadHandler(); ResourceDispatcherHost* host_; - URLRequest* request_; + net::URLRequest* request_; GURL url_; int render_process_host_id_; int render_view_id_; diff --git a/chrome/browser/renderer_host/offline_resource_handler.h b/chrome/browser/renderer_host/offline_resource_handler.h index 8c72ead..eb19072 100644 --- a/chrome/browser/renderer_host/offline_resource_handler.h +++ b/chrome/browser/renderer_host/offline_resource_handler.h @@ -14,7 +14,10 @@ class MessageLoop; class ResourceDispatcherHost; + +namespace net { class URLRequest; +} // namespace net // Used to show an offline interstitial page when the network is not available. class OfflineResourceHandler : public ResourceHandler, @@ -24,7 +27,7 @@ class OfflineResourceHandler : public ResourceHandler, int host_id, int render_view_id, ResourceDispatcherHost* rdh, - URLRequest* request); + net::URLRequest* request); ~OfflineResourceHandler() {} // ResourceHandler implementation: @@ -63,7 +66,7 @@ class OfflineResourceHandler : public ResourceHandler, int process_host_id_; int render_view_id_; ResourceDispatcherHost* rdh_; - URLRequest* request_; + net::URLRequest* request_; // The state for deferred load quest. int deferred_request_id_; diff --git a/chrome/browser/renderer_host/resource_queue.h b/chrome/browser/renderer_host/resource_queue.h index bd71150..d6ce412 100644 --- a/chrome/browser/renderer_host/resource_queue.h +++ b/chrome/browser/renderer_host/resource_queue.h @@ -11,8 +11,11 @@ #include "base/basictypes.h" -class ResourceDispatcherHostRequestInfo; +namespace net { class URLRequest; +} // namespace net + +class ResourceDispatcherHostRequestInfo; struct GlobalRequestID; // Makes decisions about delaying or not each URLRequest in the queue. @@ -23,7 +26,7 @@ class ResourceQueueDelegate { // point. To start the delayed request, ResourceQueue::StartDelayedRequest // should be used. virtual bool ShouldDelayRequest( - URLRequest* request, + net::URLRequest* request, const ResourceDispatcherHostRequestInfo& request_info, const GlobalRequestID& request_id) = 0; @@ -59,7 +62,7 @@ class ResourceQueue { // Takes care to start the |request| after all delegates allow that. If no // delegate demands delaying the request it will be started immediately. - void AddRequest(URLRequest* request, + void AddRequest(net::URLRequest* request, const ResourceDispatcherHostRequestInfo& request_info); // Tells the queue that the URLRequest object associated with |request_id| @@ -73,7 +76,7 @@ class ResourceQueue { const GlobalRequestID& request_id); private: - typedef std::map<GlobalRequestID, URLRequest*> RequestMap; + typedef std::map<GlobalRequestID, net::URLRequest*> RequestMap; typedef std::map<GlobalRequestID, DelegateSet> InterestedDelegatesMap; // The registered delegates. Will not change after the queue has been diff --git a/chrome/browser/renderer_host/resource_request_details.h b/chrome/browser/renderer_host/resource_request_details.h index 36f3456..bdb87bf 100644 --- a/chrome/browser/renderer_host/resource_request_details.h +++ b/chrome/browser/renderer_host/resource_request_details.h @@ -19,12 +19,14 @@ #include "googleurl/src/gurl.h" #include "net/url_request/url_request_status.h" +namespace net { class URLRequest; +} // namespace net // Details about a resource request notification. class ResourceRequestDetails { public: - ResourceRequestDetails(const URLRequest* request, int cert_id); + ResourceRequestDetails(const net::URLRequest* request, int cert_id); virtual ~ResourceRequestDetails(); @@ -61,7 +63,7 @@ class ResourceRequestDetails { // Details about a redirection of a resource request. class ResourceRedirectDetails : public ResourceRequestDetails { public: - ResourceRedirectDetails(const URLRequest* request, + ResourceRedirectDetails(const net::URLRequest* request, int cert_id, const GURL& new_url); virtual ~ResourceRedirectDetails(); diff --git a/chrome/browser/renderer_host/x509_user_cert_resource_handler.h b/chrome/browser/renderer_host/x509_user_cert_resource_handler.h index ba6afb4..54b481d 100644 --- a/chrome/browser/renderer_host/x509_user_cert_resource_handler.h +++ b/chrome/browser/renderer_host/x509_user_cert_resource_handler.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -12,8 +12,11 @@ #include "chrome/browser/renderer_host/resource_handler.h" #include "googleurl/src/gurl.h" -class ResourceDispatcherHost; +namespace net { class URLRequest; +} // namespace net + +class ResourceDispatcherHost; class URLRequestStatus; struct DownloadBuffer; @@ -24,7 +27,7 @@ struct DownloadBuffer; class X509UserCertResourceHandler : public ResourceHandler { public: X509UserCertResourceHandler(ResourceDispatcherHost* host, - URLRequest* request, + net::URLRequest* request, int render_process_host_id, int render_view_id); bool OnUploadProgress(int request_id, uint64 position, uint64 size); @@ -60,7 +63,7 @@ class X509UserCertResourceHandler : public ResourceHandler { GURL url_; ResourceDispatcherHost* host_; - URLRequest* request_; + net::URLRequest* request_; size_t content_length_; scoped_ptr<DownloadBuffer> buffer_; scoped_refptr<net::IOBuffer> read_buffer_; diff --git a/chrome/browser/ssl/ssl_add_cert_handler.h b/chrome/browser/ssl/ssl_add_cert_handler.h index fd73be5..0e3256a 100644 --- a/chrome/browser/ssl/ssl_add_cert_handler.h +++ b/chrome/browser/ssl/ssl_add_cert_handler.h @@ -10,9 +10,9 @@ #include "base/ref_counted.h" namespace net { +class URLRequest; class X509Certificate; } -class URLRequest; // This class handles adding a newly-generated client cert. It ensures there's a // private key for the cert, displays the cert to the user, and adds it upon @@ -20,7 +20,7 @@ class URLRequest; // It is self-owned and deletes itself when finished. class SSLAddCertHandler : public base::RefCountedThreadSafe<SSLAddCertHandler> { public: - SSLAddCertHandler(URLRequest* request, net::X509Certificate* cert, + SSLAddCertHandler(net::URLRequest* request, net::X509Certificate* cert, int render_process_host_id, int render_view_id); net::X509Certificate* cert() { return cert_; } diff --git a/chrome/browser/ssl/ssl_cert_error_handler.h b/chrome/browser/ssl/ssl_cert_error_handler.h index 7a0ca31..a4bdd0d 100644 --- a/chrome/browser/ssl/ssl_cert_error_handler.h +++ b/chrome/browser/ssl/ssl_cert_error_handler.h @@ -22,7 +22,7 @@ class SSLCertErrorHandler : public SSLErrorHandler { public: // Construct on the IO thread. SSLCertErrorHandler(ResourceDispatcherHost* rdh, - URLRequest* request, + net::URLRequest* request, ResourceType::Type resource_type, const std::string& frame_origin, const std::string& main_frame_origin, diff --git a/chrome/browser/ssl/ssl_client_auth_handler.h b/chrome/browser/ssl/ssl_client_auth_handler.h index c93a55a..4680602 100644 --- a/chrome/browser/ssl/ssl_client_auth_handler.h +++ b/chrome/browser/ssl/ssl_client_auth_handler.h @@ -12,9 +12,9 @@ #include "net/base/ssl_cert_request_info.h" namespace net { -class X509Certificate; -} class URLRequest; +class X509Certificate; +} // namespace net // This class handles the approval and selection of a certificate for SSL client // authentication by the user. @@ -24,7 +24,7 @@ class SSLClientAuthHandler : public base::RefCountedThreadSafe<SSLClientAuthHandler, BrowserThread::DeleteOnIOThread> { public: - SSLClientAuthHandler(URLRequest* request, + SSLClientAuthHandler(net::URLRequest* request, net::SSLCertRequestInfo* cert_request_info); // Asks the user to select a certificate and resumes the URL request with that @@ -55,7 +55,7 @@ class SSLClientAuthHandler void DoCertificateSelected(net::X509Certificate* cert); // The URLRequest that triggered this client auth. - URLRequest* request_; + net::URLRequest* request_; // The certs to choose from. scoped_refptr<net::SSLCertRequestInfo> cert_request_info_; diff --git a/chrome/browser/ssl/ssl_error_handler.h b/chrome/browser/ssl/ssl_error_handler.h index 383a9f8..104e9b5 100644 --- a/chrome/browser/ssl/ssl_error_handler.h +++ b/chrome/browser/ssl/ssl_error_handler.h @@ -18,7 +18,10 @@ class ResourceDispatcherHost; class SSLCertErrorHandler; class TabContents; + +namespace net { class URLRequest; +} // namespace net // An SSLErrorHandler carries information from the IO thread to the UI thread // and is dispatched to the appropriate SSLManager when it arrives on the @@ -88,7 +91,7 @@ class SSLErrorHandler : public base::RefCountedThreadSafe<SSLErrorHandler> { // Construct on the IO thread. SSLErrorHandler(ResourceDispatcherHost* resource_dispatcher_host, - URLRequest* request, + net::URLRequest* request, ResourceType::Type resource_type, const std::string& frame_origin, const std::string& main_frame_origin); diff --git a/chrome/browser/ssl/ssl_manager.h b/chrome/browser/ssl/ssl_manager.h index 6340f57..d45fe8c 100644 --- a/chrome/browser/ssl/ssl_manager.h +++ b/chrome/browser/ssl/ssl_manager.h @@ -24,7 +24,10 @@ class ResourceDispatcherHost; class ResourceRedirectDetails; class ResourceRequestDetails; class SSLPolicy; + +namespace net { class URLRequest; +} // namespace net // The SSLManager SSLManager controls the SSL UI elements in a TabContents. It // listens for various events that influence when these elements should or @@ -43,7 +46,7 @@ class SSLManager : public NotificationObserver { // // Called on the IO thread. static void OnSSLCertificateError(ResourceDispatcherHost* resource_dispatcher, - URLRequest* request, + net::URLRequest* request, int cert_error, net::X509Certificate* cert); diff --git a/chrome/browser/sync/glue/http_bridge.h b/chrome/browser/sync/glue/http_bridge.h index 5b9d4b2..530c215 100644 --- a/chrome/browser/sync/glue/http_bridge.h +++ b/chrome/browser/sync/glue/http_bridge.h @@ -60,7 +60,7 @@ class HttpBridge : public base::RefCountedThreadSafe<HttpBridge>, URLRequestContext::GetUserAgent(url) : user_agent_; } - virtual bool AllowSendingCookies(const URLRequest* request) const { + virtual bool AllowSendingCookies(const net::URLRequest* request) const { return false; } diff --git a/chrome/browser/task_manager/task_manager.h b/chrome/browser/task_manager/task_manager.h index 9d933e5..5b33c75 100644 --- a/chrome/browser/task_manager/task_manager.h +++ b/chrome/browser/task_manager/task_manager.h @@ -297,11 +297,13 @@ class TaskManagerModel : public URLRequestJobTracker::JobObserver, const Extension* GetResourceExtension(int index) const; // JobObserver methods: - void OnJobAdded(URLRequestJob* job); - void OnJobRemoved(URLRequestJob* job); - void OnJobDone(URLRequestJob* job, const URLRequestStatus& status); - void OnJobRedirect(URLRequestJob* job, const GURL& location, int status_code); - void OnBytesRead(URLRequestJob* job, const char* buf, int byte_count); + void OnJobAdded(net::URLRequestJob* job); + void OnJobRemoved(net::URLRequestJob* job); + void OnJobDone(net::URLRequestJob* job, const URLRequestStatus& status); + void OnJobRedirect(net::URLRequestJob* job, + const GURL& location, + int status_code); + void OnBytesRead(net::URLRequestJob* job, const char* buf, int byte_count); void AddResourceProvider(TaskManager::ResourceProvider* provider); void RemoveResourceProvider(TaskManager::ResourceProvider* provider); diff --git a/chrome/common/net/url_request_intercept_job.h b/chrome/common/net/url_request_intercept_job.h index 3835fe50..6d47bfc 100644 --- a/chrome/common/net/url_request_intercept_job.h +++ b/chrome/common/net/url_request_intercept_job.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -14,18 +14,21 @@ #include "chrome/common/chrome_plugin_util.h" #include "chrome/common/notification_registrar.h" -class ChromePluginLib; +namespace net { class URLRequest; +} // namespace net + +class ChromePluginLib; // A request job that handles network requests intercepted by a Chrome plugin. -class URLRequestInterceptJob - : public URLRequestJob, public NotificationObserver { +class URLRequestInterceptJob : public net::URLRequestJob, + public NotificationObserver { public: static URLRequestInterceptJob* FromCPRequest(CPRequest* request) { return ScopableCPRequest::GetData<URLRequestInterceptJob*>(request); } - URLRequestInterceptJob(URLRequest* request, ChromePluginLib* plugin, + URLRequestInterceptJob(net::URLRequest* request, ChromePluginLib* plugin, ScopableCPRequest* cprequest); virtual ~URLRequestInterceptJob(); diff --git a/chrome_frame/test/net/test_automation_provider.h b/chrome_frame/test/net/test_automation_provider.h index 9d3f65b..bc98b3a 100644 --- a/chrome_frame/test/net/test_automation_provider.h +++ b/chrome_frame/test/net/test_automation_provider.h @@ -7,9 +7,12 @@ #include <string> #include "chrome/browser/automation/automation_provider.h" -class TestAutomationResourceMessageFilter; +namespace net { class URLRequest; class URLRequestJob; +} // namespace net + +class TestAutomationResourceMessageFilter; // Callback interface for TestAutomationProvider. class TestAutomationProviderDelegate { @@ -37,8 +40,8 @@ class TestAutomationProvider virtual bool Send(IPC::Message* msg); // Protocol factory for handling http/https requests over automation. - static URLRequestJob* Factory(URLRequest* request, - const std::string& scheme); + static net::URLRequestJob* Factory(net::URLRequest* request, + const std::string& scheme); // Call to instantiate and initialize a new instance of // TestAutomationProvider. diff --git a/net/url_request/url_request.h b/net/url_request/url_request.h index 01df25b..fb81500 100644 --- a/net/url_request/url_request.h +++ b/net/url_request/url_request.h @@ -33,18 +33,19 @@ class CookieOptions; class IOBuffer; class SSLCertRequestInfo; class UploadData; +class URLRequestJob; class X509Certificate; } // namespace net class FilePath; class URLRequestContext; -class URLRequestJob; // This stores the values of the Set-Cookie headers received during the request. // Each item in the vector corresponds to a Set-Cookie: line received, // excluding the "Set-Cookie:" part. typedef std::vector<std::string> ResponseCookies; +namespace net { //----------------------------------------------------------------------------- // A class representing the asynchronous load of a data stream from an URL. // @@ -643,4 +644,8 @@ class URLRequest : public NonThreadSafe { DISALLOW_COPY_AND_ASSIGN(URLRequest); }; +} // namespace net + +typedef net::URLRequest URLRequest; + #endif // NET_URL_REQUEST_URL_REQUEST_H_ diff --git a/net/url_request/url_request_context.h b/net/url_request/url_request_context.h index f935f5f..38692ad 100644 --- a/net/url_request/url_request_context.h +++ b/net/url_request/url_request_context.h @@ -31,8 +31,8 @@ class HttpAuthHandlerFactory; class HttpNetworkDelegate; class HttpTransactionFactory; class SSLConfigService; -} class URLRequest; +} // namespace net // Subclass to provide application-specific context for URLRequest instances. class URLRequestContext diff --git a/net/url_request/url_request_data_job.h b/net/url_request/url_request_data_job.h index 1bb868a..7171088 100644 --- a/net/url_request/url_request_data_job.h +++ b/net/url_request/url_request_data_job.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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,17 +11,19 @@ #include "net/url_request/url_request.h" #include "net/url_request/url_request_simple_job.h" +namespace net { class URLRequest; +} // namespace net class URLRequestDataJob : public URLRequestSimpleJob { public: - explicit URLRequestDataJob(URLRequest* request); + explicit URLRequestDataJob(net::URLRequest* request); virtual bool GetData(std::string* mime_type, std::string* charset, std::string* data) const; - static URLRequest::ProtocolFactory Factory; + static net::URLRequest::ProtocolFactory Factory; private: ~URLRequestDataJob(); @@ -30,4 +32,3 @@ class URLRequestDataJob : public URLRequestSimpleJob { }; #endif // NET_URL_REQUEST_URL_REQUEST_DATA_JOB_H_ - diff --git a/net/url_request/url_request_error_job.cc b/net/url_request/url_request_error_job.cc index 4bb7195..1aeffac 100644 --- a/net/url_request/url_request_error_job.cc +++ b/net/url_request/url_request_error_job.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -8,7 +8,7 @@ #include "net/base/net_errors.h" #include "net/url_request/url_request_status.h" -URLRequestErrorJob::URLRequestErrorJob(URLRequest* request, int error) +URLRequestErrorJob::URLRequestErrorJob(net::URLRequest* request, int error) : URLRequestJob(request), error_(error) { } diff --git a/net/url_request/url_request_error_job.h b/net/url_request/url_request_error_job.h index efaea0c..6e7c879 100644 --- a/net/url_request/url_request_error_job.h +++ b/net/url_request/url_request_error_job.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. // @@ -13,15 +13,16 @@ class URLRequestErrorJob : public URLRequestJob { public: - URLRequestErrorJob(URLRequest* request, int error); + URLRequestErrorJob(net::URLRequest* request, int error); virtual void Start(); private: ~URLRequestErrorJob() {} - int error_; void StartAsync(); + + int error_; }; #endif // NET_URL_REQUEST_URL_REQUEST_ERROR_JOB_H_ diff --git a/net/url_request/url_request_file_dir_job.h b/net/url_request/url_request_file_dir_job.h index c78de97..aefaf5b 100644 --- a/net/url_request/url_request_file_dir_job.h +++ b/net/url_request/url_request_file_dir_job.h @@ -17,7 +17,7 @@ class URLRequestFileDirJob : public URLRequestJob, public net::DirectoryLister::DirectoryListerDelegate { public: - URLRequestFileDirJob(URLRequest* request, const FilePath& dir_path); + URLRequestFileDirJob(net::URLRequest* request, const FilePath& dir_path); // URLRequestJob methods: virtual void Start(); diff --git a/net/url_request/url_request_filter.cc b/net/url_request/url_request_filter.cc index 44863e3..fb305b2 100644 --- a/net/url_request/url_request_filter.cc +++ b/net/url_request/url_request_filter.cc @@ -18,8 +18,8 @@ URLRequestFilter* URLRequestFilter::GetInstance() { } /* static */ -URLRequestJob* URLRequestFilter::Factory(URLRequest* request, - const std::string& scheme) { +net::URLRequestJob* URLRequestFilter::Factory(net::URLRequest* request, + const std::string& scheme) { // Returning null here just means that the built-in handler will be used. return GetInstance()->FindRequestHandler(request, scheme); } @@ -112,9 +112,10 @@ void URLRequestFilter::ClearHandlers() { URLRequestFilter::URLRequestFilter() : hit_count_(0) { } -URLRequestJob* URLRequestFilter::FindRequestHandler(URLRequest* request, - const std::string& scheme) { - URLRequestJob* job = NULL; +net::URLRequestJob* URLRequestFilter::FindRequestHandler( + net::URLRequest* request, + const std::string& scheme) { + net::URLRequestJob* job = NULL; if (request->url().is_valid()) { // Check the hostname map first. const std::string& hostname = request->url().host(); diff --git a/net/url_request/url_request_filter.h b/net/url_request/url_request_filter.h index 17eb4bb..c3021cb 100644 --- a/net/url_request/url_request_filter.h +++ b/net/url_request/url_request_filter.h @@ -27,7 +27,10 @@ #include "net/url_request/url_request.h" class GURL; + +namespace net { class URLRequestJob; +} // namespace net class URLRequestFilter { public: @@ -67,8 +70,8 @@ class URLRequestFilter { URLRequestFilter(); // Helper method that looks up the request in the url_handler_map_. - URLRequestJob* FindRequestHandler(URLRequest* request, - const std::string& scheme); + net::URLRequestJob* FindRequestHandler(URLRequest* request, + const std::string& scheme); // Maps hostnames to factories. Hostnames take priority over URLs. HostnameHandlerMap hostname_handler_map_; diff --git a/net/url_request/url_request_ftp_job.h b/net/url_request/url_request_ftp_job.h index 48f963d..bd2fdc8 100644 --- a/net/url_request/url_request_ftp_job.h +++ b/net/url_request/url_request_ftp_job.h @@ -22,9 +22,10 @@ class URLRequestContext; class URLRequestFtpJob : public URLRequestJob { public: - explicit URLRequestFtpJob(URLRequest* request); + explicit URLRequestFtpJob(net::URLRequest* request); - static URLRequestJob* Factory(URLRequest* request, const std::string& scheme); + static URLRequestJob* Factory(net::URLRequest* request, + const std::string& scheme); // URLRequestJob methods: virtual bool GetMimeType(std::string* mime_type) const; diff --git a/net/url_request/url_request_http_job.h b/net/url_request/url_request_http_job.h index c981047..c9139b0 100644 --- a/net/url_request/url_request_http_job.h +++ b/net/url_request/url_request_http_job.h @@ -27,10 +27,11 @@ class URLRequestContext; // provides an implementation for both HTTP and HTTPS. class URLRequestHttpJob : public URLRequestJob { public: - static URLRequestJob* Factory(URLRequest* request, const std::string& scheme); + static URLRequestJob* Factory(net::URLRequest* request, + const std::string& scheme); protected: - explicit URLRequestHttpJob(URLRequest* request); + explicit URLRequestHttpJob(net::URLRequest* request); // URLRequestJob methods: virtual void SetUpload(net::UploadData* upload); diff --git a/net/url_request/url_request_job.h b/net/url_request/url_request_job.h index 56496ed..239f5e9 100644 --- a/net/url_request/url_request_job.h +++ b/net/url_request/url_request_job.h @@ -23,13 +23,15 @@ class HttpRequestHeaders; class HttpResponseInfo; class IOBuffer; class UploadData; +class URLRequest; class X509Certificate; -} +} // namespace net -class URLRequest; class URLRequestStatus; class URLRequestJobMetrics; +namespace net { + class URLRequestJob : public base::RefCounted<URLRequestJob>, public FilterContext { public: @@ -40,11 +42,11 @@ class URLRequestJob : public base::RefCounted<URLRequestJob>, // congestion window on stalling of transmissions. static const size_t kSdchPacketHistogramCount = 5; - explicit URLRequestJob(URLRequest* request); + explicit URLRequestJob(net::URLRequest* request); // Returns the request that owns this job. THIS POINTER MAY BE NULL if the // request was destroyed. - URLRequest* request() const { + net::URLRequest* request() const { return request_; } @@ -278,7 +280,7 @@ class URLRequestJob : public base::RefCounted<URLRequestJob>, // The request that initiated this job. This value MAY BE NULL if the // request was released by DetachRequest(). - URLRequest* request_; + net::URLRequest* request_; // The status of the job. const URLRequestStatus GetStatus(); @@ -420,4 +422,8 @@ class URLRequestJob : public base::RefCounted<URLRequestJob>, DISALLOW_COPY_AND_ASSIGN(URLRequestJob); }; +} // namespace net + +typedef net::URLRequestJob URLRequestJob; + #endif // NET_URL_REQUEST_URL_REQUEST_JOB_H_ diff --git a/net/url_request/url_request_job_manager.h b/net/url_request/url_request_job_manager.h index f459f40..0fbc31e 100644 --- a/net/url_request/url_request_job_manager.h +++ b/net/url_request/url_request_job_manager.h @@ -33,18 +33,18 @@ class URLRequestJobManager { // Instantiate an URLRequestJob implementation based on the registered // interceptors and protocol factories. This will always succeed in // returning a job unless we are--in the extreme case--out of memory. - URLRequestJob* CreateJob(URLRequest* request) const; + net::URLRequestJob* CreateJob(net::URLRequest* request) const; // Allows interceptors to hijack the request after examining the new location // of a redirect. Returns NULL if no interceptor intervenes. - URLRequestJob* MaybeInterceptRedirect(URLRequest* request, - const GURL& location) const; + net::URLRequestJob* MaybeInterceptRedirect(net::URLRequest* request, + const GURL& location) const; // Allows interceptors to hijack the request after examining the response // status and headers. This is also called when there is no server response // at all to allow interception of failed requests due to network errors. // Returns NULL if no interceptor intervenes. - URLRequestJob* MaybeInterceptResponse(URLRequest* request) const; + net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request) const; // Returns true if there is a protocol factory registered for the given // scheme. Note: also returns true if there is a built-in handler for the diff --git a/net/url_request/url_request_job_tracker.h b/net/url_request/url_request_job_tracker.h index 8b554b9..cd0bd86 100644 --- a/net/url_request/url_request_job_tracker.h +++ b/net/url_request/url_request_job_tracker.h @@ -11,7 +11,10 @@ #include "base/observer_list.h" #include "net/url_request/url_request_status.h" +namespace net { class URLRequestJob; +} // namespace net + class GURL; // This class maintains a list of active URLRequestJobs for debugging purposes. @@ -23,25 +26,25 @@ class GURL; // class URLRequestJobTracker { public: - typedef std::vector<URLRequestJob*> JobList; + typedef std::vector<net::URLRequestJob*> JobList; typedef JobList::const_iterator JobIterator; // The observer's methods are called on the thread that called AddObserver. class JobObserver { public: // Called after the given job has been added to the list - virtual void OnJobAdded(URLRequestJob* job) = 0; + virtual void OnJobAdded(net::URLRequestJob* job) = 0; // Called after the given job has been removed from the list - virtual void OnJobRemoved(URLRequestJob* job) = 0; + virtual void OnJobRemoved(net::URLRequestJob* job) = 0; // Called when the given job has completed, before notifying the request - virtual void OnJobDone(URLRequestJob* job, + virtual void OnJobDone(net::URLRequestJob* job, const URLRequestStatus& status) = 0; // Called when the given job is about to follow a redirect to the given // new URL. The redirect type is given in status_code - virtual void OnJobRedirect(URLRequestJob* job, const GURL& location, + virtual void OnJobRedirect(net::URLRequestJob* job, const GURL& location, int status_code) = 0; // Called when a new chunk of unfiltered bytes has been read for @@ -49,7 +52,7 @@ class URLRequestJobTracker { // read event only. |buf| is a pointer to the data buffer that // contains those bytes. The data in |buf| is only valid for the // duration of the OnBytesRead callback. - virtual void OnBytesRead(URLRequestJob* job, const char* buf, + virtual void OnBytesRead(net::URLRequestJob* job, const char* buf, int byte_count) = 0; virtual ~JobObserver() {} @@ -70,16 +73,16 @@ class URLRequestJobTracker { // adds or removes the job from the active list, should be called by the // job constructor and destructor. Note: don't use "AddJob" since that // is #defined by windows.h :( - void AddNewJob(URLRequestJob* job); - void RemoveJob(URLRequestJob* job); + void AddNewJob(net::URLRequestJob* job); + void RemoveJob(net::URLRequestJob* job); // Job status change notifications - void OnJobDone(URLRequestJob* job, const URLRequestStatus& status); - void OnJobRedirect(URLRequestJob* job, const GURL& location, + void OnJobDone(net::URLRequestJob* job, const URLRequestStatus& status); + void OnJobRedirect(net::URLRequestJob* job, const GURL& location, int status_code); // Bytes read notifications. - void OnBytesRead(URLRequestJob* job, const char* buf, int byte_count); + void OnBytesRead(net::URLRequestJob* job, const char* buf, int byte_count); // allows iteration over all active jobs JobIterator begin() const { diff --git a/net/url_request/url_request_redirect_job.cc b/net/url_request/url_request_redirect_job.cc index d8a1a3e..001da10 100644 --- a/net/url_request/url_request_redirect_job.cc +++ b/net/url_request/url_request_redirect_job.cc @@ -6,7 +6,7 @@ #include "base/message_loop.h" -URLRequestRedirectJob::URLRequestRedirectJob(URLRequest* request, +URLRequestRedirectJob::URLRequestRedirectJob(net::URLRequest* request, GURL redirect_destination) : URLRequestJob(request), redirect_destination_(redirect_destination) { } diff --git a/net/url_request/url_request_redirect_job.h b/net/url_request/url_request_redirect_job.h index 55c34a7..7466cec 100644 --- a/net/url_request/url_request_redirect_job.h +++ b/net/url_request/url_request_redirect_job.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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 @@ class GURL; class URLRequestRedirectJob : public URLRequestJob { public: // Constructs a job that redirects to the specified URL. - URLRequestRedirectJob(URLRequest* request, GURL redirect_destination); + URLRequestRedirectJob(net::URLRequest* request, GURL redirect_destination); virtual void Start(); bool IsRedirectResponse(GURL* location, int* http_status_code); @@ -30,4 +30,3 @@ class URLRequestRedirectJob : public URLRequestJob { }; #endif // NET_URL_REQUEST_URL_REQUEST_REDIRECT_JOB_H_ - diff --git a/net/url_request/url_request_simple_job.cc b/net/url_request/url_request_simple_job.cc index 2f23d58..38e0c4d 100644 --- a/net/url_request/url_request_simple_job.cc +++ b/net/url_request/url_request_simple_job.cc @@ -9,7 +9,7 @@ #include "net/base/net_errors.h" #include "net/url_request/url_request_status.h" -URLRequestSimpleJob::URLRequestSimpleJob(URLRequest* request) +URLRequestSimpleJob::URLRequestSimpleJob(net::URLRequest* request) : URLRequestJob(request), data_offset_(0) { } diff --git a/net/url_request/url_request_simple_job.h b/net/url_request/url_request_simple_job.h index bcc4047..877b0811a 100644 --- a/net/url_request/url_request_simple_job.h +++ b/net/url_request/url_request_simple_job.h @@ -10,11 +10,13 @@ #include "net/url_request/url_request_job.h" +namespace net { class URLRequest; +} // namespace net -class URLRequestSimpleJob : public URLRequestJob { +class URLRequestSimpleJob : public net::URLRequestJob { public: - explicit URLRequestSimpleJob(URLRequest* request); + explicit URLRequestSimpleJob(net::URLRequest* request); virtual void Start(); virtual bool ReadRawData(net::IOBuffer* buf, int buf_size, int *bytes_read); diff --git a/net/url_request/url_request_test_job.h b/net/url_request/url_request_test_job.h index 7cb4777..14b90d4 100644 --- a/net/url_request/url_request_test_job.h +++ b/net/url_request/url_request_test_job.h @@ -33,7 +33,7 @@ // // Optionally, you can also construct test jobs that advance automatically // without having to call ProcessOnePendingMessage. -class URLRequestTestJob : public URLRequestJob { +class URLRequestTestJob : public net::URLRequestJob { public: // Constructs a job to return one of the canned responses depending on the // request url, with auto advance disabled. diff --git a/webkit/appcache/appcache_host.h b/webkit/appcache/appcache_host.h index d3743b4..0aa0351 100644 --- a/webkit/appcache/appcache_host.h +++ b/webkit/appcache/appcache_host.h @@ -16,7 +16,9 @@ #include "webkit/appcache/appcache_storage.h" #include "webkit/glue/resource_type.h" +namespace net { class URLRequest; +} // namespace net namespace appcache { @@ -72,7 +74,7 @@ class AppCacheHost : public AppCacheStorage::Delegate, // Support for loading resources out of the appcache. // May return NULL if the request isn't subject to retrieval from an appache. AppCacheRequestHandler* CreateRequestHandler( - URLRequest* request, ResourceType::Type resource_type); + net::URLRequest* request, ResourceType::Type resource_type); // Support for devtools inspecting appcache resources. void GetResourceList(std::vector<AppCacheResourceInfo>* resource_infos); diff --git a/webkit/appcache/appcache_interceptor.h b/webkit/appcache/appcache_interceptor.h index 7af9aed..519d89b 100644 --- a/webkit/appcache/appcache_interceptor.h +++ b/webkit/appcache/appcache_interceptor.h @@ -40,10 +40,10 @@ class AppCacheInterceptor : public URLRequest::Interceptor { protected: // URLRequest::Interceptor overrides - virtual URLRequestJob* MaybeIntercept(URLRequest* request); - virtual URLRequestJob* MaybeInterceptResponse(URLRequest* request); - virtual URLRequestJob* MaybeInterceptRedirect(URLRequest* request, - const GURL& location); + virtual net::URLRequestJob* MaybeIntercept(net::URLRequest* request); + virtual net::URLRequestJob* MaybeInterceptResponse(net::URLRequest* request); + virtual net::URLRequestJob* MaybeInterceptRedirect(net::URLRequest* request, + const GURL& location); private: friend struct DefaultSingletonTraits<AppCacheInterceptor>; @@ -55,8 +55,9 @@ class AppCacheInterceptor : public URLRequest::Interceptor { AppCacheInterceptor(); virtual ~AppCacheInterceptor(); - static void SetHandler(URLRequest* request, AppCacheRequestHandler* handler); - static AppCacheRequestHandler* GetHandler(URLRequest* request); + static void SetHandler(net::URLRequest* request, + AppCacheRequestHandler* handler); + static AppCacheRequestHandler* GetHandler(net::URLRequest* request); DISALLOW_COPY_AND_ASSIGN(AppCacheInterceptor); }; diff --git a/webkit/appcache/appcache_interfaces.h b/webkit/appcache/appcache_interfaces.h index 973f795..d29acd6 100644 --- a/webkit/appcache/appcache_interfaces.h +++ b/webkit/appcache/appcache_interfaces.h @@ -12,7 +12,9 @@ #include "base/time.h" #include "googleurl/src/gurl.h" +namespace net { class URLRequest; +} // namespace net namespace appcache { @@ -141,7 +143,7 @@ extern const char kHttpHEADMethod[]; bool IsSchemeSupported(const GURL& url); bool IsMethodSupported(const std::string& method); -bool IsSchemeAndMethodSupported(const URLRequest* request); +bool IsSchemeAndMethodSupported(const net::URLRequest* request); extern const FilePath::CharType kAppCacheDatabaseName[]; diff --git a/webkit/appcache/appcache_request_handler.h b/webkit/appcache/appcache_request_handler.h index 8577232..fcf7f8f 100644 --- a/webkit/appcache/appcache_request_handler.h +++ b/webkit/appcache/appcache_request_handler.h @@ -10,8 +10,10 @@ #include "webkit/appcache/appcache_host.h" #include "webkit/glue/resource_type.h" +namespace net { class URLRequest; class URLRequestJob; +} // namespace net namespace appcache { @@ -22,17 +24,17 @@ class AppCacheURLRequestJob; // given the opportunity to hijack the request along the way. Callers // should use AppCacheHost::CreateRequestHandler to manufacture instances // that can retrieve resources for a particular host. -class AppCacheRequestHandler : public URLRequest::UserData, +class AppCacheRequestHandler : public net::URLRequest::UserData, public AppCacheHost::Observer, public AppCacheStorage::Delegate { public: virtual ~AppCacheRequestHandler(); // These are called on each request intercept opportunity. - AppCacheURLRequestJob* MaybeLoadResource(URLRequest* request); - AppCacheURLRequestJob* MaybeLoadFallbackForRedirect(URLRequest* request, + AppCacheURLRequestJob* MaybeLoadResource(net::URLRequest* request); + AppCacheURLRequestJob* MaybeLoadFallbackForRedirect(net::URLRequest* request, const GURL& location); - AppCacheURLRequestJob* MaybeLoadFallbackForResponse(URLRequest* request); + AppCacheURLRequestJob* MaybeLoadFallbackForResponse(net::URLRequest* request); void GetExtraResponseInfo(int64* cache_id, GURL* manifest_url); @@ -68,7 +70,7 @@ class AppCacheRequestHandler : public URLRequest::UserData, // Main-resource loading ------------------------------------- // Frame and SharedWorker main resources are handled here. - void MaybeLoadMainResource(URLRequest* request); + void MaybeLoadMainResource(net::URLRequest* request); // AppCacheStorage::Delegate methods virtual void OnMainResponseFound( @@ -80,7 +82,7 @@ class AppCacheRequestHandler : public URLRequest::UserData, // Sub-resource loading ------------------------------------- // Dedicated worker and all manner of sub-resources are handled here. - void MaybeLoadSubResource(URLRequest* request); + void MaybeLoadSubResource(net::URLRequest* request); void ContinueMaybeLoadSubResource(); // AppCacheHost::Observer override diff --git a/webkit/appcache/appcache_url_request_job.h b/webkit/appcache/appcache_url_request_job.h index 8593ca1..8630815 100644 --- a/webkit/appcache/appcache_url_request_job.h +++ b/webkit/appcache/appcache_url_request_job.h @@ -17,10 +17,10 @@ namespace appcache { // A URLRequestJob derivative that knows how to return a response stored // in the appcache. -class AppCacheURLRequestJob : public URLRequestJob, +class AppCacheURLRequestJob : public net::URLRequestJob, public AppCacheStorage::Delegate { public: - explicit AppCacheURLRequestJob(URLRequest* request, + explicit AppCacheURLRequestJob(net::URLRequest* request, AppCacheStorage* storage); virtual ~AppCacheURLRequestJob(); diff --git a/webkit/appcache/view_appcache_internals_job.h b/webkit/appcache/view_appcache_internals_job.h index fee0801..0131da2 100644 --- a/webkit/appcache/view_appcache_internals_job.h +++ b/webkit/appcache/view_appcache_internals_job.h @@ -10,7 +10,9 @@ #include "net/url_request/url_request_simple_job.h" #include "webkit/appcache/appcache_service.h" +namespace net { class URLRequest; +} // namespace net namespace appcache { @@ -19,7 +21,7 @@ namespace appcache { class ViewAppCacheInternalsJob : public URLRequestSimpleJob { public: // Stores handle to appcache service for getting information. - ViewAppCacheInternalsJob(URLRequest* request, AppCacheService* service); + ViewAppCacheInternalsJob(net::URLRequest* request, AppCacheService* service); // Fetches the AppCache Info and calls StartAsync after it is done. virtual void Start(); diff --git a/webkit/blob/blob_url_request_job.h b/webkit/blob/blob_url_request_job.h index 8a859cc..53414cd 100644 --- a/webkit/blob/blob_url_request_job.h +++ b/webkit/blob/blob_url_request_job.h @@ -23,9 +23,9 @@ struct PlatformFileInfo; namespace webkit_blob { // A request job that handles reading blob URLs. -class BlobURLRequestJob : public URLRequestJob { +class BlobURLRequestJob : public net::URLRequestJob { public: - BlobURLRequestJob(URLRequest* request, + BlobURLRequestJob(net::URLRequest* request, BlobData* blob_data, base::MessageLoopProxy* resolving_message_loop_proxy); virtual ~BlobURLRequestJob(); diff --git a/webkit/blob/view_blob_internals_job.h b/webkit/blob/view_blob_internals_job.h index 0248153..913531c 100644 --- a/webkit/blob/view_blob_internals_job.h +++ b/webkit/blob/view_blob_internals_job.h @@ -9,7 +9,9 @@ #include "net/url_request/url_request_simple_job.h" +namespace net { class URLRequest; +} // namespace net namespace webkit_blob { @@ -20,7 +22,7 @@ class BlobStorageController; // state of blob registry. class ViewBlobInternalsJob : public URLRequestSimpleJob { public: - ViewBlobInternalsJob(URLRequest* request, + ViewBlobInternalsJob(net::URLRequest* request, BlobStorageController* blob_storage_controller); virtual void Start(); diff --git a/webkit/fileapi/file_system_operation.h b/webkit/fileapi/file_system_operation.h index 01e2da1..6614b5e 100644 --- a/webkit/fileapi/file_system_operation.h +++ b/webkit/fileapi/file_system_operation.h @@ -20,8 +20,11 @@ namespace base { class Time; } -class GURL; +namespace net { class URLRequest; +} // namespace net + +class GURL; class URLRequestContext; namespace fileapi { @@ -150,7 +153,7 @@ class FileSystemOperation { // These are all used only by Write(). friend class FileWriterDelegate; scoped_ptr<FileWriterDelegate> file_writer_delegate_; - scoped_ptr<URLRequest> blob_request_; + scoped_ptr<net::URLRequest> blob_request_; FileSystemOperation* cancel_operation_; DISALLOW_COPY_AND_ASSIGN(FileSystemOperation); diff --git a/webkit/tools/test_shell/simple_appcache_system.h b/webkit/tools/test_shell/simple_appcache_system.h index 79fb19f..f4e8b71 100644 --- a/webkit/tools/test_shell/simple_appcache_system.h +++ b/webkit/tools/test_shell/simple_appcache_system.h @@ -20,7 +20,11 @@ class WebApplicationCacheHostClient; } class SimpleBackendProxy; class SimpleFrontendProxy; + +namespace net { class URLRequest; +} // namespace net + class URLRequestContext; // A class that composes the constituent parts of an appcache system @@ -63,7 +67,7 @@ class SimpleAppCacheSystem { } // Called by SimpleResourceLoaderBridge to hook into resource loads. - static void SetExtraRequestInfo(URLRequest* request, + static void SetExtraRequestInfo(net::URLRequest* request, int host_id, ResourceType::Type resource_type) { if (instance_) @@ -71,9 +75,9 @@ class SimpleAppCacheSystem { } // Called by SimpleResourceLoaderBridge extract extra response bits. - static void GetExtraResponseInfo(URLRequest* request, - int64* cache_id, - GURL* manifest_url) { + static void GetExtraResponseInfo(net::URLRequest* request, + int64* cache_id, + GURL* manifest_url) { if (instance_) instance_->GetExtraResponseBits(request, cache_id, manifest_url); } @@ -116,10 +120,10 @@ class SimpleAppCacheSystem { void CleanupIOThread(); WebKit::WebApplicationCacheHost* CreateCacheHostForWebKit( WebKit::WebApplicationCacheHostClient* client); - void SetExtraRequestBits(URLRequest* request, + void SetExtraRequestBits(net::URLRequest* request, int host_id, ResourceType::Type resource_type); - void GetExtraResponseBits(URLRequest* request, + void GetExtraResponseBits(net::URLRequest* request, int64* cache_id, GURL* manifest_url); |