Commit 009487f7 authored by qsr's avatar qsr Committed by Commit bot

mojo: Move initialization of the embedder in java.

The embedder was initialized in the constructor of CoreImpl. This is not
correct, because when it will be used in Chromium, the embedder is
initialized by the native code.

This remove the initialization from CoreImpl. Instead, for tests,
initialize it when loading the native library.

R=ppi@chromium.org

Review URL: https://codereview.chromium.org/544603002

Cr-Commit-Position: refs/heads/master@{#293475}
parent 2ee5f5df
......@@ -9,6 +9,8 @@
#include "mojo/android/javatests/mojo_test_case.h"
#include "mojo/android/javatests/validation_test_util.h"
#include "mojo/android/system/core_impl.h"
#include "mojo/embedder/embedder.h"
#include "mojo/embedder/simple_platform_support.h"
namespace {
......@@ -38,5 +40,8 @@ JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
if (!RegisterMojoJni(env))
return -1;
mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>(
new mojo::embedder::SimplePlatformSupport()));
return JNI_VERSION_1_4;
}
......@@ -13,8 +13,6 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "jni/CoreImpl_jni.h"
#include "mojo/embedder/embedder.h"
#include "mojo/embedder/simple_platform_support.h"
#include "mojo/public/c/environment/async_waiter.h"
#include "mojo/public/c/system/core.h"
#include "mojo/public/cpp/environment/environment.h"
......@@ -51,11 +49,6 @@ void AsyncWaitCallback(void* data, MojoResult result) {
namespace mojo {
namespace android {
static void Constructor(JNIEnv* env, jobject jcaller) {
embedder::Init(scoped_ptr<embedder::PlatformSupport>(
new embedder::SimplePlatformSupport()));
}
static jlong GetTimeTicksNow(JNIEnv* env, jobject jcaller) {
return MojoGetTimeTicksNow();
}
......
......@@ -64,7 +64,6 @@ public class CoreImpl implements Core, AsyncWaiter {
}
private CoreImpl() {
nativeConstructor();
}
/**
......@@ -612,8 +611,6 @@ public class CoreImpl implements Core, AsyncWaiter {
return result;
}
private native void nativeConstructor();
private native long nativeGetTimeTicksNow();
private native int nativeWaitMany(ByteBuffer buffer, long deadline);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment