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

Side by Side Diff: content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.app; 5 package org.chromium.content.app;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.content.Intent; 8 import android.content.Intent;
9 import android.graphics.SurfaceTexture; 9 import android.graphics.SurfaceTexture;
10 import android.os.Binder; 10 import android.os.Binder;
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 return; 362 return;
363 } finally { 363 } finally {
364 if (needRelease) { 364 if (needRelease) {
365 surface.release(); 365 surface.release();
366 } 366 }
367 } 367 }
368 } 368 }
369 369
370 @SuppressWarnings("unused") 370 @SuppressWarnings("unused")
371 @CalledByNative 371 @CalledByNative
372 private void forwardSurfaceTextureForSurfaceRequest(
373 long requestTokenHigh, long requestTokenLow, SurfaceTexture surfaceT exture) {
374 if (mCallback == null) {
375 Log.e(TAG, "No callback interface has been provided.");
376 return;
377 }
378
379 Surface surface = new Surface(surfaceTexture);
380
381 try {
382 mCallback.forwardSurfaceForSurfaceRequest(requestTokenHigh, requestT okenLow, surface);
383 } catch (RemoteException e) {
384 Log.e(TAG, "Unable to call forwardSurfaceForSurfaceRequest: %s", e);
385 return;
386 } finally {
387 surface.release();
388 }
389 }
390
391 @SuppressWarnings("unused")
392 @CalledByNative
372 private Surface getViewSurface(int surfaceId) { 393 private Surface getViewSurface(int surfaceId) {
373 if (mCallback == null) { 394 if (mCallback == null) {
374 Log.e(TAG, "No callback interface has been provided."); 395 Log.e(TAG, "No callback interface has been provided.");
375 return null; 396 return null;
376 } 397 }
377 398
378 try { 399 try {
379 SurfaceWrapper wrapper = mCallback.getViewSurface(surfaceId); 400 SurfaceWrapper wrapper = mCallback.getViewSurface(surfaceId);
380 return wrapper != null ? wrapper.getSurface() : null; 401 return wrapper != null ? wrapper.getSurface() : null;
381 } catch (RemoteException e) { 402 } catch (RemoteException e) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 private static native void nativeInitChildProcessImpl( 472 private static native void nativeInitChildProcessImpl(
452 ChildProcessServiceImpl serviceImpl, int cpuCount, long cpuFeatures) ; 473 ChildProcessServiceImpl serviceImpl, int cpuCount, long cpuFeatures) ;
453 474
454 /** 475 /**
455 * Force the child process to exit. 476 * Force the child process to exit.
456 */ 477 */
457 private static native void nativeExitChildProcess(); 478 private static native void nativeExitChildProcess();
458 479
459 private native void nativeShutdownMainThread(); 480 private native void nativeShutdownMainThread();
460 } 481 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698