Chromium Code Reviews| Index: net/url_request/url_request_job_factory.h |
| diff --git a/net/url_request/url_request_job_factory.h b/net/url_request/url_request_job_factory.h |
| index 746e9486894546b36f8d9fb20a5ffdaec8109bb7..a0d98fe9ba2c9a0e7852c17a5f90eb2276c3322b 100644 |
| --- a/net/url_request/url_request_job_factory.h |
| +++ b/net/url_request/url_request_job_factory.h |
| @@ -5,10 +5,9 @@ |
| #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ |
| #define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ |
| -#include <map> |
| #include <string> |
|
mmenke
2012/08/23 15:00:21
While you're here, could you add a blank line afte
shalev
2012/08/23 15:15:46
Done.
|
| -#include <vector> |
| #include "base/basictypes.h" |
| +#include "base/compiler_specific.h" |
| #include "base/threading/non_thread_safe.h" |
| #include "net/base/net_export.h" |
| @@ -22,6 +21,7 @@ class URLRequestJob; |
| class NET_EXPORT URLRequestJobFactory |
| : NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| public: |
| + // TODO(shalev): Move this to URLRequestJobFactoryImpl. |
| class NET_EXPORT ProtocolHandler { |
| public: |
| virtual ~ProtocolHandler(); |
| @@ -29,6 +29,7 @@ class NET_EXPORT URLRequestJobFactory |
| virtual URLRequestJob* MaybeCreateJob(URLRequest* request) const = 0; |
| }; |
| + // TODO(shalev): Move this to URLRequestJobFactoryImpl. |
| class NET_EXPORT Interceptor { |
| public: |
| virtual ~Interceptor(); |
| @@ -66,39 +67,38 @@ class NET_EXPORT URLRequestJobFactory |
| }; |
| URLRequestJobFactory(); |
| - ~URLRequestJobFactory(); |
| + virtual ~URLRequestJobFactory(); |
| + // TODO(shalev): Remove this from the interface. |
| // Sets the ProtocolHandler for a scheme. Returns true on success, false on |
| // failure (a ProtocolHandler already exists for |scheme|). On success, |
| // URLRequestJobFactory takes ownership of |protocol_handler|. |
| - bool SetProtocolHandler(const std::string& scheme, |
| - ProtocolHandler* protocol_handler); |
| + virtual bool SetProtocolHandler(const std::string& scheme, |
| + ProtocolHandler* protocol_handler) = 0; |
| + // TODO(shalev): Remove this from the interface. |
| // Takes ownership of |interceptor|. Adds it to the end of the Interceptor |
| // list. |
| - void AddInterceptor(Interceptor* interceptor); |
| + virtual void AddInterceptor(Interceptor* interceptor) = 0; |
| - URLRequestJob* MaybeCreateJobWithInterceptor(URLRequest* request) const; |
| + // TODO(shalev): Consolidate MaybeCreateJobWithInterceptor and |
| + // MaybeCreateJobWithProtocolHandler into a single method. |
| + virtual URLRequestJob* MaybeCreateJobWithInterceptor( |
| + URLRequest* request) const = 0; |
| - URLRequestJob* MaybeCreateJobWithProtocolHandler(const std::string& scheme, |
| - URLRequest* request) const; |
| + virtual URLRequestJob* MaybeCreateJobWithProtocolHandler( |
| + const std::string& scheme, URLRequest* request) const = 0; |
| - URLRequestJob* MaybeInterceptRedirect(const GURL& location, |
| - URLRequest* request) const; |
| + virtual URLRequestJob* MaybeInterceptRedirect( |
| + const GURL& location, URLRequest* request) const = 0; |
| - URLRequestJob* MaybeInterceptResponse(URLRequest* request) const; |
| + virtual URLRequestJob* MaybeInterceptResponse(URLRequest* request) const = 0; |
| - bool IsHandledProtocol(const std::string& scheme) const; |
| + virtual bool IsHandledProtocol(const std::string& scheme) const = 0; |
| - bool IsHandledURL(const GURL& url) const; |
| + virtual bool IsHandledURL(const GURL& url) const = 0; |
| private: |
| - typedef std::map<std::string, ProtocolHandler*> ProtocolHandlerMap; |
| - typedef std::vector<Interceptor*> InterceptorList; |
| - |
| - ProtocolHandlerMap protocol_handler_map_; |
| - InterceptorList interceptors_; |
| - |
| DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory); |
| }; |