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

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: added check for gpu process for dialog surface manager. Created 4 years, 6 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..69a5cca5641b1bf686f3cc25f628f897c73e4796
--- /dev/null
+++ b/media/base/android/java/src/org/chromium/media/DialogSurfaceCallback.java
@@ -0,0 +1,36 @@
+// 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
watk 2016/06/10 21:46:38 Maybe a naive question, but I wonder if you consid
liberato (no reviews please) 2016/06/10 22:50:05 unfortunately, i don't think that will work. in o
+ * to the right thread for callbacks, and handle async deletion of the native
+ * object. This isn't a wrapper because it's only used for native, and it's
watk 2016/06/10 21:46:38 Probably could delete the wrapper comment since it
liberato (no reviews please) 2016/06/10 22:50:05 Done.
+ * always created locally with respect to the JNI calls. There's no need to
+ * wrap a remote instance for JNI.
+ */
+@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