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

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

Issue 665083009: ABANDONED Handle multiple AlternateProtocols for each HostPortPair. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re: 18. 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
« no previous file with comments | « no previous file | components/cronet/android/url_request_context_adapter.cc » ('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 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/cronet_url_request_context_adapter.h" 5 #include "components/cronet/android/cronet_url_request_context_adapter.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 if (quic_hint.alternate_port <= std::numeric_limits<uint16>::min() || 191 if (quic_hint.alternate_port <= std::numeric_limits<uint16>::min() ||
192 quic_hint.alternate_port > std::numeric_limits<uint16>::max()) { 192 quic_hint.alternate_port > std::numeric_limits<uint16>::max()) {
193 LOG(ERROR) << "Invalid QUIC hint alternate port: " 193 LOG(ERROR) << "Invalid QUIC hint alternate port: "
194 << quic_hint.alternate_port; 194 << quic_hint.alternate_port;
195 continue; 195 continue;
196 } 196 }
197 197
198 net::HostPortPair quic_hint_host_port_pair(canon_host, 198 net::HostPortPair quic_hint_host_port_pair(canon_host,
199 quic_hint.port); 199 quic_hint.port);
200 context_->http_server_properties()->SetAlternateProtocol( 200 context_->http_server_properties()->AddAlternateProtocol(
201 quic_hint_host_port_pair, 201 quic_hint_host_port_pair,
202 static_cast<uint16>(quic_hint.alternate_port), 202 static_cast<uint16>(quic_hint.alternate_port),
203 net::AlternateProtocol::QUIC, 203 net::AlternateProtocol::QUIC, 1.0f);
204 1.0f);
205 } 204 }
206 } 205 }
207 206
208 JNIEnv* env = base::android::AttachCurrentThread(); 207 JNIEnv* env = base::android::AttachCurrentThread();
209 Java_CronetUrlRequestContext_initNetworkThread( 208 Java_CronetUrlRequestContext_initNetworkThread(
210 env, jcronet_url_request_context.obj()); 209 env, jcronet_url_request_context.obj());
211 210
212 is_context_initialized_ = true; 211 is_context_initialized_ = true;
213 while (!tasks_waiting_for_context_.empty()) { 212 while (!tasks_waiting_for_context_.empty()) {
214 tasks_waiting_for_context_.front().Run(); 213 tasks_waiting_for_context_.front().Run();
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 } 323 }
325 324
326 static jint SetMinLogLevel(JNIEnv* env, jclass jcaller, jint jlog_level) { 325 static jint SetMinLogLevel(JNIEnv* env, jclass jcaller, jint jlog_level) {
327 jint old_log_level = static_cast<jint>(logging::GetMinLogLevel()); 326 jint old_log_level = static_cast<jint>(logging::GetMinLogLevel());
328 // MinLogLevel is global, shared by all URLRequestContexts. 327 // MinLogLevel is global, shared by all URLRequestContexts.
329 logging::SetMinLogLevel(static_cast<int>(jlog_level)); 328 logging::SetMinLogLevel(static_cast<int>(jlog_level));
330 return old_log_level; 329 return old_log_level;
331 } 330 }
332 331
333 } // namespace cronet 332 } // namespace cronet
OLDNEW
« no previous file with comments | « no previous file | components/cronet/android/url_request_context_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698