Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_NET_HTTP_INTERCEPT_JOB_FACTORY_H_ | |
| 6 #define CHROME_BROWSER_NET_HTTP_INTERCEPT_JOB_FACTORY_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "net/url_request/url_request_job_factory.h" | |
| 11 | |
| 12 class GURL; | |
| 13 | |
| 14 namespace net { | |
| 15 | |
| 16 class URLRequest; | |
| 17 class URLRequestJob; | |
| 18 | |
| 19 // This class acts as a wrapper for URLRequestJobFactory. It handles http and | |
|
erikwright (departed)
2012/08/22 19:29:37
nit: capitalize HTTP and HTTPS in this comment.
(
shalev
2012/08/22 20:04:00
Done.
| |
| 20 // https jobs using |protocol_handler_|, but forwards all other schemes to the | |
| 21 // old job factory to be handled there. | |
| 22 class HttpInterceptJobFactory : public URLRequestJobFactory { | |
| 23 public: | |
| 24 HttpInterceptJobFactory(const URLRequestJobFactory* job_factory, | |
| 25 ProtocolHandler* protocol_handler); | |
| 26 virtual ~HttpInterceptJobFactory(); | |
| 27 | |
| 28 // URLRequestJobFactory implementation | |
| 29 | |
|
erikwright (departed)
2012/08/22 19:29:37
nit: I think you can/should remove vertical whites
shalev
2012/08/22 20:04:00
Done.
| |
| 30 virtual bool SetProtocolHandler(const std::string& scheme, | |
| 31 ProtocolHandler* protocol_handler) OVERRIDE; | |
| 32 | |
| 33 virtual void AddInterceptor(Interceptor* interceptor) OVERRIDE; | |
| 34 | |
| 35 virtual URLRequestJob* MaybeCreateJobWithInterceptor( | |
| 36 URLRequest* request) const OVERRIDE; | |
| 37 | |
| 38 virtual URLRequestJob* MaybeCreateJobWithProtocolHandler( | |
| 39 const std::string& scheme, URLRequest* request) const OVERRIDE; | |
| 40 | |
| 41 virtual URLRequestJob* MaybeInterceptRedirect( | |
| 42 const GURL& location, URLRequest* request) const OVERRIDE; | |
| 43 | |
| 44 virtual URLRequestJob* MaybeInterceptResponse( | |
| 45 URLRequest* request) const OVERRIDE; | |
| 46 | |
| 47 virtual bool IsHandledProtocol(const std::string& scheme) const OVERRIDE; | |
| 48 | |
| 49 virtual bool IsHandledURL(const GURL& url) const OVERRIDE; | |
| 50 | |
| 51 private: | |
| 52 const URLRequestJobFactory* job_factory_; | |
| 53 ProtocolHandler* protocol_handler_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(HttpInterceptJobFactory); | |
| 56 }; | |
| 57 | |
| 58 } // namespace net | |
| 59 | |
| 60 #endif // CHROME_BROWSER_NET_HTTP_INTERCEPT_JOB_FACTORY_H_ | |
| OLD | NEW |