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_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 // Takes ownership of |interceptor|. Adds it to the end of the Interceptor | 80 // Takes ownership of |interceptor|. Adds it to the end of the Interceptor |
81 // list. | 81 // list. |
82 void AddInterceptor(Interceptor* interceptor); | 82 void AddInterceptor(Interceptor* interceptor); |
83 | 83 |
84 URLRequestJob* MaybeCreateJobWithInterceptor(URLRequest* request) const; | 84 URLRequestJob* MaybeCreateJobWithInterceptor(URLRequest* request) const; |
85 | 85 |
86 URLRequestJob* MaybeCreateJobWithProtocolHandler(const std::string& scheme, | 86 URLRequestJob* MaybeCreateJobWithProtocolHandler(const std::string& scheme, |
87 URLRequest* request) const; | 87 URLRequest* request) const; |
88 | 88 |
89 URLRequestJob* MaybeInterceptRedirect(const GURL& location, | |
90 URLRequest* request) const; | |
91 | |
92 URLRequestJob* MaybeInterceptResponse(URLRequest* request) const; | |
93 | |
94 bool IsHandledProtocol(const std::string& scheme) const; | 89 bool IsHandledProtocol(const std::string& scheme) const; |
95 | 90 |
96 bool IsHandledURL(const GURL& url) const; | 91 bool IsHandledURL(const GURL& url) const; |
97 | 92 |
98 private: | 93 private: |
99 typedef std::map<std::string, ProtocolHandler*> ProtocolHandlerMap; | 94 typedef std::map<std::string, ProtocolHandler*> ProtocolHandlerMap; |
100 typedef std::vector<Interceptor*> InterceptorList; | 95 typedef std::vector<Interceptor*> InterceptorList; |
101 | 96 |
102 ProtocolHandlerMap protocol_handler_map_; | 97 ProtocolHandlerMap protocol_handler_map_; |
103 InterceptorList interceptors_; | 98 InterceptorList interceptors_; |
104 | 99 |
105 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory); | 100 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory); |
106 }; | 101 }; |
107 | 102 |
108 } // namespace net | 103 } // namespace net |
109 | 104 |
110 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ | 105 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ |
OLD | NEW |