Chromium Code Reviews| 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..3eb31baac499a597c2631b31cbd541ec511c5dbb |
| --- /dev/null |
| +++ b/media/base/android/java/src/org/chromium/media/DialogSurfaceWrapper.java |
| @@ -0,0 +1,50 @@ |
| +// 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 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 surface) { |
|
boliu
2017/01/04 01:48:45
private?
liberato (no reviews please)
2017/01/11 22:17:58
good point, done.
|
| + mDialogSurface = surface; |
| + } |
| + |
| + @CalledByNative |
| + private static DialogSurfaceWrapper wrap(IDialogSurface surface) { |
| + return new DialogSurfaceWrapper(surface); |
| + } |
| + |
| + @Override |
| + @CalledByNative |
| + public void release() throws RemoteException { |
|
boliu
2017/01/04 01:48:44
throwing exception doesn't really work for CalledB
liberato (no reviews please)
2017/01/11 22:17:58
yeah, they can be ignored.
|
| + mDialogSurface.release(); |
| + } |
| + |
| + @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() { |
|
boliu
2017/01/04 01:48:45
does returning null here work? won't that break...
liberato (no reviews please)
2017/01/11 22:17:58
i don't think that returning null here will break
boliu
2017/01/12 20:24:19
I feel is still leads to too much confusion.
liberato (no reviews please)
2017/02/03 21:28:32
per our offline renaming discussion, this won't be
|
| + return null; |
| + } |
| +} |