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); |
+}; |