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

Side by Side Diff: media/base/android/java/src/org/chromium/media/AndroidOverlayCallback.java

Issue 2178973004: DialogSurfaceManager implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 3 years, 10 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 unified diff | Download patch
OLDNEW
(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.RemoteException;
8 import android.view.Surface;
9
10 import org.chromium.base.annotations.CalledByNative;
11 import org.chromium.base.annotations.JNINamespace;
12
13 /**
14 * Callback helper for native. This works with our JNI implementation to hop
15 * to the right thread for callbacks, and handle async deletion of the native
16 * object. It directly implemens the aidl interface also.
17 */
18 @JNINamespace("media")
19 class AndroidOverlayCallback extends IAndroidOverlayCallback.Stub {
20 private final long mNativeId;
21
22 public AndroidOverlayCallback(long nativeId) {
boliu 2017/02/08 00:01:58 private
23 mNativeId = nativeId;
24 }
25
26 @CalledByNative
27 public static AndroidOverlayCallback create(long nativeId) {
boliu 2017/02/08 00:01:58 private
28 return new AndroidOverlayCallback(nativeId);
29 }
30
31 @Override
32 public void onCreated(Surface surface) {
33 nativeOnAndroidOverlayCallbackCreated(mNativeId, surface);
34 }
35
36 @Override
37 public void onDestroyed(IAndroidOverlayCompletion completion) {
38 nativeOnAndroidOverlayCallbackDestroyed(mNativeId, completion);
39 }
40
41 @CalledByNative
42 private static void signalCompletion(IAndroidOverlayCompletion completion) {
43 try {
44 if (completion != null) completion.signalComplete();
45 } catch (RemoteException e) {
boliu 2017/02/08 00:01:58 Feel free to Log.d errors like this, Log.d is stri
46 }
47 }
48
49 private static native void nativeOnAndroidOverlayCallbackCreated(long id, Su rface surface);
50 private static native void nativeOnAndroidOverlayCallbackDestroyed(
51 long id, IAndroidOverlayCompletion completion);
52 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698