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

Side by Side Diff: components/cronet/android/url_request_context_adapter.cc

Issue 1018943002: Update HttpServerProperties::*AlternateProtocol* interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 9 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/cronet/android/url_request_context_adapter.h" 5 #include "components/cronet/android/url_request_context_adapter.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 if (quic_hint.alternate_port <= std::numeric_limits<uint16>::min() || 181 if (quic_hint.alternate_port <= std::numeric_limits<uint16>::min() ||
182 quic_hint.alternate_port > std::numeric_limits<uint16>::max()) { 182 quic_hint.alternate_port > std::numeric_limits<uint16>::max()) {
183 LOG(ERROR) << "Invalid QUIC hint alternate port: " 183 LOG(ERROR) << "Invalid QUIC hint alternate port: "
184 << quic_hint.alternate_port; 184 << quic_hint.alternate_port;
185 continue; 185 continue;
186 } 186 }
187 187
188 net::HostPortPair quic_hint_host_port_pair(canon_host, 188 net::HostPortPair quic_hint_host_port_pair(canon_host,
189 quic_hint.port); 189 quic_hint.port);
190 context_->http_server_properties()->SetAlternateProtocol( 190 net::AlternativeService alternative_service(
191 quic_hint_host_port_pair, 191 net::AlternateProtocol::QUIC, "",
192 static_cast<uint16>(quic_hint.alternate_port), 192 static_cast<uint16>(quic_hint.alternate_port));
193 net::AlternateProtocol::QUIC, 193 context_->http_server_properties()->SetAlternativeService(
194 1.0f); 194 quic_hint_host_port_pair, alternative_service, 1.0f);
195 } 195 }
196 } 196 }
197 load_disable_cache_ = config_->load_disable_cache; 197 load_disable_cache_ = config_->load_disable_cache;
198 config_.reset(NULL); 198 config_.reset(NULL);
199 199
200 if (VLOG_IS_ON(2)) { 200 if (VLOG_IS_ON(2)) {
201 net_log_observer_.reset(new NetLogObserver()); 201 net_log_observer_.reset(new NetLogObserver());
202 context_->net_log()->AddThreadSafeObserver(net_log_observer_.get(), 202 context_->net_log()->AddThreadSafeObserver(net_log_observer_.get(),
203 net::NetLog::LOG_ALL_BUT_BYTES); 203 net::NetLog::LOG_ALL_BUT_BYTES);
204 } 204 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 net_log_logger_.reset(); 297 net_log_logger_.reset();
298 } 298 }
299 } 299 }
300 300
301 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) { 301 void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) {
302 VLOG(2) << "Net log entry: type=" << entry.type() 302 VLOG(2) << "Net log entry: type=" << entry.type()
303 << ", source=" << entry.source().type << ", phase=" << entry.phase(); 303 << ", source=" << entry.source().type << ", phase=" << entry.phase();
304 } 304 }
305 305
306 } // namespace cronet 306 } // namespace cronet
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698