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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/GpuProcessCallback.java

Issue 2760093002: Making callbacks in Android ChildProcessLauncher generic. (Closed)
Patch Set: Synced Created 3 years, 9 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: content/public/android/java/src/org/chromium/content/browser/GpuProcessCallback.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/GpuProcessCallback.java b/content/public/android/java/src/org/chromium/content/browser/GpuProcessCallback.java
new file mode 100644
index 0000000000000000000000000000000000000000..472f855eb6930d770057152cab823e0359fefca9
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/GpuProcessCallback.java
@@ -0,0 +1,35 @@
+// Copyright 2017 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.content.browser;
+
+import android.view.Surface;
+
+import org.chromium.base.UnguessableToken;
+import org.chromium.base.annotations.JNINamespace;
+import org.chromium.content.common.IGpuProcessCallback;
+import org.chromium.content.common.SurfaceWrapper;
+
+@JNINamespace("content")
+class GpuProcessCallback extends IGpuProcessCallback.Stub {
+ GpuProcessCallback() {}
+
+ @Override
+ public void forwardSurfaceForSurfaceRequest(UnguessableToken requestToken, Surface surface) {
+ nativeCompleteScopedSurfaceRequest(requestToken, surface);
+ }
+
+ @Override
+ public SurfaceWrapper getViewSurface(int surfaceId) {
+ Surface surface = nativeGetViewSurface(surfaceId);
+ if (surface == null) {
+ return null;
+ }
+ return new SurfaceWrapper(surface);
+ }
+
+ private static native void nativeCompleteScopedSurfaceRequest(
+ UnguessableToken requestToken, Surface surface);
+ private static native Surface nativeGetViewSurface(int surfaceId);
+};

Powered by Google App Engine
This is Rietveld 408576698