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

Side by Side 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: Address review comments. 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 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/chromium_url_request.h" 5 #include "components/cronet/android/chromium_url_request.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/macros.h" 9 #include "base/macros.h"
10 #include "components/cronet/android/url_request_adapter.h" 10 #include "components/cronet/android/url_request_adapter.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 } 380 }
381 381
382 // Some implementations (notably HttpURLConnection) include a mapping for the 382 // Some implementations (notably HttpURLConnection) include a mapping for the
383 // null key; in HTTP's case, this maps to the HTTP status line. 383 // null key; in HTTP's case, this maps to the HTTP status line.
384 ScopedJavaLocalRef<jstring> status_line = 384 ScopedJavaLocalRef<jstring> status_line =
385 ConvertUTF8ToJavaString(env, headers->GetStatusLine()); 385 ConvertUTF8ToJavaString(env, headers->GetStatusLine());
386 Java_ChromiumUrlRequest_onAppendResponseHeader( 386 Java_ChromiumUrlRequest_onAppendResponseHeader(
387 env, object, headersMap, NULL, status_line.Release()); 387 env, object, headersMap, NULL, status_line.Release());
388 } 388 }
389 389
390 static jstring GetNegotiatedProtocol(JNIEnv* env,
391 jobject object,
392 jlong urlRequestAdapter) {
393 URLRequestAdapter* request =
394 reinterpret_cast<URLRequestAdapter*>(urlRequestAdapter);
395 if (request == NULL) {
396 return ConvertUTF8ToJavaString(env, "").Release();
397 }
mmenke 2014/09/10 18:21:27 nit: Think the preference is not to use braces on
mef 2014/09/10 20:18:48 Done.
398 std::string negotiated_protocol = request->GetNegotiatedProtocol();
399 return ConvertUTF8ToJavaString(env, negotiated_protocol.c_str()).Release();
400 }
401
390 } // namespace cronet 402 } // namespace cronet
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698