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

Side by Side Diff: components/cronet/android/test/cronet_tests_jni.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: Sync 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <jni.h>
6
7 #include "base/android/base_jni_registrar.h"
8 #include "base/android/jni_android.h"
9 #include "base/android/jni_registrar.h"
10 #include "components/cronet/android/cronet_loader.h"
11
12 namespace {
13
14 const base::android::RegistrationMethod kCronetTestsRegisteredMethods[] = {
15 {"BaseAndroid", base::android::RegisterJni},
16 };
17
18 } // namespace
19
20 // This is called by the VM when the shared library is first loaded.
21 // Checks the available version of JNI. Also, caches Java reflection artifacts.
22 extern "C" jint JNI_OnLoad(JavaVM* vm, void* reserved) {
23 JNIEnv* env;
24 if (vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6) != JNI_OK) {
25 return -1;
26 }
27
28 jint cronet_onload = cronet::CronetOnLoad(vm, reserved);
29 if (cronet_onload == -1)
30 return cronet_onload;
31
32 if (!base::android::RegisterNativeMethods(
33 env,
34 kCronetTestsRegisteredMethods,
35 arraysize(kCronetTestsRegisteredMethods))) {
36 return -1;
37 }
38 return cronet_onload;
39 }
40
41 extern "C" void JNI_OnUnLoad(JavaVM* vm, void* reserved) {
42 cronet::CronetOnUnLoad(vm, reserved);
43 }
44
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698