Chromium Code Reviews| Index: chrome/browser/net/http_intercept_job_factory.h |
| diff --git a/chrome/browser/net/http_intercept_job_factory.h b/chrome/browser/net/http_intercept_job_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cb8b01daf70684626483e0119c33c64a7f6946ee |
| --- /dev/null |
| +++ b/chrome/browser/net/http_intercept_job_factory.h |
| @@ -0,0 +1,52 @@ |
| +// 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. |
| + |
| +#ifndef CHROME_BROWSER_NET_HTTP_INTERCEPT_JOB_FACTORY_H_ |
| +#define CHROME_BROWSER_NET_HTTP_INTERCEPT_JOB_FACTORY_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "base/compiler_specific.h" |
| +#include "net/url_request/url_request_job_factory.h" |
| + |
| +class GURL; |
| + |
| +namespace net { |
| + |
| +class URLRequest; |
| +class URLRequestJob; |
| + |
| +// This class acts as a wrapper for URLRequestJobFactory. It handles HTTP and |
| +// HTTPS jobs using |protocol_handler_|, but forwards all other schemes to the |
| +// old job factory to be handled there. |
| +class HttpInterceptJobFactory : public URLRequestJobFactory { |
| + public: |
| + HttpInterceptJobFactory(const URLRequestJobFactory* job_factory, |
| + ProtocolHandler* protocol_handler); |
| + virtual ~HttpInterceptJobFactory(); |
| + |
| + // URLRequestJobFactory implementation |
| + virtual bool SetProtocolHandler(const std::string& scheme, |
| + ProtocolHandler* protocol_handler) OVERRIDE; |
|
mmenke
2012/08/23 15:00:21
nit: Fix indent.
shalev
2012/08/23 15:15:46
Done.
|
| + virtual void AddInterceptor(Interceptor* interceptor) OVERRIDE; |
| + virtual URLRequestJob* MaybeCreateJobWithInterceptor( |
| + URLRequest* request) const OVERRIDE; |
| + virtual URLRequestJob* MaybeCreateJobWithProtocolHandler( |
| + const std::string& scheme, URLRequest* request) const OVERRIDE; |
| + virtual URLRequestJob* MaybeInterceptRedirect( |
| + const GURL& location, URLRequest* request) const OVERRIDE; |
| + virtual URLRequestJob* MaybeInterceptResponse( |
| + URLRequest* request) const OVERRIDE; |
| + virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE; |
| + virtual bool IsHandledURL(const GURL& url) const OVERRIDE; |
| + |
| + private: |
| + const URLRequestJobFactory* job_factory_; |
| + ProtocolHandler* protocol_handler_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(HttpInterceptJobFactory); |
| +}; |
| + |
| +} // namespace net |
| + |
| +#endif // CHROME_BROWSER_NET_HTTP_INTERCEPT_JOB_FACTORY_H_ |