 Chromium Code Reviews
 Chromium Code Reviews Issue 7602023:
  Use a monotonic clock (TimeTicks) to report network times to WebCore.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 7602023:
  Use a monotonic clock (TimeTicks) to report network times to WebCore.  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| 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> | 
| 11 #include <vector> | 11 #include <vector> | 
| 12 | 12 | 
| 13 #include "base/debug/leak_tracker.h" | 13 #include "base/debug/leak_tracker.h" | 
| 14 #include "base/logging.h" | 14 #include "base/logging.h" | 
| 15 #include "base/memory/linked_ptr.h" | 15 #include "base/memory/linked_ptr.h" | 
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" | 
| 17 #include "base/string16.h" | 17 #include "base/string16.h" | 
| 18 #include "base/time.h" | |
| 18 #include "base/threading/non_thread_safe.h" | 19 #include "base/threading/non_thread_safe.h" | 
| 19 #include "googleurl/src/gurl.h" | 20 #include "googleurl/src/gurl.h" | 
| 20 #include "net/base/auth.h" | 21 #include "net/base/auth.h" | 
| 21 #include "net/base/completion_callback.h" | 22 #include "net/base/completion_callback.h" | 
| 22 #include "net/base/load_states.h" | 23 #include "net/base/load_states.h" | 
| 23 #include "net/base/net_export.h" | 24 #include "net/base/net_export.h" | 
| 24 #include "net/base/net_log.h" | 25 #include "net/base/net_log.h" | 
| 25 #include "net/base/network_delegate.h" | 26 #include "net/base/network_delegate.h" | 
| 26 #include "net/base/request_priority.h" | 27 #include "net/base/request_priority.h" | 
| 27 #include "net/http/http_request_headers.h" | 28 #include "net/http/http_request_headers.h" | 
| (...skipping 15 matching lines...) Expand all Loading... | |
| 43 // Temporary layering violation to allow existing users of a deprecated | 44 // Temporary layering violation to allow existing users of a deprecated | 
| 44 // interface. | 45 // interface. | 
| 45 namespace appcache { | 46 namespace appcache { | 
| 46 class AppCacheInterceptor; | 47 class AppCacheInterceptor; | 
| 47 class AppCacheRequestHandlerTest; | 48 class AppCacheRequestHandlerTest; | 
| 48 class AppCacheURLRequestJobTest; | 49 class AppCacheURLRequestJobTest; | 
| 49 } | 50 } | 
| 50 | 51 | 
| 51 namespace base { | 52 namespace base { | 
| 52 class Time; | 53 class Time; | 
| 54 class TimeTicks; | |
| 53 } // namespace base | 55 } // namespace base | 
| 
wtc
2011/12/10 01:02:54
If you include "base/time.h", please remove the fo
 
James Simonsen
2011/12/12 23:35:34
Done.
Yeah, I saw that right after I uploaded the
 | |
| 54 | 56 | 
| 55 // Temporary layering violation to allow existing users of a deprecated | 57 // Temporary layering violation to allow existing users of a deprecated | 
| 56 // interface. | 58 // interface. | 
| 57 namespace fileapi { | 59 namespace fileapi { | 
| 58 class FileSystemDirURLRequestJobTest; | 60 class FileSystemDirURLRequestJobTest; | 
| 59 class FileSystemOperationWriteTest; | 61 class FileSystemOperationWriteTest; | 
| 60 class FileSystemURLRequestJobTest; | 62 class FileSystemURLRequestJobTest; | 
| 61 class FileWriterDelegateTest; | 63 class FileWriterDelegateTest; | 
| 62 } | 64 } | 
| 63 | 65 | 
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 449 // separated by commas (per RFC 2616). This will not work with cookies since | 451 // separated by commas (per RFC 2616). This will not work with cookies since | 
| 450 // comma can be used in cookie values. | 452 // comma can be used in cookie values. | 
| 451 // TODO(darin): add API to enumerate response headers. | 453 // TODO(darin): add API to enumerate response headers. | 
| 452 void GetResponseHeaderById(int header_id, std::string* value); | 454 void GetResponseHeaderById(int header_id, std::string* value); | 
| 453 void GetResponseHeaderByName(const std::string& name, std::string* value); | 455 void GetResponseHeaderByName(const std::string& name, std::string* value); | 
| 454 | 456 | 
| 455 // Get all response headers, \n-delimited and \n\0-terminated. This includes | 457 // Get all response headers, \n-delimited and \n\0-terminated. This includes | 
| 456 // the response status line. Restrictions on GetResponseHeaders apply. | 458 // the response status line. Restrictions on GetResponseHeaders apply. | 
| 457 void GetAllResponseHeaders(std::string* headers); | 459 void GetAllResponseHeaders(std::string* headers); | 
| 458 | 460 | 
| 461 // The time when |this| was constructed. | |
| 462 base::TimeTicks creation_time() const { return creation_time_; } | |
| 463 | |
| 459 // The time at which the returned response was requested. For cached | 464 // The time at which the returned response was requested. For cached | 
| 460 // responses, this is the last time the cache entry was validated. | 465 // responses, this is the last time the cache entry was validated. | 
| 461 const base::Time& request_time() const { | 466 const base::Time& request_time() const { | 
| 462 return response_info_.request_time; | 467 return response_info_.request_time; | 
| 463 } | 468 } | 
| 464 | 469 | 
| 465 // The time at which the returned response was generated. For cached | 470 // The time at which the returned response was generated. For cached | 
| 466 // responses, this is the last time the cache entry was validated. | 471 // responses, this is the last time the cache entry was validated. | 
| 467 const base::Time& response_time() const { | 472 const base::Time& response_time() const { | 
| 468 return response_info_.response_time; | 473 return response_info_.response_time; | 
| (...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 807 // TODO(battre): Remove this. http://crbug.com/89049 | 812 // TODO(battre): Remove this. http://crbug.com/89049 | 
| 808 bool has_notified_completion_; | 813 bool has_notified_completion_; | 
| 809 | 814 | 
| 810 // Authentication data used by the NetworkDelegate for this request, | 815 // Authentication data used by the NetworkDelegate for this request, | 
| 811 // if one is present. |auth_credentials_| may be filled in when calling | 816 // if one is present. |auth_credentials_| may be filled in when calling | 
| 812 // |NotifyAuthRequired| on the NetworkDelegate. |auth_info_| holds | 817 // |NotifyAuthRequired| on the NetworkDelegate. |auth_info_| holds | 
| 813 // the authentication challenge being handled by |NotifyAuthRequired|. | 818 // the authentication challenge being handled by |NotifyAuthRequired|. | 
| 814 AuthCredentials auth_credentials_; | 819 AuthCredentials auth_credentials_; | 
| 815 scoped_refptr<AuthChallengeInfo> auth_info_; | 820 scoped_refptr<AuthChallengeInfo> auth_info_; | 
| 816 | 821 | 
| 822 base::TimeTicks creation_time_; | |
| 823 | |
| 817 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 824 DISALLOW_COPY_AND_ASSIGN(URLRequest); | 
| 818 }; | 825 }; | 
| 819 | 826 | 
| 820 } // namespace net | 827 } // namespace net | 
| 821 | 828 | 
| 822 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 829 #endif // NET_URL_REQUEST_URL_REQUEST_H_ | 
| OLD | NEW |