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

Unified Diff: media/base/android/java/src/org/chromium/media/AndroidOverlayProviderProxy.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 side-by-side diff with in-line comments
Download patch
Index: media/base/android/java/src/org/chromium/media/AndroidOverlayProviderProxy.java
diff --git a/media/base/android/java/src/org/chromium/media/AndroidOverlayProviderProxy.java b/media/base/android/java/src/org/chromium/media/AndroidOverlayProviderProxy.java
new file mode 100644
index 0000000000000000000000000000000000000000..2682fa4b85691e5eace47f9b1eb3f7fe51601faf
--- /dev/null
+++ b/media/base/android/java/src/org/chromium/media/AndroidOverlayProviderProxy.java
@@ -0,0 +1,46 @@
+// 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 IAndroidOverlayProvider, to provide JNI bindings for arbitrary
+ * implementations of IAndroidOverlayProvider. In practice, there is one: the
+ * IBinder stub we get from the browser. However, if one creates a local
+ * provider such as in the GPU process, then this will work too.
+ *
+ * When one gets an IAndroidOverlayProvider, whether remote from the browser or
+ * local (if supported), it can be used by native classes by wrapping it in a
+ * AndroidOverlayProviderWrapper instance.
+ *
+ * Note that all of that is wrapped in the C++ bindings for this class, so see
+ * the docs in android_overlay_provider.h if you'd like to use this in C++.
+ * There's no need to use it in Java.
+ */
+@JNINamespace("media")
+class AndroidOverlayProviderProxy {
+ private final IAndroidOverlayProvider mProvider;
+
+ private AndroidOverlayProviderProxy(IAndroidOverlayProvider provider) {
+ mProvider = provider;
+ }
+
+ @CalledByNative
+ private static AndroidOverlayProviderProxy wrap(IBinder provider) {
+ return new AndroidOverlayProviderProxy(IAndroidOverlayProvider.Stub.asInterface(provider));
+ }
+
+ @CalledByNative
+ public IAndroidOverlay createOverlay(int rendererPid, int renderFrameId,
+ IAndroidOverlayCallback callback, int x, int y, int width, int height)
+ throws RemoteException {
boliu 2017/02/08 00:01:59 any exception thrown by @CalledByNative methods wi
+ return mProvider.createOverlay(rendererPid, renderFrameId, callback, x, y, width, height);
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698