| 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 #include "chrome/browser/net/url_info.h" | 5 #include "chrome/browser/net/url_info.h" |
| 6 | 6 |
| 7 #include <ctype.h> | 7 #include <ctype.h> |
| 8 #include <math.h> | 8 #include <math.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 max_duration, TimeDelta::FromMinutes(15), 100); | 162 max_duration, TimeDelta::FromMinutes(15), 100); |
| 163 } | 163 } |
| 164 sequence_number_ = sequence_counter++; | 164 sequence_number_ = sequence_counter++; |
| 165 DLogResultsStats("DNS PrefetchFound"); | 165 DLogResultsStats("DNS PrefetchFound"); |
| 166 } | 166 } |
| 167 | 167 |
| 168 void UrlInfo::SetNoSuchNameState() { | 168 void UrlInfo::SetNoSuchNameState() { |
| 169 DCHECK(ASSIGNED == state_); | 169 DCHECK(ASSIGNED == state_); |
| 170 state_ = NO_SUCH_NAME; | 170 state_ = NO_SUCH_NAME; |
| 171 resolve_duration_ = GetDuration(); | 171 resolve_duration_ = GetDuration(); |
| 172 #ifndef NDEBUG |
| 172 if (MaxNonNetworkDnsLookupDuration() <= resolve_duration_) { | 173 if (MaxNonNetworkDnsLookupDuration() <= resolve_duration_) { |
| 173 DHISTOGRAM_TIMES("DNS.PrefetchNotFoundName", resolve_duration_); | 174 LOCAL_HISTOGRAM_TIMES("DNS.PrefetchNotFoundName", resolve_duration_); |
| 174 } | 175 } |
| 176 #endif |
| 175 sequence_number_ = sequence_counter++; | 177 sequence_number_ = sequence_counter++; |
| 176 DLogResultsStats("DNS PrefetchNotFound"); | 178 DLogResultsStats("DNS PrefetchNotFound"); |
| 177 } | 179 } |
| 178 | 180 |
| 179 void UrlInfo::SetUrl(const GURL& url) { | 181 void UrlInfo::SetUrl(const GURL& url) { |
| 180 if (url_.is_empty()) // Not yet initialized. | 182 if (url_.is_empty()) // Not yet initialized. |
| 181 url_ = url; | 183 url_ = url; |
| 182 else | 184 else |
| 183 DCHECK_EQ(url_, url); | 185 DCHECK_EQ(url_, url); |
| 184 } | 186 } |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 | 361 |
| 360 case LEARNED_REFERAL_MOTIVATED: | 362 case LEARNED_REFERAL_MOTIVATED: |
| 361 return RemoveJs(referring_url_.spec()); | 363 return RemoveJs(referring_url_.spec()); |
| 362 | 364 |
| 363 default: | 365 default: |
| 364 return std::string(); | 366 return std::string(); |
| 365 } | 367 } |
| 366 } | 368 } |
| 367 | 369 |
| 368 } // namespace chrome_browser_net | 370 } // namespace chrome_browser_net |
| OLD | NEW |