Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 package org.chromium.media; | |
| 6 | |
| 7 import android.os.IBinder; | |
| 8 import android.os.RemoteException; | |
| 9 | |
| 10 import org.chromium.base.annotations.CalledByNative; | |
| 11 import org.chromium.base.annotations.JNINamespace; | |
| 12 | |
| 13 /** | |
| 14 * Wrapper for IDialogSurface for JNI bindings. | |
| 15 * | |
| 16 * Makes any implementation of IDialogSurface accessible through JNI. | |
| 17 * Doesn't have to implement IDialogSurface, except that it's an easy | |
| 18 * way to keep the interface in sync. | |
| 19 */ | |
| 20 @JNINamespace("media") | |
| 21 class DialogSurfaceWrapper implements IDialogSurface { | |
| 22 private final IDialogSurface mDialogSurface; | |
| 23 | |
| 24 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.
| |
| 25 mDialogSurface = surface; | |
| 26 } | |
| 27 | |
| 28 @CalledByNative | |
| 29 private static DialogSurfaceWrapper wrap(IDialogSurface surface) { | |
| 30 return new DialogSurfaceWrapper(surface); | |
| 31 } | |
| 32 | |
| 33 @Override | |
| 34 @CalledByNative | |
| 35 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.
| |
| 36 mDialogSurface.release(); | |
| 37 } | |
| 38 | |
| 39 @Override | |
| 40 @CalledByNative | |
| 41 public void scheduleLayoutSurface(final int x, final int y, final int width, final int height) | |
| 42 throws RemoteException { | |
| 43 mDialogSurface.scheduleLayoutSurface(x, y, width, height); | |
| 44 } | |
| 45 | |
| 46 @Override | |
| 47 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
| |
| 48 return null; | |
| 49 } | |
| 50 } | |
| OLD | NEW |