| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 DnsHostInfo object is used to store status of a Dns lookup of a specific | 5 // A DnsHostInfo object is used to store status of a Dns lookup of a specific |
| 6 // hostname. | 6 // hostname. |
| 7 // It includes progress, from placement in the DnsMaster's queue, to resolution | 7 // It includes progress, from placement in the DnsMaster's queue, to assignment |
| 8 // by the DNS service as either FOUND or NO_SUCH_NAME. | 8 // to a slave, to resolution by the (blocking) DNS service as either FOUND or |
| 9 // NO_SUCH_NAME. |
| 9 | 10 |
| 10 #ifndef CHROME_BROWSER_NET_DNS_HOST_INFO_H_ | 11 #ifndef CHROME_BROWSER_NET_DNS_HOST_INFO_H_ |
| 11 #define CHROME_BROWSER_NET_DNS_HOST_INFO_H_ | 12 #define CHROME_BROWSER_NET_DNS_HOST_INFO_H_ |
| 12 | 13 |
| 13 #include <string> | 14 #include <string> |
| 14 #include <vector> | 15 #include <vector> |
| 15 | 16 |
| 16 #include "base/logging.h" | 17 #include "base/logging.h" |
| 17 #include "base/time.h" | 18 #include "base/time.h" |
| 18 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 46 // The following involve predictive prefetching, triggered by a navigation. | 47 // The following involve predictive prefetching, triggered by a navigation. |
| 47 // The referring_hostname_ is also set when these are used. | 48 // The referring_hostname_ is also set when these are used. |
| 48 // TODO(jar): Support STATIC_REFERAL_MOTIVATED API and integration. | 49 // TODO(jar): Support STATIC_REFERAL_MOTIVATED API and integration. |
| 49 STATIC_REFERAL_MOTIVATED, // External database suggested this resolution. | 50 STATIC_REFERAL_MOTIVATED, // External database suggested this resolution. |
| 50 LEARNED_REFERAL_MOTIVATED, // Prior navigation taught us this resolution. | 51 LEARNED_REFERAL_MOTIVATED, // Prior navigation taught us this resolution. |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 enum DnsProcessingState { | 54 enum DnsProcessingState { |
| 54 // When processed by our prefetching system, the states are: | 55 // When processed by our prefetching system, the states are: |
| 55 PENDING, // Constructor has completed. | 56 PENDING, // Constructor has completed. |
| 56 QUEUED, // In prefetch queue but not yet being resolved. | 57 QUEUED, // In prefetch queue but not yet assigned to a slave. |
| 57 ASSIGNED, // Currently being processed. | 58 ASSIGNED, // Currently being processed by a slave. |
| 58 ASSIGNED_BUT_MARKED, // Needs to be deleted as soon as it's resolved. | 59 ASSIGNED_BUT_MARKED, // Needs to be deleted as soon as slave is done. |
| 59 FOUND, // DNS prefetch search completed. | 60 FOUND, // DNS prefetch search completed. |
| 60 NO_SUCH_NAME, // DNS prefetch search completed. | 61 NO_SUCH_NAME, // DNS prefetch search completed. |
| 61 // When processed by the network stack during navigation, the states are: | 62 // When processed by the network stack during navigation, the states are: |
| 62 STARTED, // Resolution has begun for a navigation. | 63 STARTED, // Resolution has begun for a navigation. |
| 63 FINISHED, // Resolution has completed for a navigation. | 64 FINISHED, // Resolution has completed for a navigation. |
| 64 FINISHED_UNRESOLVED}; // No resolution found, so navigation will fail. | 65 FINISHED_UNRESOLVED}; // No resolution found, so navigation will fail. |
| 65 static const base::TimeDelta kMaxNonNetworkDnsLookupDuration; | 66 static const base::TimeDelta kMaxNonNetworkDnsLookupDuration; |
| 66 // The number of OS cache entries we can guarantee(?) before cache eviction | 67 // The number of OS cache entries we can guarantee(?) before cache eviction |
| 67 // might likely take place. | 68 // might likely take place. |
| 68 static const int kMaxGuaranteedCacheSize = 50; | 69 static const int kMaxGuaranteedCacheSize = 50; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 std::string referring_hostname_; | 185 std::string referring_hostname_; |
| 185 | 186 |
| 186 // We put these objects into a std::map, and hence we | 187 // We put these objects into a std::map, and hence we |
| 187 // need some "evil" constructors. | 188 // need some "evil" constructors. |
| 188 // DISALLOW_COPY_AND_ASSIGN(DnsHostInfo); | 189 // DISALLOW_COPY_AND_ASSIGN(DnsHostInfo); |
| 189 }; | 190 }; |
| 190 | 191 |
| 191 } // namespace chrome_browser_net | 192 } // namespace chrome_browser_net |
| 192 | 193 |
| 193 #endif // CHROME_BROWSER_NET_DNS_HOST_INFO_H_ | 194 #endif // CHROME_BROWSER_NET_DNS_HOST_INFO_H_ |
| OLD | NEW |