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 // A UrlInfo object is used to store prediction related information about a host | 5 // A UrlInfo object is used to store prediction related information about a host |
6 // port and scheme triplet. When performing DNS pre-resolution of the host/port | 6 // port and scheme triplet. When performing DNS pre-resolution of the host/port |
7 // pair, its state is monitored as it is resolved. | 7 // pair, its state is monitored as it is resolved. |
8 // It includes progress, from placement in the Predictor's queue, to resolution | 8 // It includes progress, from placement in the Predictor's queue, to resolution |
9 // by the DNS service as either FOUND or NO_SUCH_NAME. Each instance may also | 9 // by the DNS service as either FOUND or NO_SUCH_NAME. Each instance may also |
10 // hold records of previous resolution times, which might later be shown to be | 10 // hold records of previous resolution times, which might later be shown to be |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 void SetReferringHostname(const GURL& url) { | 103 void SetReferringHostname(const GURL& url) { |
104 referring_url_ = url; | 104 referring_url_ = url; |
105 } | 105 } |
106 | 106 |
107 bool was_found() const { return FOUND == state_; } | 107 bool was_found() const { return FOUND == state_; } |
108 bool was_nonexistent() const { return NO_SUCH_NAME == state_; } | 108 bool was_nonexistent() const { return NO_SUCH_NAME == state_; } |
109 bool is_assigned() const { | 109 bool is_assigned() const { |
110 return ASSIGNED == state_ || ASSIGNED_BUT_MARKED == state_; | 110 return ASSIGNED == state_ || ASSIGNED_BUT_MARKED == state_; |
111 } | 111 } |
112 bool is_marked_to_delete() const { return ASSIGNED_BUT_MARKED == state_; } | 112 bool is_marked_to_delete() const { return ASSIGNED_BUT_MARKED == state_; } |
113 const GURL url() const { return url_; } | |
114 | 113 |
115 bool HasUrl(const GURL& url) const { | 114 bool HasUrl(const GURL& url) const { |
116 return url_ == url; | 115 return url_ == url; |
117 } | 116 } |
118 | 117 |
119 base::TimeDelta resolve_duration() const { return resolve_duration_;} | 118 base::TimeDelta resolve_duration() const { return resolve_duration_;} |
120 base::TimeDelta queue_duration() const { return queue_duration_;} | 119 base::TimeDelta queue_duration() const { return queue_duration_;} |
121 | 120 |
122 void DLogResultsStats(const char* message) const; | 121 void DLogResultsStats(const char* message) const; |
123 | 122 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 GURL referring_url_; | 178 GURL referring_url_; |
180 | 179 |
181 // We put these objects into a std::map, and hence we | 180 // We put these objects into a std::map, and hence we |
182 // need some "evil" constructors. | 181 // need some "evil" constructors. |
183 // DISALLOW_COPY_AND_ASSIGN(UrlInfo); | 182 // DISALLOW_COPY_AND_ASSIGN(UrlInfo); |
184 }; | 183 }; |
185 | 184 |
186 } // namespace chrome_browser_net | 185 } // namespace chrome_browser_net |
187 | 186 |
188 #endif // CHROME_BROWSER_NET_URL_INFO_H_ | 187 #endif // CHROME_BROWSER_NET_URL_INFO_H_ |
OLD | NEW |