Chromium Code Reviews| 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 |