Skip to content

Commit

Permalink
Android: moves base/ to use long for JNI.
Browse files Browse the repository at this point in the history
Follow up from crrev.com/234212

BUG=317523

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235725 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
bulach@chromium.org committed Nov 18, 2013
1 parent dafd8d3 commit 6f6a494
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class SystemMessageHandler extends Handler {
private static final int DELAYED_TIMER_MESSAGE = 2;

// Native class pointer set by the constructor of the SharedClient native class.
private int mMessagePumpDelegateNative = 0;
private long mMessagePumpDelegateNative = 0;

private SystemMessageHandler(int messagePumpDelegateNative) {
private SystemMessageHandler(long messagePumpDelegateNative) {
mMessagePumpDelegateNative = messagePumpDelegateNative;
}

Expand Down Expand Up @@ -47,9 +47,9 @@ private void removeTimer() {
}

@CalledByNative
private static SystemMessageHandler create(int messagePumpDelegateNative) {
private static SystemMessageHandler create(long messagePumpDelegateNative) {
return new SystemMessageHandler(messagePumpDelegateNative);
}

private native void nativeDoRunLoopOnce(int messagePumpDelegateNative);
private native void nativeDoRunLoopOnce(long messagePumpDelegateNative);
}
5 changes: 3 additions & 2 deletions base/message_loop/message_pump_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using base::android::ScopedJavaLocalRef;
// ----------------------------------------------------------------------------
// This method can not move to anonymous namespace as it has been declared as
// 'static' in system_message_handler_jni.h.
static void DoRunLoopOnce(JNIEnv* env, jobject obj, jint native_delegate) {
static void DoRunLoopOnce(JNIEnv* env, jobject obj, jlong native_delegate) {
base::MessagePump::Delegate* delegate =
reinterpret_cast<base::MessagePump::Delegate*>(native_delegate);
DCHECK(delegate);
Expand Down Expand Up @@ -81,7 +81,8 @@ void MessagePumpForUI::Start(Delegate* delegate) {
DCHECK(env);

system_message_handler_obj_.Reset(
Java_SystemMessageHandler_create(env, reinterpret_cast<jint>(delegate)));
Java_SystemMessageHandler_create(
env, reinterpret_cast<intptr_t>(delegate)));
}

void MessagePumpForUI::Quit() {
Expand Down

0 comments on commit 6f6a494

Please sign in to comment.