本文整理汇总了Java中org.chromium.content.common.IChildProcessCallback.Stub方法的典型用法代码示例。如果您正苦于以下问题:Java IChildProcessCallback.Stub方法的具体用法?Java IChildProcessCallback.Stub怎么用?Java IChildProcessCallback.Stub使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.chromium.content.common.IChildProcessCallback
的用法示例。
在下文中一共展示了IChildProcessCallback.Stub方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCallback
import org.chromium.content.common.IChildProcessCallback; //导入方法依赖的package包/类
/**
* This implementation is used to receive callbacks from the remote service.
*/
private static IChildProcessCallback createCallback(final int callbackType) {
return new IChildProcessCallback.Stub() {
/**
* This is called by the remote service regularly to tell us about new values. Note that
* IPC calls are dispatched through a thread pool running in each process, so the code
* executing here will NOT be running in our main thread -- so, to update the UI, we
* need to use a Handler.
*/
@Override
public void establishSurfacePeer(
int pid, Surface surface, int primaryID, int secondaryID) {
// Do not allow a malicious renderer to connect to a producer. This is only used
// from stream textures managed by the GPU process.
if (callbackType != CALLBACK_FOR_GPU_PROCESS) {
Log.e(TAG, "Illegal callback for non-GPU process.");
return;
}
nativeEstablishSurfacePeer(pid, surface, primaryID, secondaryID);
}
@Override
public Surface getViewSurface(int surfaceId) {
// Do not allow a malicious renderer to get to our view surface.
if (callbackType != CALLBACK_FOR_GPU_PROCESS) {
Log.e(TAG, "Illegal callback for non-GPU process.");
return null;
}
return nativeGetViewSurface(surfaceId);
}
};
}