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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 // Returns true if the request is in the process of redirecting to a new | 524 // Returns true if the request is in the process of redirecting to a new |
525 // URL but has not yet initiated the new request. | 525 // URL but has not yet initiated the new request. |
526 bool is_redirecting() const { return is_redirecting_; } | 526 bool is_redirecting() const { return is_redirecting_; } |
527 | 527 |
528 // Returns the error status of the request. | 528 // Returns the error status of the request. |
529 const URLRequestStatus& status() const { return status_; } | 529 const URLRequestStatus& status() const { return status_; } |
530 | 530 |
531 // Returns a globally unique identifier for this request. | 531 // Returns a globally unique identifier for this request. |
532 uint64 identifier() const { return identifier_; } | 532 uint64 identifier() const { return identifier_; } |
533 | 533 |
| 534 // Returns true if the request has a network delegate that can throttle the |
| 535 // request. If the request has no network delegate, it will also return true. |
| 536 bool CanThrottle() const; |
| 537 |
534 // This method is called to start the request. The delegate will receive | 538 // This method is called to start the request. The delegate will receive |
535 // a OnResponseStarted callback when the request is started. | 539 // a OnResponseStarted callback when the request is started. |
536 void Start(); | 540 void Start(); |
537 | 541 |
538 // This method may be called at any time after Start() has been called to | 542 // This method may be called at any time after Start() has been called to |
539 // cancel the request. This method may be called many times, and it has | 543 // cancel the request. This method may be called many times, and it has |
540 // no effect once the response has completed. It is guaranteed that no | 544 // no effect once the response has completed. It is guaranteed that no |
541 // methods of the delegate will be called after the request has been | 545 // methods of the delegate will be called after the request has been |
542 // cancelled, except that this may call the delegate's OnReadCompleted() | 546 // cancelled, except that this may call the delegate's OnReadCompleted() |
543 // during the call to Cancel itself. | 547 // during the call to Cancel itself. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 void ContinueWithCertificate(X509Certificate* client_cert); | 605 void ContinueWithCertificate(X509Certificate* client_cert); |
602 | 606 |
603 // This method can be called after some error notifications to instruct this | 607 // This method can be called after some error notifications to instruct this |
604 // URLRequest to ignore the current error and continue with the request. To | 608 // URLRequest to ignore the current error and continue with the request. To |
605 // cancel the request instead, call Cancel(). | 609 // cancel the request instead, call Cancel(). |
606 void ContinueDespiteLastError(); | 610 void ContinueDespiteLastError(); |
607 | 611 |
608 // Used to specify the context (cookie store, cache) for this request. | 612 // Used to specify the context (cookie store, cache) for this request. |
609 const URLRequestContext* context() const; | 613 const URLRequestContext* context() const; |
610 | 614 |
| 615 // Used to access the network delegate for this request. |
| 616 NetworkDelegate* network_delegate() const; |
| 617 |
611 const BoundNetLog& net_log() const { return net_log_; } | 618 const BoundNetLog& net_log() const { return net_log_; } |
612 | 619 |
613 // Returns the expected content size if available | 620 // Returns the expected content size if available |
614 int64 GetExpectedContentSize() const; | 621 int64 GetExpectedContentSize() const; |
615 | 622 |
616 // Returns the priority level for this request. | 623 // Returns the priority level for this request. |
617 RequestPriority priority() const { return priority_; } | 624 RequestPriority priority() const { return priority_; } |
618 void set_priority(RequestPriority priority) { | 625 void set_priority(RequestPriority priority) { |
619 DCHECK_GE(priority, MINIMUM_PRIORITY); | 626 DCHECK_GE(priority, MINIMUM_PRIORITY); |
620 DCHECK_LT(priority, NUM_PRIORITIES); | 627 DCHECK_LT(priority, NUM_PRIORITIES); |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 LoadTimingInfo load_timing_info_; | 847 LoadTimingInfo load_timing_info_; |
841 | 848 |
842 scoped_ptr<const base::debug::StackTrace> stack_trace_; | 849 scoped_ptr<const base::debug::StackTrace> stack_trace_; |
843 | 850 |
844 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 851 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
845 }; | 852 }; |
846 | 853 |
847 } // namespace net | 854 } // namespace net |
848 | 855 |
849 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 856 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
OLD | NEW |