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

Unified Diff: media/base/android/java/src/org/chromium/media/DialogSurfaceWrapper.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/DialogSurfaceWrapper.java
diff --git a/media/base/android/java/src/org/chromium/media/DialogSurfaceWrapper.java b/media/base/android/java/src/org/chromium/media/DialogSurfaceWrapper.java
new file mode 100644
index 0000000000000000000000000000000000000000..7ca0bfd0d1170c19b3834f551bca6766430b151c
--- /dev/null
+++ b/media/base/android/java/src/org/chromium/media/DialogSurfaceWrapper.java
@@ -0,0 +1,57 @@
+// 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 android.os.IBinder;
+import android.os.RemoteException;
+import android.view.Surface;
+
+import org.chromium.base.annotations.CalledByNative;
+import org.chromium.base.annotations.JNINamespace;
+
+/**
+ * Wrapper for IDialogSurface for JNI bindings.
+ *
+ * Makes any implementation of IDialogSurface accessible through JNI.
+ * Doesn't have to implement IDialogSurface, except that it's an easy
+ * way to keep the interface in sync.
+ */
+@JNINamespace("media")
+class DialogSurfaceWrapper implements IDialogSurface {
+ private final IDialogSurface mDialogSurface;
+
+ public DialogSurfaceWrapper(IDialogSurface dialogSurface) {
+ mDialogSurface = dialogSurface;
+ }
+
+ @CalledByNative
+ private static DialogSurfaceWrapper wrap(IDialogSurface dialogSurface) {
+ return new DialogSurfaceWrapper(dialogSurface);
+ }
+
+ @Override
+ @CalledByNative
+ public void release() throws RemoteException {
+ mDialogSurface.release();
+ }
+
+ @Override
+ @CalledByNative
+ public Surface getSurface() throws RemoteException {
+ return mDialogSurface.getSurface();
+ }
+
+ @Override
+ @CalledByNative
+ public void scheduleLayoutSurface(final int x, final int y, final int width, final int height)
+ throws RemoteException {
+ mDialogSurface.scheduleLayoutSurface(x, y, width, height);
+ }
+
+ @Override
+ public IBinder asBinder() {
+ return null;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698