Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(421)

Side by Side Diff: net/dns/host_resolver.cc

Issue 2083643003: DNS: Let requests specify a callback for future cache hits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Clarify a couple comments. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/dns/host_resolver.h ('k') | net/dns/host_resolver_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "net/dns/host_resolver.h" 5 #include "net/dns/host_resolver.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/field_trial.h" 8 #include "base/metrics/field_trial.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_split.h" 10 #include "base/strings/string_split.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 return limits; 84 return limits;
85 } 85 }
86 86
87 HostResolver::Options::Options() 87 HostResolver::Options::Options()
88 : max_concurrent_resolves(kDefaultParallelism), 88 : max_concurrent_resolves(kDefaultParallelism),
89 max_retry_attempts(kDefaultRetryAttempts), 89 max_retry_attempts(kDefaultRetryAttempts),
90 enable_caching(true) { 90 enable_caching(true) {
91 } 91 }
92 92
93 HostResolver::RequestInfo::RequestInfo(const HostPortPair& host_port_pair) 93 HostResolver::RequestInfo::RequestInfo(const HostPortPair& host_port_pair)
94 : host_port_pair_(host_port_pair), 94 : RequestInfo() {
95 address_family_(ADDRESS_FAMILY_UNSPECIFIED), 95 host_port_pair_ = host_port_pair;
96 }
97
98 HostResolver::RequestInfo::RequestInfo(const RequestInfo& request_info)
99 : host_port_pair_(request_info.host_port_pair_),
100 address_family_(request_info.address_family_),
101 host_resolver_flags_(request_info.host_resolver_flags_),
102 allow_cached_response_(request_info.allow_cached_response_),
103 is_speculative_(request_info.is_speculative_),
104 is_my_ip_address_(request_info.is_my_ip_address_),
105 cache_hit_callback_(request_info.cache_hit_callback_) {}
106
107 HostResolver::RequestInfo::~RequestInfo() {}
108
109 HostResolver::RequestInfo::RequestInfo()
110 : address_family_(ADDRESS_FAMILY_UNSPECIFIED),
96 host_resolver_flags_(0), 111 host_resolver_flags_(0),
97 allow_cached_response_(true), 112 allow_cached_response_(true),
98 is_speculative_(false), 113 is_speculative_(false),
99 is_my_ip_address_(false) {} 114 is_my_ip_address_(false) {}
100 115
101 HostResolver::~HostResolver() { 116 HostResolver::~HostResolver() {
102 } 117 }
103 118
104 void HostResolver::SetDnsClientEnabled(bool enabled) { 119 void HostResolver::SetDnsClientEnabled(bool enabled) {
105 } 120 }
(...skipping 21 matching lines...) Expand all
127 std::unique_ptr<HostResolver> HostResolver::CreateDefaultResolver( 142 std::unique_ptr<HostResolver> HostResolver::CreateDefaultResolver(
128 NetLog* net_log) { 143 NetLog* net_log) {
129 return std::unique_ptr<HostResolver>( 144 return std::unique_ptr<HostResolver>(
130 new HostResolverImpl(Options(), net_log)); 145 new HostResolverImpl(Options(), net_log));
131 } 146 }
132 147
133 HostResolver::HostResolver() { 148 HostResolver::HostResolver() {
134 } 149 }
135 150
136 } // namespace net 151 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/host_resolver.h ('k') | net/dns/host_resolver_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698