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

Unified Diff: services/native_viewport/android/src/org/chromium/mojo/PlatformViewportAndroid.java

Issue 1081443005: Make the C++ PlatformViewportAndroid's dtor call the Java PVA's destroy() method. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: use a weak ref instead Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | services/native_viewport/platform_viewport_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/native_viewport/android/src/org/chromium/mojo/PlatformViewportAndroid.java
diff --git a/services/native_viewport/android/src/org/chromium/mojo/PlatformViewportAndroid.java b/services/native_viewport/android/src/org/chromium/mojo/PlatformViewportAndroid.java
index 15eb96cbcf876632bf7c91725da553c888bdc851..189bc0760031ab593e89a0700ec2b4617e9eaab2 100644
--- a/services/native_viewport/android/src/org/chromium/mojo/PlatformViewportAndroid.java
+++ b/services/native_viewport/android/src/org/chromium/mojo/PlatformViewportAndroid.java
@@ -25,10 +25,12 @@ public class PlatformViewportAndroid extends SurfaceView {
private long mNativeMojoViewport;
private final SurfaceHolder.Callback mSurfaceCallback;
- @SuppressWarnings("unused")
@CalledByNative
- public static void createForActivity(Activity activity, long nativeViewport) {
- activity.setContentView(new PlatformViewportAndroid(activity, nativeViewport));
+ public static PlatformViewportAndroid createForActivity(
+ Activity activity, long nativeViewport) {
+ PlatformViewportAndroid rv = new PlatformViewportAndroid(activity, nativeViewport);
+ activity.setContentView(rv);
+ return rv;
}
public PlatformViewportAndroid(Context context, long nativeViewport) {
@@ -65,10 +67,9 @@ public class PlatformViewportAndroid extends SurfaceView {
}
- // TODO(abarth): Someone needs to call destroy at some point.
- public void destroy() {
+ @CalledByNative
+ public void detach() {
getHolder().removeCallback(mSurfaceCallback);
- nativeDestroy(mNativeMojoViewport);
mNativeMojoViewport = 0;
}
« no previous file with comments | « no previous file | services/native_viewport/platform_viewport_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698