| 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, |
| 314 Delegate* delegate, | 312 RequestPriority priority, |
| 315 const URLRequestContext* context); | |
| 316 | |
| 317 URLRequest(const GURL& url, | |
| 318 Delegate* delegate, | 313 Delegate* delegate, |
| 319 const URLRequestContext* context, | 314 const URLRequestContext* context, |
| 320 NetworkDelegate* network_delegate); | 315 NetworkDelegate* network_delegate); |
| 321 | 316 |
| 322 // If destroyed after Start() has been called but while IO is pending, | 317 // If destroyed after Start() has been called but while IO is pending, |
| 323 // then the request will be effectively canceled and the delegate | 318 // then the request will be effectively canceled and the delegate |
| 324 // will not have any more of its methods called. | 319 // will not have any more of its methods called. |
| 325 virtual ~URLRequest(); | 320 virtual ~URLRequest(); |
| 326 | 321 |
| 327 // Changes the default cookie policy from allowing all cookies to blocking all | 322 // Changes the default cookie policy from allowing all cookies to blocking all |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 LoadTimingInfo load_timing_info_; | 877 LoadTimingInfo load_timing_info_; |
| 883 | 878 |
| 884 scoped_ptr<const base::debug::StackTrace> stack_trace_; | 879 scoped_ptr<const base::debug::StackTrace> stack_trace_; |
| 885 | 880 |
| 886 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 881 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
| 887 }; | 882 }; |
| 888 | 883 |
| 889 } // namespace net | 884 } // namespace net |
| 890 | 885 |
| 891 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 886 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
| OLD | NEW |