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

Side by Side Diff: net/test/android/net_test_jni_onload.cc

Issue 2620303004: Remove JNI onload callback vector construction in favour of direct calls. (Closed)
Patch Set: rebase compile errors Created 3 years, 10 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
« no previous file with comments | « net/test/android/net_test_jni_onload.h ('k') | remoting/client/jni/remoting_jni_onload.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "net/test/android/net_test_jni_onload.h" 5 #include "net/test/android/net_test_jni_onload.h"
6 6
7 #include "base/android/base_jni_onload.h" 7 #include "base/android/base_jni_onload.h"
8 #include "base/android/base_jni_registrar.h" 8 #include "base/android/base_jni_registrar.h"
9 #include "base/android/jni_android.h"
9 #include "base/bind.h" 10 #include "base/bind.h"
10 #include "net/test/embedded_test_server/android/embedded_test_server_android.h" 11 #include "net/test/embedded_test_server/android/embedded_test_server_android.h"
11 12
12 namespace net { 13 namespace net {
13 namespace test { 14 namespace test {
14 15
15 namespace { 16 namespace {
16 17
17 bool RegisterJNI(JNIEnv* env) { 18 bool RegisterJNI(JNIEnv* env) {
18 return net::test_server::EmbeddedTestServerAndroid:: 19 return net::test_server::EmbeddedTestServerAndroid::
19 RegisterEmbeddedTestServerAndroid(env); 20 RegisterEmbeddedTestServerAndroid(env);
20 } 21 }
21 22
22 bool Init() {
23 return true;
24 }
25
26 } // namesapce 23 } // namesapce
27 24
28 bool OnJNIOnLoadRegisterJNI(JavaVM* vm) { 25 bool OnJNIOnLoadRegisterJNI(JNIEnv* env) {
29 std::vector<base::android::RegisterCallback> register_callbacks; 26 return base::android::OnJNIOnLoadRegisterJNI(env) &&
30 register_callbacks.push_back(base::Bind(&RegisterJNI)); 27 base::android::RegisterJni(env) && RegisterJNI(env);
31 register_callbacks.push_back(base::Bind(&base::android::RegisterJni));
32 return base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks);
33 } 28 }
34 29
35 bool OnJNIOnLoadInit() { 30 bool OnJNIOnLoadInit() {
36 std::vector<base::android::InitCallback> init_callbacks; 31 return base::android::OnJNIOnLoadInit();
37 init_callbacks.push_back(base::Bind(&Init));
38 return base::android::OnJNIOnLoadInit(init_callbacks);
39 } 32 }
40 33
41 } // namespace test 34 } // namespace test
42 } // namespace net 35 } // namespace net
OLDNEW
« no previous file with comments | « net/test/android/net_test_jni_onload.h ('k') | remoting/client/jni/remoting_jni_onload.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698