| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_JOB_FACTORY_IMPL_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ |
| 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 URLRequestJob* MaybeInterceptRedirect( | 37 URLRequestJob* MaybeInterceptRedirect( |
| 38 URLRequest* request, | 38 URLRequest* request, |
| 39 NetworkDelegate* network_delegate, | 39 NetworkDelegate* network_delegate, |
| 40 const GURL& location) const override; | 40 const GURL& location) const override; |
| 41 | 41 |
| 42 URLRequestJob* MaybeInterceptResponse( | 42 URLRequestJob* MaybeInterceptResponse( |
| 43 URLRequest* request, | 43 URLRequest* request, |
| 44 NetworkDelegate* network_delegate) const override; | 44 NetworkDelegate* network_delegate) const override; |
| 45 | 45 |
| 46 bool IsHandledProtocol(const std::string& scheme) const override; | 46 bool IsHandledProtocol(const std::string& scheme) const override; |
| 47 bool IsHandledURL(const GURL& url) const override; | |
| 48 bool IsSafeRedirectTarget(const GURL& location) const override; | 47 bool IsSafeRedirectTarget(const GURL& location) const override; |
| 49 | 48 |
| 50 private: | 49 private: |
| 51 // For testing only. | 50 // For testing only. |
| 52 friend class URLRequestFilter; | 51 friend class URLRequestFilter; |
| 53 | 52 |
| 54 typedef std::map<std::string, std::unique_ptr<ProtocolHandler>> | 53 typedef std::map<std::string, std::unique_ptr<ProtocolHandler>> |
| 55 ProtocolHandlerMap; | 54 ProtocolHandlerMap; |
| 56 | 55 |
| 57 // Sets a global URLRequestInterceptor for testing purposes. The interceptor | 56 // Sets a global URLRequestInterceptor for testing purposes. The interceptor |
| 58 // is given the chance to intercept any request before the corresponding | 57 // is given the chance to intercept any request before the corresponding |
| 59 // ProtocolHandler, but after any other URLRequestJobFactories layered on top | 58 // ProtocolHandler, but after any other URLRequestJobFactories layered on top |
| 60 // of the URLRequestJobFactoryImpl. | 59 // of the URLRequestJobFactoryImpl. |
| 61 // If an interceptor is set, the old interceptor must be cleared before | 60 // If an interceptor is set, the old interceptor must be cleared before |
| 62 // setting a new one. | 61 // setting a new one. |
| 63 static void SetInterceptorForTesting(URLRequestInterceptor* interceptor); | 62 static void SetInterceptorForTesting(URLRequestInterceptor* interceptor); |
| 64 | 63 |
| 65 ProtocolHandlerMap protocol_handler_map_; | 64 ProtocolHandlerMap protocol_handler_map_; |
| 66 | 65 |
| 67 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactoryImpl); | 66 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactoryImpl); |
| 68 }; | 67 }; |
| 69 | 68 |
| 70 } // namespace net | 69 } // namespace net |
| 71 | 70 |
| 72 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ | 71 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ |
| OLD | NEW |