Index: media/base/android/java/src/org/chromium/media/DialogSurfaceCallback.java |
diff --git a/media/base/android/java/src/org/chromium/media/DialogSurfaceCallback.java b/media/base/android/java/src/org/chromium/media/DialogSurfaceCallback.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b4911e041c027a741d6d523681f1f1262882ad5f |
--- /dev/null |
+++ b/media/base/android/java/src/org/chromium/media/DialogSurfaceCallback.java |
@@ -0,0 +1,34 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package org.chromium.media; |
+ |
+import org.chromium.base.annotations.CalledByNative; |
+import org.chromium.base.annotations.JNINamespace; |
+ |
+/** |
+ * Callback helper for native. This works with our JNI implementation to hop |
+ * to the right thread for callbacks, and handle async deletion of the native |
+ * object. It directly implemens the aidl interface also. |
+ */ |
+@JNINamespace("media") |
+class DialogSurfaceCallback extends IDialogSurfaceCallback.Stub { |
+ private final long mNativeId; |
+ |
+ public DialogSurfaceCallback(long nativeId) { |
+ mNativeId = nativeId; |
+ } |
+ |
+ @CalledByNative |
+ public static DialogSurfaceCallback create(long nativeId) { |
+ return new DialogSurfaceCallback(nativeId); |
+ } |
+ |
+ @Override |
+ public void onCallback(int what) { |
+ nativeOnDialogSurfaceCallbackCallback(mNativeId, what); |
+ } |
+ |
+ private static native void nativeOnDialogSurfaceCallbackCallback(long id, int what); |
+}; |