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_URL_REQUEST_URL_REQUEST_H_ | 5 #ifndef NET_URL_REQUEST_URL_REQUEST_H_ |
6 #define NET_URL_REQUEST_URL_REQUEST_H_ | 6 #define NET_URL_REQUEST_URL_REQUEST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 // to Read() previously. | 301 // to Read() previously. |
302 // | 302 // |
303 // If an error occurred, request->status() will contain the error, | 303 // If an error occurred, request->status() will contain the error, |
304 // and bytes read will be -1. | 304 // and bytes read will be -1. |
305 virtual void OnReadCompleted(URLRequest* request, int bytes_read) = 0; | 305 virtual void OnReadCompleted(URLRequest* request, int bytes_read) = 0; |
306 | 306 |
307 protected: | 307 protected: |
308 virtual ~Delegate() {} | 308 virtual ~Delegate() {} |
309 }; | 309 }; |
310 | 310 |
311 // TODO(shalev): Get rid of this constructor in favour of the one below it. | |
312 // Initialize an URL request. | |
313 URLRequest(const GURL& url, | 311 URLRequest(const GURL& url, |
| 312 RequestPriority priority, |
314 Delegate* delegate, | 313 Delegate* delegate, |
315 const URLRequestContext* context); | 314 const URLRequestContext* context); |
316 | 315 |
317 URLRequest(const GURL& url, | |
318 Delegate* delegate, | |
319 const URLRequestContext* context, | |
320 NetworkDelegate* network_delegate); | |
321 | |
322 // If destroyed after Start() has been called but while IO is pending, | 316 // If destroyed after Start() has been called but while IO is pending, |
323 // then the request will be effectively canceled and the delegate | 317 // then the request will be effectively canceled and the delegate |
324 // will not have any more of its methods called. | 318 // will not have any more of its methods called. |
325 virtual ~URLRequest(); | 319 virtual ~URLRequest(); |
326 | 320 |
327 // Changes the default cookie policy from allowing all cookies to blocking all | 321 // Changes the default cookie policy from allowing all cookies to blocking all |
328 // cookies. Embedders that want to implement a more flexible policy should | 322 // cookies. Embedders that want to implement a more flexible policy should |
329 // change the default to blocking all cookies, and provide a NetworkDelegate | 323 // change the default to blocking all cookies, and provide a NetworkDelegate |
330 // with the URLRequestContext that maintains the CookieStore. | 324 // with the URLRequestContext that maintains the CookieStore. |
331 // The cookie policy default has to be set before the first URLRequest is | 325 // The cookie policy default has to be set before the first URLRequest is |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 LoadTimingInfo load_timing_info_; | 876 LoadTimingInfo load_timing_info_; |
883 | 877 |
884 scoped_ptr<const base::debug::StackTrace> stack_trace_; | 878 scoped_ptr<const base::debug::StackTrace> stack_trace_; |
885 | 879 |
886 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 880 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
887 }; | 881 }; |
888 | 882 |
889 } // namespace net | 883 } // namespace net |
890 | 884 |
891 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 885 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
OLD | NEW |