Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(903)

Unified Diff: net/url_request/url_request_job_factory.h

Issue 10836248: Turned job_factory into a pure virtual class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest merge Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/proxy/proxy_script_fetcher_impl_unittest.cc ('k') | net/url_request/url_request_job_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5f4e1ae3f6727758c571a1d23fe5dbc74fc01a06..adff7f1d818ef46c679d2b93d53aa6dbe503feeb 100644
--- a/net/url_request/url_request_job_factory.h
+++ b/net/url_request/url_request_job_factory.h
@@ -5,10 +5,10 @@
#ifndef NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_
#define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_
-#include <map>
#include <string>
-#include <vector>
+
#include "base/basictypes.h"
+#include "base/compiler_specific.h"
#include "base/threading/non_thread_safe.h"
#include "net/base/net_export.h"
@@ -23,6 +23,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();
@@ -31,6 +32,7 @@ class NET_EXPORT URLRequestJobFactory
URLRequest* request, NetworkDelegate* network_delegate) const = 0;
};
+ // TODO(shalev): Move this to URLRequestJobFactoryImpl.
class NET_EXPORT Interceptor {
public:
virtual ~Interceptor();
@@ -70,45 +72,43 @@ 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, NetworkDelegate* network_delegate) const;
+ // TODO(shalev): Consolidate MaybeCreateJobWithInterceptor and
+ // MaybeCreateJobWithProtocolHandler into a single method.
+ virtual URLRequestJob* MaybeCreateJobWithInterceptor(
+ URLRequest* request, NetworkDelegate* network_delegate) const = 0;
- URLRequestJob* MaybeCreateJobWithProtocolHandler(
+ virtual URLRequestJob* MaybeCreateJobWithProtocolHandler(
const std::string& scheme,
URLRequest* request,
- NetworkDelegate* network_delegate) const;
+ NetworkDelegate* network_delegate) const = 0;
- URLRequestJob* MaybeInterceptRedirect(
+ virtual URLRequestJob* MaybeInterceptRedirect(
const GURL& location,
URLRequest* request,
- NetworkDelegate* network_delegate) const;
+ NetworkDelegate* network_delegate) const = 0;
- URLRequestJob* MaybeInterceptResponse(
- URLRequest* request, NetworkDelegate* network_delegate) const;
+ virtual URLRequestJob* MaybeInterceptResponse(
+ URLRequest* request, NetworkDelegate* network_delegate) 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);
};
« no previous file with comments | « net/proxy/proxy_script_fetcher_impl_unittest.cc ('k') | net/url_request/url_request_job_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698