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

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

Issue 2525483005: Remove SurfaceTextureManager (Closed)
Patch Set: Fix link error Created 4 years 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/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 bf342828ab96f37af6f325348fc88c954a72cf99..4d58ca080f326b1454371c44c01de56e6ad3d701 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
@@ -8,12 +8,10 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
-import android.graphics.SurfaceTexture;
import android.os.Bundle;
import android.os.ParcelFileDescriptor;
import android.os.RemoteException;
import android.text.TextUtils;
-import android.util.Pair;
import android.view.Surface;
import org.chromium.base.CommandLine;
@@ -491,10 +489,6 @@ public class ChildProcessLauncher {
// Manages oom bindings used to bind chind services.
private static BindingManager sBindingManager = BindingManagerImpl.createBindingManager();
- // Map from surface texture id to Surface.
- private static Map<Pair<Integer, Integer>, Surface> sSurfaceTextureSurfaceMap =
- new ConcurrentHashMap<Pair<Integer, Integer>, Surface>();
-
// Whether the main application is currently brought to the foreground.
private static boolean sApplicationInForeground = true;
@@ -509,46 +503,6 @@ public class ChildProcessLauncher {
return sBindingManager.isOomProtected(pid);
}
- private static void registerSurfaceTextureSurface(
- int surfaceTextureId, int clientId, Surface surface) {
- Pair<Integer, Integer> key = new Pair<Integer, Integer>(surfaceTextureId, clientId);
- sSurfaceTextureSurfaceMap.put(key, surface);
- }
-
- private static void unregisterSurfaceTextureSurface(int surfaceTextureId, int clientId) {
- Pair<Integer, Integer> key = new Pair<Integer, Integer>(surfaceTextureId, clientId);
- Surface surface = sSurfaceTextureSurfaceMap.remove(key);
- if (surface == null) return;
-
- assert surface.isValid();
- surface.release();
- }
-
- @CalledByNative
- private static void createSurfaceTextureSurface(
- int surfaceTextureId, int clientId, SurfaceTexture surfaceTexture) {
- registerSurfaceTextureSurface(surfaceTextureId, clientId, new Surface(surfaceTexture));
- }
-
- @CalledByNative
- private static void destroySurfaceTextureSurface(int surfaceTextureId, int clientId) {
- unregisterSurfaceTextureSurface(surfaceTextureId, clientId);
- }
-
- @CalledByNative
- private static SurfaceWrapper getSurfaceTextureSurface(
- int surfaceTextureId, int clientId) {
- Pair<Integer, Integer> key = new Pair<Integer, Integer>(surfaceTextureId, clientId);
-
- Surface surface = sSurfaceTextureSurfaceMap.get(key);
- if (surface == null) {
- Log.e(TAG, "Invalid Id for surface texture.");
- return null;
- }
- assert surface.isValid();
- return new SurfaceWrapper(surface);
- }
-
/**
* Sets the visibility of the child process when it changes or when it is determined for the
* first time.
@@ -869,40 +823,6 @@ public class ChildProcessLauncher {
}
return new SurfaceWrapper(surface);
}
-
- @Override
- public void registerSurfaceTextureSurface(
- int surfaceTextureId, int clientId, Surface surface) {
- if (callbackType != CALLBACK_FOR_GPU_PROCESS) {
- Log.e(TAG, "Illegal callback for non-GPU process.");
- return;
- }
-
- ChildProcessLauncher.registerSurfaceTextureSurface(surfaceTextureId, clientId,
- surface);
- }
-
- @Override
- public void unregisterSurfaceTextureSurface(
- int surfaceTextureId, int clientId) {
- if (callbackType != CALLBACK_FOR_GPU_PROCESS) {
- Log.e(TAG, "Illegal callback for non-GPU process.");
- return;
- }
-
- ChildProcessLauncher.unregisterSurfaceTextureSurface(surfaceTextureId, clientId);
- }
-
- @Override
- public SurfaceWrapper getSurfaceTextureSurface(int surfaceTextureId) {
- if (callbackType != CALLBACK_FOR_RENDERER_PROCESS) {
- Log.e(TAG, "Illegal callback for non-renderer process.");
- return null;
- }
-
- return ChildProcessLauncher.getSurfaceTextureSurface(surfaceTextureId,
- childProcessId);
- }
};
}

Powered by Google App Engine
This is Rietveld 408576698