OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
erikwright (departed)
2012/10/22 13:13:31
No good deed goes unpunished: new policy is to not
| |
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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 | 67 |
68 // Returns true if this interceptor handles requests for URLs with the | 68 // Returns true if this interceptor handles requests for URLs with the |
69 // given protocol. Returning false does not imply that this interceptor | 69 // given protocol. Returning false does not imply that this interceptor |
70 // can't or won't handle requests with the given protocol. | 70 // can't or won't handle requests with the given protocol. |
71 virtual bool WillHandleProtocol(const std::string& protocol) const; | 71 virtual bool WillHandleProtocol(const std::string& protocol) const; |
72 }; | 72 }; |
73 | 73 |
74 URLRequestJobFactory(); | 74 URLRequestJobFactory(); |
75 virtual ~URLRequestJobFactory(); | 75 virtual ~URLRequestJobFactory(); |
76 | 76 |
77 // TODO(shalev): Remove this from the interface. | |
78 // Sets the ProtocolHandler for a scheme. Returns true on success, false on | |
79 // failure (a ProtocolHandler already exists for |scheme|). On success, | |
80 // URLRequestJobFactory takes ownership of |protocol_handler|. | |
81 virtual bool SetProtocolHandler(const std::string& scheme, | |
82 ProtocolHandler* protocol_handler) = 0; | |
83 | |
84 // TODO(shalev): Remove this from the interface. | |
85 // Takes ownership of |interceptor|. Adds it to the end of the Interceptor | |
86 // list. | |
87 virtual void AddInterceptor(Interceptor* interceptor) = 0; | |
88 | |
89 // TODO(shalev): Consolidate MaybeCreateJobWithInterceptor and | 77 // TODO(shalev): Consolidate MaybeCreateJobWithInterceptor and |
90 // MaybeCreateJobWithProtocolHandler into a single method. | 78 // MaybeCreateJobWithProtocolHandler into a single method. |
91 virtual URLRequestJob* MaybeCreateJobWithInterceptor( | 79 virtual URLRequestJob* MaybeCreateJobWithInterceptor( |
92 URLRequest* request, NetworkDelegate* network_delegate) const = 0; | 80 URLRequest* request, NetworkDelegate* network_delegate) const = 0; |
93 | 81 |
94 virtual URLRequestJob* MaybeCreateJobWithProtocolHandler( | 82 virtual URLRequestJob* MaybeCreateJobWithProtocolHandler( |
95 const std::string& scheme, | 83 const std::string& scheme, |
96 URLRequest* request, | 84 URLRequest* request, |
97 NetworkDelegate* network_delegate) const = 0; | 85 NetworkDelegate* network_delegate) const = 0; |
98 | 86 |
99 virtual URLRequestJob* MaybeInterceptRedirect( | 87 virtual URLRequestJob* MaybeInterceptRedirect( |
100 const GURL& location, | 88 const GURL& location, |
101 URLRequest* request, | 89 URLRequest* request, |
102 NetworkDelegate* network_delegate) const = 0; | 90 NetworkDelegate* network_delegate) const = 0; |
103 | 91 |
104 virtual URLRequestJob* MaybeInterceptResponse( | 92 virtual URLRequestJob* MaybeInterceptResponse( |
105 URLRequest* request, NetworkDelegate* network_delegate) const = 0; | 93 URLRequest* request, NetworkDelegate* network_delegate) const = 0; |
106 | 94 |
107 virtual bool IsHandledProtocol(const std::string& scheme) const = 0; | 95 virtual bool IsHandledProtocol(const std::string& scheme) const = 0; |
108 | 96 |
109 virtual bool IsHandledURL(const GURL& url) const = 0; | 97 virtual bool IsHandledURL(const GURL& url) const = 0; |
110 | 98 |
111 private: | 99 private: |
112 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory); | 100 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory); |
113 }; | 101 }; |
114 | 102 |
115 } // namespace net | 103 } // namespace net |
116 | 104 |
117 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ | 105 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_ |
OLD | NEW |