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