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

Unified Diff: media/base/android/java/src/org/chromium/media/DialogSurfaceCallback.java

Issue 1967553002: DO NOT COMMIT - DialogSurface initial implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 4 years, 5 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
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);
+};

Powered by Google App Engine
This is Rietveld 408576698