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 #include "net/base/network_delegate.h" | 5 #include "net/base/network_delegate.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "net/base/load_flags.h" | 8 #include "net/base/load_flags.h" |
9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
10 #include "net/proxy/proxy_info.h" | 10 #include "net/proxy/proxy_info.h" |
11 #include "net/url_request/url_request.h" | 11 #include "net/url_request/url_request.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 int NetworkDelegate::NotifyBeforeURLRequest( | 15 int NetworkDelegate::NotifyBeforeURLRequest( |
16 URLRequest* request, const CompletionCallback& callback, | 16 URLRequest* request, const CompletionCallback& callback, |
17 GURL* new_url) { | 17 GURL* new_url) { |
18 DCHECK(CalledOnValidThread()); | 18 DCHECK(CalledOnValidThread()); |
19 DCHECK(request); | 19 DCHECK(request); |
20 DCHECK(!callback.is_null()); | 20 DCHECK(!callback.is_null()); |
21 return OnBeforeURLRequest(request, callback, new_url); | 21 return OnBeforeURLRequest(request, callback, new_url); |
22 } | 22 } |
23 | 23 |
| 24 void NetworkDelegate::NotifyResolveProxy(const GURL& url, int load_flags, |
| 25 ProxyInfo* result) { |
| 26 DCHECK(CalledOnValidThread()); |
| 27 DCHECK(result); |
| 28 OnResolveProxy(url, load_flags, result); |
| 29 } |
| 30 |
24 int NetworkDelegate::NotifyBeforeSendHeaders( | 31 int NetworkDelegate::NotifyBeforeSendHeaders( |
25 URLRequest* request, const CompletionCallback& callback, | 32 URLRequest* request, const CompletionCallback& callback, |
26 HttpRequestHeaders* headers) { | 33 HttpRequestHeaders* headers) { |
27 DCHECK(CalledOnValidThread()); | 34 DCHECK(CalledOnValidThread()); |
28 DCHECK(headers); | 35 DCHECK(headers); |
29 DCHECK(!callback.is_null()); | 36 DCHECK(!callback.is_null()); |
30 return OnBeforeSendHeaders(request, callback, headers); | 37 return OnBeforeSendHeaders(request, callback, headers); |
31 } | 38 } |
32 | 39 |
33 void NetworkDelegate::NotifyBeforeSendProxyHeaders( | 40 void NetworkDelegate::NotifyBeforeSendProxyHeaders( |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 DCHECK(CalledOnValidThread()); | 155 DCHECK(CalledOnValidThread()); |
149 return OnCanEnablePrivacyMode(url, first_party_for_cookies); | 156 return OnCanEnablePrivacyMode(url, first_party_for_cookies); |
150 } | 157 } |
151 | 158 |
152 int NetworkDelegate::OnBeforeURLRequest(URLRequest* request, | 159 int NetworkDelegate::OnBeforeURLRequest(URLRequest* request, |
153 const CompletionCallback& callback, | 160 const CompletionCallback& callback, |
154 GURL* new_url) { | 161 GURL* new_url) { |
155 return OK; | 162 return OK; |
156 } | 163 } |
157 | 164 |
| 165 void NetworkDelegate::OnResolveProxy(const GURL& url, int load_flags, |
| 166 ProxyInfo* result) { |
| 167 } |
| 168 |
158 int NetworkDelegate::OnBeforeSendHeaders(URLRequest* request, | 169 int NetworkDelegate::OnBeforeSendHeaders(URLRequest* request, |
159 const CompletionCallback& callback, | 170 const CompletionCallback& callback, |
160 HttpRequestHeaders* headers) { | 171 HttpRequestHeaders* headers) { |
161 return OK; | 172 return OK; |
162 } | 173 } |
163 | 174 |
164 void NetworkDelegate::OnBeforeSendProxyHeaders( | 175 void NetworkDelegate::OnBeforeSendProxyHeaders( |
165 URLRequest* request, | 176 URLRequest* request, |
166 const ProxyInfo& proxy_info, | 177 const ProxyInfo& proxy_info, |
167 HttpRequestHeaders* headers) { | 178 HttpRequestHeaders* headers) { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 return false; | 246 return false; |
236 } | 247 } |
237 | 248 |
238 int NetworkDelegate::OnBeforeSocketStreamConnect( | 249 int NetworkDelegate::OnBeforeSocketStreamConnect( |
239 SocketStream* socket, | 250 SocketStream* socket, |
240 const CompletionCallback& callback) { | 251 const CompletionCallback& callback) { |
241 return OK; | 252 return OK; |
242 } | 253 } |
243 | 254 |
244 } // namespace net | 255 } // namespace net |
OLD | NEW |