summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBo Liu <boliu@google.com>2014-03-21 12:15:14 -0700
committerBo Liu <boliu@google.com>2014-03-21 13:20:59 -0700
commit3579d6fb5d979d2d03a6250e82c37d81d672291e (patch)
tree3a81701404bc322e71fcca1f458fcb7dc970f961
parent735a433faa4c304f09f2b27bee1854cbe7e5c740 (diff)
downloadwebview-3579d6fb5d979d2d03a6250e82c37d81d672291e.tar.gz
Convert pointers to long to support x64
This matches https://codereview.chromium.org/205533006/ Change-Id: I27382a8ffc09d7b24866d903cc1099d9a7483c5f
-rw-r--r--chromium/java/com/android/webview/chromium/DrawGLFunctor.java14
-rw-r--r--chromium/plat_support/draw_gl_functor.cpp18
2 files changed, 16 insertions, 16 deletions
diff --git a/chromium/java/com/android/webview/chromium/DrawGLFunctor.java b/chromium/java/com/android/webview/chromium/DrawGLFunctor.java
index 88a535e..fac5caf 100644
--- a/chromium/java/com/android/webview/chromium/DrawGLFunctor.java
+++ b/chromium/java/com/android/webview/chromium/DrawGLFunctor.java
@@ -35,7 +35,7 @@ class DrawGLFunctor {
private CleanupReference mCleanupReference;
private DestroyRunnable mDestroyRunnable;
- public DrawGLFunctor(int viewContext) {
+ public DrawGLFunctor(long viewContext) {
mDestroyRunnable = new DestroyRunnable(nativeCreateGLFunctor(viewContext));
mCleanupReference = new CleanupReference(this, mDestroyRunnable);
}
@@ -65,7 +65,7 @@ class DrawGLFunctor {
return true;
}
- public static void setChromiumAwDrawGLFunction(int functionPointer) {
+ public static void setChromiumAwDrawGLFunction(long functionPointer) {
nativeSetChromiumAwDrawGLFunction(functionPointer);
}
@@ -74,8 +74,8 @@ class DrawGLFunctor {
// instance, as that will defeat GC of that object.
private static final class DestroyRunnable implements Runnable {
ViewRootImpl mViewRootImpl;
- int mNativeDrawGLFunctor;
- DestroyRunnable(int nativeDrawGLFunctor) {
+ long mNativeDrawGLFunctor;
+ DestroyRunnable(long nativeDrawGLFunctor) {
mNativeDrawGLFunctor = nativeDrawGLFunctor;
}
@@ -95,7 +95,7 @@ class DrawGLFunctor {
}
}
- private static native int nativeCreateGLFunctor(int viewContext);
- private static native void nativeDestroyGLFunctor(int functor);
- private static native void nativeSetChromiumAwDrawGLFunction(int functionPointer);
+ private static native long nativeCreateGLFunctor(long viewContext);
+ private static native void nativeDestroyGLFunctor(long functor);
+ private static native void nativeSetChromiumAwDrawGLFunction(long functionPointer);
}
diff --git a/chromium/plat_support/draw_gl_functor.cpp b/chromium/plat_support/draw_gl_functor.cpp
index fd128eb..ab8878c 100644
--- a/chromium/plat_support/draw_gl_functor.cpp
+++ b/chromium/plat_support/draw_gl_functor.cpp
@@ -40,7 +40,7 @@ AwDrawGLFunction* g_aw_drawgl_function = NULL;
class DrawGLFunctor : public Functor {
public:
- DrawGLFunctor(jint view_context) : view_context_(view_context) {}
+ DrawGLFunctor(jlong view_context) : view_context_(view_context) {}
virtual ~DrawGLFunctor() {}
// Functor
@@ -77,7 +77,7 @@ class DrawGLFunctor : public Functor {
}
private:
- int view_context_;
+ intptr_t view_context_;
};
// Raise the file handle soft limit to the hard limit since gralloc buffers
@@ -101,26 +101,26 @@ void RaiseFileNumberLimit() {
}
}
-jint CreateGLFunctor(JNIEnv*, jclass, jint view_context) {
+jlong CreateGLFunctor(JNIEnv*, jclass, jlong view_context) {
RaiseFileNumberLimit();
- return reinterpret_cast<jint>(new DrawGLFunctor(view_context));
+ return reinterpret_cast<jlong>(new DrawGLFunctor(view_context));
}
-void DestroyGLFunctor(JNIEnv*, jclass, jint functor) {
+void DestroyGLFunctor(JNIEnv*, jclass, jlong functor) {
delete reinterpret_cast<DrawGLFunctor*>(functor);
}
-void SetChromiumAwDrawGLFunction(JNIEnv*, jclass, jint draw_function) {
+void SetChromiumAwDrawGLFunction(JNIEnv*, jclass, jlong draw_function) {
g_aw_drawgl_function = reinterpret_cast<AwDrawGLFunction*>(draw_function);
}
const char kClassName[] = "com/android/webview/chromium/DrawGLFunctor";
const JNINativeMethod kJniMethods[] = {
- { "nativeCreateGLFunctor", "(I)I",
+ { "nativeCreateGLFunctor", "(J)J",
reinterpret_cast<void*>(CreateGLFunctor) },
- { "nativeDestroyGLFunctor", "(I)V",
+ { "nativeDestroyGLFunctor", "(J)V",
reinterpret_cast<void*>(DestroyGLFunctor) },
- { "nativeSetChromiumAwDrawGLFunction", "(I)V",
+ { "nativeSetChromiumAwDrawGLFunction", "(J)V",
reinterpret_cast<void*>(SetChromiumAwDrawGLFunction) },
};