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

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

Issue 195583003: Add initial GpuMemoryBufferSurfaceTexture implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 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/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 d44163fa12cadfae7b9d276501a2452fb8b0e145..d88305c7f56044dfdd01435744fdb23837213a62 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
@@ -305,6 +305,7 @@ public class ChildProcessLauncher {
static void start(
Context context,
final String[] commandLine,
+ int childProcessId,
int[] fileIds,
int[] fileFds,
boolean[] fileAutoClose,
@@ -366,7 +367,7 @@ public class ChildProcessLauncher {
connection.setupConnection(commandLine,
filesToBeMapped,
- createCallback(callbackType),
+ createCallback(childProcessId, callbackType),
connectionCallback,
Linker.getSharedRelros());
}
@@ -392,7 +393,8 @@ public class ChildProcessLauncher {
/**
* This implementation is used to receive callbacks from the remote service.
*/
- private static IChildProcessCallback createCallback(final int callbackType) {
+ private static IChildProcessCallback createCallback(
+ final int childProcessId, final int callbackType) {
return new IChildProcessCallback.Stub() {
/**
* This is called by the remote service regularly to tell us about new values. Note that
@@ -423,6 +425,21 @@ public class ChildProcessLauncher {
return nativeGetViewSurface(surfaceId);
}
+
+ @Override
+ public Surface getSurfaceTextureSurface(int primaryId, int secondaryId) {
+ if (callbackType != CALLBACK_FOR_RENDERER_PROCESS) {
+ Log.e(TAG, "Illegal callback for non-renderer process.");
+ return null;
+ }
+
+ if (secondaryId != childProcessId) {
+ Log.e(TAG, "Illegal secondaryId for renderer process.");
+ return null;
+ }
+
+ return nativeGetSurfaceTextureSurface(primaryId, secondaryId);
+ }
};
}
@@ -435,6 +452,8 @@ public class ChildProcessLauncher {
private static native void nativeOnChildProcessStarted(long clientContext, int pid);
private static native Surface nativeGetViewSurface(int surfaceId);
+ private static native Surface nativeGetSurfaceTextureSurface(
+ int surfaceTextureId, int childProcessId);
private static native void nativeEstablishSurfacePeer(
int pid, Surface surface, int primaryID, int secondaryID);
private static native boolean nativeIsSingleProcess();

Powered by Google App Engine
This is Rietveld 408576698