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

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

Issue 2285593002: Add ScopedSurfaceRequestManager (Closed)
Patch Set: Changed JNI serialization to 2 longs Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.annotation.SuppressLint; 7 import android.annotation.SuppressLint;
8 import android.content.ComponentName; 8 import android.content.ComponentName;
9 import android.content.Context; 9 import android.content.Context;
10 import android.content.Intent; 10 import android.content.Intent;
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 // from stream textures managed by the GPU process. 905 // from stream textures managed by the GPU process.
906 if (callbackType != CALLBACK_FOR_GPU_PROCESS) { 906 if (callbackType != CALLBACK_FOR_GPU_PROCESS) {
907 Log.e(TAG, "Illegal callback for non-GPU process."); 907 Log.e(TAG, "Illegal callback for non-GPU process.");
908 return; 908 return;
909 } 909 }
910 910
911 nativeEstablishSurfacePeer(pid, surface, primaryID, secondaryID) ; 911 nativeEstablishSurfacePeer(pid, surface, primaryID, secondaryID) ;
912 } 912 }
913 913
914 @Override 914 @Override
915 public void forwardSurfaceForSurfaceRequest(
916 long requestTokenHigh, long requestTokenLow, Surface surface ) {
917 // Do not allow a malicious renderer to connect to a producer. T his is only used
918 // from stream textures managed by the GPU process.
919 if (callbackType != CALLBACK_FOR_GPU_PROCESS) {
920 Log.e(TAG, "Illegal callback for non-GPU process.");
921 return;
922 }
923
924 nativeCompleteScopedSurfaceRequest(requestTokenHigh, requestToke nLow, surface);
925 }
926
927 @Override
915 public SurfaceWrapper getViewSurface(int surfaceId) { 928 public SurfaceWrapper getViewSurface(int surfaceId) {
916 // Do not allow a malicious renderer to get to our view surface. 929 // Do not allow a malicious renderer to get to our view surface.
917 if (callbackType != CALLBACK_FOR_GPU_PROCESS) { 930 if (callbackType != CALLBACK_FOR_GPU_PROCESS) {
918 Log.e(TAG, "Illegal callback for non-GPU process."); 931 Log.e(TAG, "Illegal callback for non-GPU process.");
919 return null; 932 return null;
920 } 933 }
921 Surface surface = ChildProcessLauncher.getViewSurface(surfaceId) ; 934 Surface surface = ChildProcessLauncher.getViewSurface(surfaceId) ;
922 if (surface == null) { 935 if (surface == null) {
923 return null; 936 return null;
924 } 937 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1052 } catch (RemoteException ex) { 1065 } catch (RemoteException ex) {
1053 return false; 1066 return false;
1054 } 1067 }
1055 1068
1056 return true; 1069 return true;
1057 } 1070 }
1058 1071
1059 private static native void nativeOnChildProcessStarted(long clientContext, i nt pid); 1072 private static native void nativeOnChildProcessStarted(long clientContext, i nt pid);
1060 private static native void nativeEstablishSurfacePeer( 1073 private static native void nativeEstablishSurfacePeer(
1061 int pid, Surface surface, int primaryID, int secondaryID); 1074 int pid, Surface surface, int primaryID, int secondaryID);
1075 private static native void nativeCompleteScopedSurfaceRequest(
1076 long requestTokenHigh, long requestTokenLow, Surface surface);
1062 private static native boolean nativeIsSingleProcess(); 1077 private static native boolean nativeIsSingleProcess();
1063 } 1078 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698