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

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

Issue 1018943002: Update HttpServerProperties::*AlternateProtocol* interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/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 net::AlternativeService alternative_service(
201 quic_hint_host_port_pair, 201 net::AlternateProtocol::QUIC, quic_hint_host_port_pair.host(),
Ryan Hamilton 2015/03/18 22:55:42 I wonder if the host should be ""?
Bence 2015/03/19 12:45:39 Done.
202 static_cast<uint16>(quic_hint.alternate_port), 202 static_cast<uint16>(quic_hint.alternate_port));
203 net::AlternateProtocol::QUIC, 203 context_->http_server_properties()->SetAlternativeService(
204 1.0f); 204 quic_hint_host_port_pair, alternative_service, 1.0f);
205 } 205 }
206 } 206 }
207 207
208 JNIEnv* env = base::android::AttachCurrentThread(); 208 JNIEnv* env = base::android::AttachCurrentThread();
209 Java_CronetUrlRequestContext_initNetworkThread( 209 Java_CronetUrlRequestContext_initNetworkThread(
210 env, jcronet_url_request_context.obj()); 210 env, jcronet_url_request_context.obj());
211 211
212 is_context_initialized_ = true; 212 is_context_initialized_ = true;
213 while (!tasks_waiting_for_context_.empty()) { 213 while (!tasks_waiting_for_context_.empty()) {
214 tasks_waiting_for_context_.front().Run(); 214 tasks_waiting_for_context_.front().Run();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 } 322 }
323 323
324 static jint SetMinLogLevel(JNIEnv* env, jclass jcaller, jint jlog_level) { 324 static jint SetMinLogLevel(JNIEnv* env, jclass jcaller, jint jlog_level) {
325 jint old_log_level = static_cast<jint>(logging::GetMinLogLevel()); 325 jint old_log_level = static_cast<jint>(logging::GetMinLogLevel());
326 // MinLogLevel is global, shared by all URLRequestContexts. 326 // MinLogLevel is global, shared by all URLRequestContexts.
327 logging::SetMinLogLevel(static_cast<int>(jlog_level)); 327 logging::SetMinLogLevel(static_cast<int>(jlog_level));
328 return old_log_level; 328 return old_log_level;
329 } 329 }
330 330
331 } // namespace cronet 331 } // namespace cronet
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698