OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <string> | 10 #include <string> |
(...skipping 12 matching lines...) Expand all Loading... |
23 static bool detailed_logging_enabled = false; | 23 static bool detailed_logging_enabled = false; |
24 | 24 |
25 // Use command line switch to enable detailed logging. | 25 // Use command line switch to enable detailed logging. |
26 void EnablePredictorDetailedLog(bool enable) { | 26 void EnablePredictorDetailedLog(bool enable) { |
27 detailed_logging_enabled = enable; | 27 detailed_logging_enabled = enable; |
28 } | 28 } |
29 | 29 |
30 // static | 30 // static |
31 int UrlInfo::sequence_counter = 1; | 31 int UrlInfo::sequence_counter = 1; |
32 | 32 |
| 33 UrlInfo::UrlInfo() |
| 34 : state_(PENDING), |
| 35 old_prequeue_state_(state_), |
| 36 resolve_duration_(kNullDuration), |
| 37 queue_duration_(kNullDuration), |
| 38 sequence_number_(0), |
| 39 motivation_(NO_PREFETCH_MOTIVATION), |
| 40 was_linked_(false) { |
| 41 } |
| 42 |
| 43 UrlInfo::~UrlInfo() {} |
33 | 44 |
34 bool UrlInfo::NeedsDnsUpdate() { | 45 bool UrlInfo::NeedsDnsUpdate() { |
35 switch (state_) { | 46 switch (state_) { |
36 case PENDING: // Just now created info. | 47 case PENDING: // Just now created info. |
37 return true; | 48 return true; |
38 | 49 |
39 case QUEUED: // In queue. | 50 case QUEUED: // In queue. |
40 case ASSIGNED: // It's being resolved. | 51 case ASSIGNED: // It's being resolved. |
41 case ASSIGNED_BUT_MARKED: // It's being resolved. | 52 case ASSIGNED_BUT_MARKED: // It's being resolved. |
42 return false; // We're already working on it | 53 return false; // We're already working on it |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 | 338 |
328 case LEARNED_REFERAL_MOTIVATED: | 339 case LEARNED_REFERAL_MOTIVATED: |
329 return RemoveJs(referring_url_.spec()); | 340 return RemoveJs(referring_url_.spec()); |
330 | 341 |
331 default: | 342 default: |
332 return ""; | 343 return ""; |
333 } | 344 } |
334 } | 345 } |
335 | 346 |
336 } // namespace chrome_browser_net | 347 } // namespace chrome_browser_net |
OLD | NEW |