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

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

Issue 1889703002: Android Java Surfaces can now be looked up via GpuSurfaceTracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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
« no previous file with comments | « content/browser/gpu/gpu_surface_tracker.cc ('k') | gpu/ipc/common/gpu_surface_lookup.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
index d0815e4f52bdbb042b79f0b83bc8874f2037f827..a7f6527558dff04d8ce85ba9a4e489cab12e90ae 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
@@ -484,6 +484,20 @@ public class ChildProcessLauncher {
sViewSurfaceMap.remove(surfaceId);
}
+ @CalledByNative
+ private static Surface getViewSurface(int surfaceId) {
+ Surface surface = sViewSurfaceMap.get(surfaceId);
+ if (surface == null) {
+ Log.e(TAG, "Invalid surfaceId.");
+ return null;
+ }
+ if (!surface.isValid()) {
+ Log.e(TAG, "Requested surface is not valid.");
+ return null;
+ }
+ return surface;
+ }
+
private static void registerSurfaceTextureSurface(
int surfaceTextureId, int clientId, Surface surface) {
Pair<Integer, Integer> key = new Pair<Integer, Integer>(surfaceTextureId, clientId);
@@ -826,14 +840,8 @@ public class ChildProcessLauncher {
Log.e(TAG, "Illegal callback for non-GPU process.");
return null;
}
-
- Surface surface = sViewSurfaceMap.get(surfaceId);
+ Surface surface = ChildProcessLauncher.getViewSurface(surfaceId);
if (surface == null) {
- Log.e(TAG, "Invalid surfaceId.");
- return null;
- }
- if (!surface.isValid()) {
- Log.e(TAG, "Requested surface is not valid.");
return null;
}
return new SurfaceWrapper(surface);
« no previous file with comments | « content/browser/gpu/gpu_surface_tracker.cc ('k') | gpu/ipc/common/gpu_surface_lookup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698