| 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 DnsMaster object is instantiated once in the browser | 5 // A DnsMaster object is instantiated once in the browser |
| 6 // process, and manages asynchronous resolution of DNS hostnames. | 6 // process, and manages asynchronous resolution of DNS hostnames. |
| 7 // Most hostname lists are sent out by renderer processes, and | 7 // Most hostname lists are sent out by renderer processes, and |
| 8 // involve lists of hostnames that *might* be used in the near | 8 // involve lists of hostnames that *might* be used in the near |
| 9 // future by the browsing user. The goal of this class is to | 9 // future by the browsing user. The goal of this class is to |
| 10 // cause the underlying DNS structure to lookup a hostname before | 10 // cause the underlying DNS structure to lookup a hostname before |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 // Construct a ListValue object that contains all the data in the referrers_ | 93 // Construct a ListValue object that contains all the data in the referrers_ |
| 94 // so that it can be persisted in a pref. | 94 // so that it can be persisted in a pref. |
| 95 void SerializeReferrers(ListValue* referral_list); | 95 void SerializeReferrers(ListValue* referral_list); |
| 96 | 96 |
| 97 // Process a ListValue that contains all the data from a previous reference | 97 // Process a ListValue that contains all the data from a previous reference |
| 98 // list, as constructed by SerializeReferrers(), and add all the identified | 98 // list, as constructed by SerializeReferrers(), and add all the identified |
| 99 // values into the current referrer list. | 99 // values into the current referrer list. |
| 100 void DeserializeReferrers(const ListValue& referral_list); | 100 void DeserializeReferrers(const ListValue& referral_list); |
| 101 | 101 |
| 102 // For unit test code only. |
| 103 size_t max_concurrent_lookups() const { return max_concurrent_lookups_; } |
| 104 |
| 102 private: | 105 private: |
| 103 FRIEND_TEST(DnsMasterTest, BenefitLookupTest); | 106 FRIEND_TEST(DnsMasterTest, BenefitLookupTest); |
| 104 FRIEND_TEST(DnsMasterTest, ShutdownWhenResolutionIsPendingTest); | 107 FRIEND_TEST(DnsMasterTest, ShutdownWhenResolutionIsPendingTest); |
| 105 FRIEND_TEST(DnsMasterTest, SingleLookupTest); | 108 FRIEND_TEST(DnsMasterTest, SingleLookupTest); |
| 106 FRIEND_TEST(DnsMasterTest, ConcurrentLookupTest); | 109 FRIEND_TEST(DnsMasterTest, ConcurrentLookupTest); |
| 107 FRIEND_TEST(DnsMasterTest, DISABLED_MassiveConcurrentLookupTest); | 110 FRIEND_TEST(DnsMasterTest, DISABLED_MassiveConcurrentLookupTest); |
| 108 FRIEND_TEST(DnsMasterTest, PriorityQueuePushPopTest); | 111 FRIEND_TEST(DnsMasterTest, PriorityQueuePushPopTest); |
| 109 FRIEND_TEST(DnsMasterTest, PriorityQueueReorderTest); | 112 FRIEND_TEST(DnsMasterTest, PriorityQueueReorderTest); |
| 110 friend class WaitForResolutionHelper; // For testing. | 113 friend class WaitForResolutionHelper; // For testing. |
| 111 | 114 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 // thread safe) should be accessed only on |host_resolver_loop_|. | 239 // thread safe) should be accessed only on |host_resolver_loop_|. |
| 237 scoped_refptr<net::HostResolver> host_resolver_; | 240 scoped_refptr<net::HostResolver> host_resolver_; |
| 238 MessageLoop* host_resolver_loop_; | 241 MessageLoop* host_resolver_loop_; |
| 239 | 242 |
| 240 DISALLOW_COPY_AND_ASSIGN(DnsMaster); | 243 DISALLOW_COPY_AND_ASSIGN(DnsMaster); |
| 241 }; | 244 }; |
| 242 | 245 |
| 243 } // namespace chrome_browser_net | 246 } // namespace chrome_browser_net |
| 244 | 247 |
| 245 #endif // CHROME_BROWSER_NET_DNS_MASTER_H_ | 248 #endif // CHROME_BROWSER_NET_DNS_MASTER_H_ |
| OLD | NEW |