当前位置: 首页>>代码示例>>Java>>正文


Java IChildProcessCallback.Stub方法代码示例

本文整理汇总了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);
        }
    };
}
 
开发者ID:openresearch,项目名称:android-chromium-view,代码行数:37,代码来源:ChildProcessLauncher.java


注:本文中的org.chromium.content.common.IChildProcessCallback.Stub方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。