| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_URL_REQUEST_URL_REQUEST_INTERCEPTING_JOB_FACTORY_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_INTERCEPTING_JOB_FACTORY_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_INTERCEPTING_JOB_FACTORY_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_INTERCEPTING_JOB_FACTORY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // | 28 // |
| 29 // This class is only intended for use in intercepting requests before they | 29 // This class is only intended for use in intercepting requests before they |
| 30 // are passed on to their default ProtocolHandler. Each supported scheme should | 30 // are passed on to their default ProtocolHandler. Each supported scheme should |
| 31 // have its own ProtocolHandler. | 31 // have its own ProtocolHandler. |
| 32 class NET_EXPORT URLRequestInterceptingJobFactory | 32 class NET_EXPORT URLRequestInterceptingJobFactory |
| 33 : public URLRequestJobFactory { | 33 : public URLRequestJobFactory { |
| 34 public: | 34 public: |
| 35 URLRequestInterceptingJobFactory( | 35 URLRequestInterceptingJobFactory( |
| 36 scoped_ptr<URLRequestJobFactory> job_factory, | 36 scoped_ptr<URLRequestJobFactory> job_factory, |
| 37 scoped_ptr<URLRequestInterceptor> interceptor); | 37 scoped_ptr<URLRequestInterceptor> interceptor); |
| 38 virtual ~URLRequestInterceptingJobFactory(); | 38 ~URLRequestInterceptingJobFactory() override; |
| 39 | 39 |
| 40 // URLRequestJobFactory implementation | 40 // URLRequestJobFactory implementation |
| 41 virtual URLRequestJob* MaybeCreateJobWithProtocolHandler( | 41 URLRequestJob* MaybeCreateJobWithProtocolHandler( |
| 42 const std::string& scheme, | 42 const std::string& scheme, |
| 43 URLRequest* request, | 43 URLRequest* request, |
| 44 NetworkDelegate* network_delegate) const override; | 44 NetworkDelegate* network_delegate) const override; |
| 45 virtual bool IsHandledProtocol(const std::string& scheme) const override; | 45 bool IsHandledProtocol(const std::string& scheme) const override; |
| 46 virtual bool IsHandledURL(const GURL& url) const override; | 46 bool IsHandledURL(const GURL& url) const override; |
| 47 virtual bool IsSafeRedirectTarget(const GURL& location) const override; | 47 bool IsSafeRedirectTarget(const GURL& location) const override; |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 scoped_ptr<URLRequestJobFactory> job_factory_; | 50 scoped_ptr<URLRequestJobFactory> job_factory_; |
| 51 scoped_ptr<URLRequestInterceptor> interceptor_; | 51 scoped_ptr<URLRequestInterceptor> interceptor_; |
| 52 | 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(URLRequestInterceptingJobFactory); | 53 DISALLOW_COPY_AND_ASSIGN(URLRequestInterceptingJobFactory); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 } // namespace net | 56 } // namespace net |
| 57 | 57 |
| 58 #endif // NET_URL_REQUEST_URL_REQUEST_INTERCEPTING_JOB_FACTORY_H_ | 58 #endif // NET_URL_REQUEST_URL_REQUEST_INTERCEPTING_JOB_FACTORY_H_ |
| OLD | NEW |