Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 // Temporary layering violation to allow existing users of a deprecated | 43 // Temporary layering violation to allow existing users of a deprecated |
| 44 // interface. | 44 // interface. |
| 45 namespace appcache { | 45 namespace appcache { |
| 46 class AppCacheInterceptor; | 46 class AppCacheInterceptor; |
| 47 class AppCacheRequestHandlerTest; | 47 class AppCacheRequestHandlerTest; |
| 48 class AppCacheURLRequestJobTest; | 48 class AppCacheURLRequestJobTest; |
| 49 } | 49 } |
| 50 | 50 |
| 51 namespace base { | 51 namespace base { |
| 52 class Time; | 52 class Time; |
| 53 class TimeTicks; | |
|
wtc
2011/12/06 21:00:53
Since the URLRequest class contains a base::TimeTi
James Simonsen
2011/12/10 00:21:47
Done.
| |
| 53 } // namespace base | 54 } // namespace base |
| 54 | 55 |
| 55 // Temporary layering violation to allow existing users of a deprecated | 56 // Temporary layering violation to allow existing users of a deprecated |
| 56 // interface. | 57 // interface. |
| 57 namespace fileapi { | 58 namespace fileapi { |
| 58 class FileSystemDirURLRequestJobTest; | 59 class FileSystemDirURLRequestJobTest; |
| 59 class FileSystemOperationWriteTest; | 60 class FileSystemOperationWriteTest; |
| 60 class FileSystemURLRequestJobTest; | 61 class FileSystemURLRequestJobTest; |
| 61 class FileWriterDelegateTest; | 62 class FileWriterDelegateTest; |
| 62 } | 63 } |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 453 void GetResponseHeaderByName(const std::string& name, std::string* value); | 454 void GetResponseHeaderByName(const std::string& name, std::string* value); |
| 454 | 455 |
| 455 // Get all response headers, \n-delimited and \n\0-terminated. This includes | 456 // Get all response headers, \n-delimited and \n\0-terminated. This includes |
| 456 // the response status line. Restrictions on GetResponseHeaders apply. | 457 // the response status line. Restrictions on GetResponseHeaders apply. |
| 457 void GetAllResponseHeaders(std::string* headers); | 458 void GetAllResponseHeaders(std::string* headers); |
| 458 | 459 |
| 459 // The time at which the returned response was requested. For cached | 460 // The time at which the returned response was requested. For cached |
| 460 // responses, this is the last time the cache entry was validated. | 461 // responses, this is the last time the cache entry was validated. |
| 461 const base::Time& request_time() const { | 462 const base::Time& request_time() const { |
| 462 return response_info_.request_time; | 463 return response_info_.request_time; |
| 463 } | 464 } |
|
wtc
2011/12/06 21:00:53
I highly recommend that you declare the new start_
James Simonsen
2011/12/10 00:21:47
Done.
| |
| 464 | 465 |
| 465 // The time at which the returned response was generated. For cached | 466 // The time at which the returned response was generated. For cached |
| 466 // responses, this is the last time the cache entry was validated. | 467 // responses, this is the last time the cache entry was validated. |
| 467 const base::Time& response_time() const { | 468 const base::Time& response_time() const { |
| 468 return response_info_.response_time; | 469 return response_info_.response_time; |
| 469 } | 470 } |
| 470 | 471 |
| 471 // Indicate if this response was fetched from disk cache. | 472 // Indicate if this response was fetched from disk cache. |
| 472 bool was_cached() const { return response_info_.was_cached; } | 473 bool was_cached() const { return response_info_.was_cached; } |
| 473 | 474 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 625 void set_priority(RequestPriority priority) { | 626 void set_priority(RequestPriority priority) { |
| 626 DCHECK_GE(priority, HIGHEST); | 627 DCHECK_GE(priority, HIGHEST); |
| 627 DCHECK_LT(priority, NUM_PRIORITIES); | 628 DCHECK_LT(priority, NUM_PRIORITIES); |
| 628 priority_ = priority; | 629 priority_ = priority; |
| 629 } | 630 } |
| 630 | 631 |
| 631 // This method is intended only for unit tests, but it is being used by | 632 // This method is intended only for unit tests, but it is being used by |
| 632 // unit tests outside of net :(. | 633 // unit tests outside of net :(. |
| 633 URLRequestJob* job() { return job_; } | 634 URLRequestJob* job() { return job_; } |
| 634 | 635 |
| 636 base::TimeTicks start_time() const { return start_time_; } | |
| 637 | |
| 635 protected: | 638 protected: |
| 636 // Allow the URLRequestJob class to control the is_pending() flag. | 639 // Allow the URLRequestJob class to control the is_pending() flag. |
| 637 void set_is_pending(bool value) { is_pending_ = value; } | 640 void set_is_pending(bool value) { is_pending_ = value; } |
| 638 | 641 |
| 639 // Allow the URLRequestJob class to set our status too | 642 // Allow the URLRequestJob class to set our status too |
| 640 void set_status(const URLRequestStatus& value) { status_ = value; } | 643 void set_status(const URLRequestStatus& value) { status_ = value; } |
| 641 | 644 |
| 642 // Allow the URLRequestJob to redirect this request. Returns OK if | 645 // Allow the URLRequestJob to redirect this request. Returns OK if |
| 643 // successful, otherwise an error code is returned. | 646 // successful, otherwise an error code is returned. |
| 644 int Redirect(const GURL& location, int http_status_code); | 647 int Redirect(const GURL& location, int http_status_code); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 807 // TODO(battre): Remove this. http://crbug.com/89049 | 810 // TODO(battre): Remove this. http://crbug.com/89049 |
| 808 bool has_notified_completion_; | 811 bool has_notified_completion_; |
| 809 | 812 |
| 810 // Authentication data used by the NetworkDelegate for this request, | 813 // Authentication data used by the NetworkDelegate for this request, |
| 811 // if one is present. |auth_credentials_| may be filled in when calling | 814 // if one is present. |auth_credentials_| may be filled in when calling |
| 812 // |NotifyAuthRequired| on the NetworkDelegate. |auth_info_| holds | 815 // |NotifyAuthRequired| on the NetworkDelegate. |auth_info_| holds |
| 813 // the authentication challenge being handled by |NotifyAuthRequired|. | 816 // the authentication challenge being handled by |NotifyAuthRequired|. |
| 814 AuthCredentials auth_credentials_; | 817 AuthCredentials auth_credentials_; |
| 815 scoped_refptr<AuthChallengeInfo> auth_info_; | 818 scoped_refptr<AuthChallengeInfo> auth_info_; |
| 816 | 819 |
| 820 // When this request was created. | |
|
wtc
2011/12/06 21:00:53
Move or copy this comment to the start_time() meth
James Simonsen
2011/12/10 00:21:47
Done.
| |
| 821 base::TimeTicks start_time_; | |
| 822 | |
| 817 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 823 DISALLOW_COPY_AND_ASSIGN(URLRequest); |
| 818 }; | 824 }; |
| 819 | 825 |
| 820 } // namespace net | 826 } // namespace net |
| 821 | 827 |
| 822 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 828 #endif // NET_URL_REQUEST_URL_REQUEST_H_ |
| OLD | NEW |