OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BASE_NETWORK_DELEGATE_H_ | 5 #ifndef NET_BASE_NETWORK_DELEGATE_H_ |
6 #define NET_BASE_NETWORK_DELEGATE_H_ | 6 #define NET_BASE_NETWORK_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
66 const CompletionCallback& callback, | 66 const CompletionCallback& callback, |
67 GURL* new_url); | 67 GURL* new_url); |
68 int NotifyBeforeSendHeaders(URLRequest* request, | 68 int NotifyBeforeSendHeaders(URLRequest* request, |
69 const CompletionCallback& callback, | 69 const CompletionCallback& callback, |
70 HttpRequestHeaders* headers); | 70 HttpRequestHeaders* headers); |
71 void NotifySendHeaders(URLRequest* request, | 71 void NotifySendHeaders(URLRequest* request, |
72 const HttpRequestHeaders& headers); | 72 const HttpRequestHeaders& headers); |
73 int NotifyHeadersReceived( | 73 int NotifyHeadersReceived( |
74 URLRequest* request, | 74 URLRequest* request, |
75 const CompletionCallback& callback, | 75 const CompletionCallback& callback, |
76 HttpResponseHeaders* original_response_headers, | 76 const HttpResponseHeaders* original_response_headers, |
jochen (gone - plz use gerrit)
2012/10/20 02:04:13
why are you making this a const ptr instead of a c
battre
2012/10/20 09:49:56
like for URLRequest, you are allowed to hold on to
| |
77 scoped_refptr<HttpResponseHeaders>* override_response_headers); | 77 scoped_refptr<HttpResponseHeaders>* override_response_headers); |
78 void NotifyBeforeRedirect(URLRequest* request, | 78 void NotifyBeforeRedirect(URLRequest* request, |
79 const GURL& new_location); | 79 const GURL& new_location); |
80 void NotifyResponseStarted(URLRequest* request); | 80 void NotifyResponseStarted(URLRequest* request); |
81 void NotifyRawBytesRead(const URLRequest& request, int bytes_read); | 81 void NotifyRawBytesRead(const URLRequest& request, int bytes_read); |
82 void NotifyCompleted(URLRequest* request, bool started); | 82 void NotifyCompleted(URLRequest* request, bool started); |
83 void NotifyURLRequestDestroyed(URLRequest* request); | 83 void NotifyURLRequestDestroyed(URLRequest* request); |
84 void NotifyPACScriptError(int line_number, const string16& error); | 84 void NotifyPACScriptError(int line_number, const string16& error); |
85 AuthRequiredResponse NotifyAuthRequired(URLRequest* request, | 85 AuthRequiredResponse NotifyAuthRequired(URLRequest* request, |
86 const AuthChallengeInfo& auth_info, | 86 const AuthChallengeInfo& auth_info, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 // the reason. | 139 // the reason. |
140 // |original_response_headers| contains the headers as received over the | 140 // |original_response_headers| contains the headers as received over the |
141 // network, these must not be modified. |override_response_headers| can be set | 141 // network, these must not be modified. |override_response_headers| can be set |
142 // to new values, that should be considered as overriding | 142 // to new values, that should be considered as overriding |
143 // |original_response_headers|. | 143 // |original_response_headers|. |
144 // |callback|, |original_response_headers|, and |override_response_headers| | 144 // |callback|, |original_response_headers|, and |override_response_headers| |
145 // are only valid until OnURLRequestDestroyed is called for this request. | 145 // are only valid until OnURLRequestDestroyed is called for this request. |
146 virtual int OnHeadersReceived( | 146 virtual int OnHeadersReceived( |
147 URLRequest* request, | 147 URLRequest* request, |
148 const CompletionCallback& callback, | 148 const CompletionCallback& callback, |
149 HttpResponseHeaders* original_response_headers, | 149 const HttpResponseHeaders* original_response_headers, |
150 scoped_refptr<HttpResponseHeaders>* override_response_headers) = 0; | 150 scoped_refptr<HttpResponseHeaders>* override_response_headers) = 0; |
151 | 151 |
152 // Called right after a redirect response code was received. | 152 // Called right after a redirect response code was received. |
153 // |new_location| is only valid until OnURLRequestDestroyed is called for this | 153 // |new_location| is only valid until OnURLRequestDestroyed is called for this |
154 // request. | 154 // request. |
155 virtual void OnBeforeRedirect(URLRequest* request, | 155 virtual void OnBeforeRedirect(URLRequest* request, |
156 const GURL& new_location) = 0; | 156 const GURL& new_location) = 0; |
157 | 157 |
158 // This corresponds to URLRequestDelegate::OnResponseStarted. | 158 // This corresponds to URLRequestDelegate::OnResponseStarted. |
159 virtual void OnResponseStarted(URLRequest* request) = 0; | 159 virtual void OnResponseStarted(URLRequest* request) = 0; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
230 // action or a network action, or when that is no longer the case. | 230 // action or a network action, or when that is no longer the case. |
231 // REQUEST_WAIT_STATE_RESET indicates for a given URLRequest | 231 // REQUEST_WAIT_STATE_RESET indicates for a given URLRequest |
232 // cancellation of any pending waits for this request. | 232 // cancellation of any pending waits for this request. |
233 virtual void OnRequestWaitStateChange(const URLRequest& request, | 233 virtual void OnRequestWaitStateChange(const URLRequest& request, |
234 RequestWaitState state) = 0; | 234 RequestWaitState state) = 0; |
235 }; | 235 }; |
236 | 236 |
237 } // namespace net | 237 } // namespace net |
238 | 238 |
239 #endif // NET_BASE_NETWORK_DELEGATE_H_ | 239 #endif // NET_BASE_NETWORK_DELEGATE_H_ |
OLD | NEW |