Chromium Code Reviews| Index: media/base/android/java/src/org/chromium/media/DialogSurfaceCallback.java |
| diff --git a/media/base/android/java/src/org/chromium/media/DialogSurfaceCallback.java b/media/base/android/java/src/org/chromium/media/DialogSurfaceCallback.java |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..69a5cca5641b1bf686f3cc25f628f897c73e4796 |
| --- /dev/null |
| +++ b/media/base/android/java/src/org/chromium/media/DialogSurfaceCallback.java |
| @@ -0,0 +1,36 @@ |
| +// 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 org.chromium.base.annotations.CalledByNative; |
| +import org.chromium.base.annotations.JNINamespace; |
| + |
| +/** |
| + * 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
|
| + * to the right thread for callbacks, and handle async deletion of the native |
| + * 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.
|
| + * always created locally with respect to the JNI calls. There's no need to |
| + * wrap a remote instance for JNI. |
| + */ |
| +@JNINamespace("media") |
| +class DialogSurfaceCallback extends IDialogSurfaceCallback.Stub { |
| + private final long mNativeId; |
| + |
| + public DialogSurfaceCallback(long nativeId) { |
| + mNativeId = nativeId; |
| + } |
| + |
| + @CalledByNative |
| + public static DialogSurfaceCallback create(long nativeId) { |
| + return new DialogSurfaceCallback(nativeId); |
| + } |
| + |
| + @Override |
| + public void onCallback(int what) { |
| + nativeOnDialogSurfaceCallbackCallback(mNativeId, what); |
| + } |
| + |
| + private static native void nativeOnDialogSurfaceCallbackCallback(long id, int what); |
| +}; |