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 org.chromium.base.annotations.CalledByNative; | |
| 8 import org.chromium.base.annotations.JNINamespace; | |
| 9 | |
| 10 /** | |
| 11 * 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
| |
| 12 * to the right thread for callbacks, and handle async deletion of the native | |
| 13 * 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.
| |
| 14 * always created locally with respect to the JNI calls. There's no need to | |
| 15 * wrap a remote instance for JNI. | |
| 16 */ | |
| 17 @JNINamespace("media") | |
| 18 class DialogSurfaceCallback extends IDialogSurfaceCallback.Stub { | |
| 19 private final long mNativeId; | |
| 20 | |
| 21 public DialogSurfaceCallback(long nativeId) { | |
| 22 mNativeId = nativeId; | |
| 23 } | |
| 24 | |
| 25 @CalledByNative | |
| 26 public static DialogSurfaceCallback create(long nativeId) { | |
| 27 return new DialogSurfaceCallback(nativeId); | |
| 28 } | |
| 29 | |
| 30 @Override | |
| 31 public void onCallback(int what) { | |
| 32 nativeOnDialogSurfaceCallbackCallback(mNativeId, what); | |
| 33 } | |
| 34 | |
| 35 private static native void nativeOnDialogSurfaceCallbackCallback(long id, in t what); | |
| 36 }; | |
| OLD | NEW |