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 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // job if it should be intercepted, or NULL to allow the normal handling to | 55 // job if it should be intercepted, or NULL to allow the normal handling to |
56 // continue. If a new job is provided, the delegate never sees the original | 56 // continue. If a new job is provided, the delegate never sees the original |
57 // response, instead the response produced by the intercept job will be | 57 // response, instead the response produced by the intercept job will be |
58 // returned. | 58 // returned. |
59 virtual URLRequestJob* MaybeInterceptResponse( | 59 virtual URLRequestJob* MaybeInterceptResponse( |
60 URLRequest* request) const = 0; | 60 URLRequest* request) const = 0; |
61 | 61 |
62 // Returns true if this interceptor handles requests for URLs with the | 62 // Returns true if this interceptor handles requests for URLs with the |
63 // given protocol. Returning false does not imply that this interceptor | 63 // given protocol. Returning false does not imply that this interceptor |
64 // can't or won't handle requests with the given protocol. | 64 // can't or won't handle requests with the given protocol. |
65 virtual bool WillHandleProtocol(const std::string& protocol) const { | 65 virtual bool WillHandleProtocol(const std::string& protocol) const; |
66 return false; | |
67 } | |
68 }; | 66 }; |
69 | 67 |
70 URLRequestJobFactory(); | 68 URLRequestJobFactory(); |
71 ~URLRequestJobFactory(); | 69 ~URLRequestJobFactory(); |
72 | 70 |
73 // Sets the ProtocolHandler for a scheme. Returns true on success, false on | 71 // Sets the ProtocolHandler for a scheme. Returns true on success, false on |
74 // failure (a ProtocolHandler already exists for |scheme|). On success, | 72 // failure (a ProtocolHandler already exists for |scheme|). On success, |
75 // URLRequestJobFactory takes ownership of |protocol_handler|. | 73 // URLRequestJobFactory takes ownership of |protocol_handler|. |
76 bool SetProtocolHandler(const std::string& scheme, | 74 bool SetProtocolHandler(const std::string& scheme, |
77 ProtocolHandler* protocol_handler); | 75 ProtocolHandler* protocol_handler); |
(...skipping 22 matching lines...) Expand all Loading... |
100 | 98 |
101 ProtocolHandlerMap protocol_handler_map_; | 99 ProtocolHandlerMap protocol_handler_map_; |
102 InterceptorList interceptors_; | 100 InterceptorList interceptors_; |
103 | 101 |
104 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory); | 102 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory); |
105 }; | 103 }; |
106 | 104 |
107 } // namespace net | 105 } // namespace net |
108 | 106 |
109 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ | 107 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ |
OLD | NEW |