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

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

Powered by Google App Engine
This is Rietveld 408576698