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

Side by Side Diff: mojo/android/javatests/init_library.cc

Issue 1350023003: Add a Mojo EDK for Chrome that uses one OS pipe per message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: some review comments Created 5 years, 2 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 "base/android/base_jni_onload.h" 5 #include "base/android/base_jni_onload.h"
6 #include "base/android/base_jni_registrar.h" 6 #include "base/android/base_jni_registrar.h"
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_registrar.h" 8 #include "base/android/jni_registrar.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "mojo/android/javatests/mojo_test_case.h" 10 #include "mojo/android/javatests/mojo_test_case.h"
11 #include "mojo/android/javatests/validation_test_util.h" 11 #include "mojo/android/javatests/validation_test_util.h"
12 #include "mojo/android/system/core_impl.h" 12 #include "mojo/android/system/core_impl.h"
13 #include "mojo/edk/embedder/embedder.h" 13 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
14 #include "mojo/edk/embedder/simple_platform_support.h"
15 14
16 namespace { 15 namespace {
17 16
18 base::android::RegistrationMethod kMojoRegisteredMethods[] = { 17 base::android::RegistrationMethod kMojoRegisteredMethods[] = {
19 { "CoreImpl", mojo::android::RegisterCoreImpl }, 18 { "CoreImpl", mojo::android::RegisterCoreImpl },
20 { "MojoTestCase", mojo::android::RegisterMojoTestCase }, 19 { "MojoTestCase", mojo::android::RegisterMojoTestCase },
21 { "ValidationTestUtil", mojo::android::RegisterValidationTestUtil }, 20 { "ValidationTestUtil", mojo::android::RegisterValidationTestUtil },
22 }; 21 };
23 22
24 bool RegisterJNI(JNIEnv* env) { 23 bool RegisterJNI(JNIEnv* env) {
25 return base::android::RegisterJni(env) && 24 return base::android::RegisterJni(env) &&
26 RegisterNativeMethods(env, kMojoRegisteredMethods, 25 RegisterNativeMethods(env, kMojoRegisteredMethods,
27 arraysize(kMojoRegisteredMethods)); 26 arraysize(kMojoRegisteredMethods));
28 } 27 }
29 28
30 bool Init() { 29 bool Init() {
31 mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>( 30 mojo::embedder::Init();
32 new mojo::embedder::SimplePlatformSupport()));
33 return true; 31 return true;
34 } 32 }
35 33
36 } // namespace 34 } // namespace
37 35
38 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { 36 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
39 std::vector<base::android::RegisterCallback> register_callbacks; 37 std::vector<base::android::RegisterCallback> register_callbacks;
40 register_callbacks.push_back(base::Bind(&RegisterJNI)); 38 register_callbacks.push_back(base::Bind(&RegisterJNI));
41 std::vector<base::android::InitCallback> init_callbacks; 39 std::vector<base::android::InitCallback> init_callbacks;
42 init_callbacks.push_back(base::Bind(&Init)); 40 init_callbacks.push_back(base::Bind(&Init));
43 if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) || 41 if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) ||
44 !base::android::OnJNIOnLoadInit(init_callbacks)) 42 !base::android::OnJNIOnLoadInit(init_callbacks))
45 return -1; 43 return -1;
46 44
47 return JNI_VERSION_1_4; 45 return JNI_VERSION_1_4;
48 } 46 }
OLDNEW
« no previous file with comments | « mojo/android/BUILD.gn ('k') | mojo/edk/DEPS » ('j') | mojo/edk/embedder/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698