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

Unified Diff: components/cronet/android/chromium_url_request.cc

Issue 544223003: Add SetSupportsQuic method to explicitly specify server that supports QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added QUIC hints to HttpUrlRequestFactoryConfig. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: components/cronet/android/chromium_url_request.cc
diff --git a/components/cronet/android/chromium_url_request.cc b/components/cronet/android/chromium_url_request.cc
index be31c17ed5c5d74534a425e8c42781f8074c84b5..7239931fdb64e555586622fc53c23e75e4d1f78a 100644
--- a/components/cronet/android/chromium_url_request.cc
+++ b/components/cronet/android/chromium_url_request.cc
@@ -387,4 +387,16 @@ static void GetAllHeaders(JNIEnv* env,
env, object, headersMap, NULL, status_line.Release());
}
+static jstring GetNegotiatedProtocol(JNIEnv* env,
+ jobject object,
+ jlong urlRequestAdapter) {
+ URLRequestAdapter* request =
+ reinterpret_cast<URLRequestAdapter*>(urlRequestAdapter);
+ if (request == NULL) {
mmenke 2014/09/09 14:53:35 Looks like we're pretty inconsistent about checkin
mef 2014/09/10 16:48:17 Acknowledged. I think we should have these checks
+ return NULL;
+ }
+ std::string negotiated_protocol = request->GetNegotiatedProtocol();
mmenke 2014/09/09 14:53:35 If we haven't negotiated a protocol yet, I assume
mef 2014/09/10 16:48:17 Done.
+ return ConvertUTF8ToJavaString(env, negotiated_protocol.c_str()).Release();
+}
+
} // namespace cronet

Powered by Google App Engine
This is Rietveld 408576698