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

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

Issue 1216703002: Implement multiple alternative services per origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 LOG(ERROR) << "Invalid QUIC hint alternate port: " 241 LOG(ERROR) << "Invalid QUIC hint alternate port: "
242 << quic_hint.alternate_port; 242 << quic_hint.alternate_port;
243 continue; 243 continue;
244 } 244 }
245 245
246 net::HostPortPair quic_hint_host_port_pair(canon_host, 246 net::HostPortPair quic_hint_host_port_pair(canon_host,
247 quic_hint.port); 247 quic_hint.port);
248 net::AlternativeService alternative_service( 248 net::AlternativeService alternative_service(
249 net::AlternateProtocol::QUIC, "", 249 net::AlternateProtocol::QUIC, "",
250 static_cast<uint16>(quic_hint.alternate_port)); 250 static_cast<uint16>(quic_hint.alternate_port));
251 context_->http_server_properties()->SetAlternativeService( 251 context_->http_server_properties()->AddAlternativeService(
252 quic_hint_host_port_pair, alternative_service, 1.0f); 252 quic_hint_host_port_pair, alternative_service, 1.0f);
253 } 253 }
254 } 254 }
255 255
256 JNIEnv* env = base::android::AttachCurrentThread(); 256 JNIEnv* env = base::android::AttachCurrentThread();
257 Java_CronetUrlRequestContext_initNetworkThread( 257 Java_CronetUrlRequestContext_initNetworkThread(
258 env, jcronet_url_request_context.obj()); 258 env, jcronet_url_request_context.obj());
259 259
260 #if defined(DATA_REDUCTION_PROXY_SUPPORT) 260 #if defined(DATA_REDUCTION_PROXY_SUPPORT)
261 if (data_reduction_proxy_) 261 if (data_reduction_proxy_)
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 } 390 }
391 391
392 static jint SetMinLogLevel(JNIEnv* env, jclass jcaller, jint jlog_level) { 392 static jint SetMinLogLevel(JNIEnv* env, jclass jcaller, jint jlog_level) {
393 jint old_log_level = static_cast<jint>(logging::GetMinLogLevel()); 393 jint old_log_level = static_cast<jint>(logging::GetMinLogLevel());
394 // MinLogLevel is global, shared by all URLRequestContexts. 394 // MinLogLevel is global, shared by all URLRequestContexts.
395 logging::SetMinLogLevel(static_cast<int>(jlog_level)); 395 logging::SetMinLogLevel(static_cast<int>(jlog_level));
396 return old_log_level; 396 return old_log_level;
397 } 397 }
398 398
399 } // namespace cronet 399 } // namespace cronet
OLDNEW
« no previous file with comments | « no previous file | components/cronet/android/url_request_context_adapter.cc » ('j') | net/http/http_server_properties_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698