美文网首页
cef一些代码解读

cef一些代码解读

作者: 行走的代码 | 来源:发表于2023-10-07 15:13 被阅读0次
  1. CefExecuteProcess作用
    因为多子进程共用一个可执行文件,所以该函数作用就是判断当前是哪种子进程,并执行相应逻辑。如果是浏览器子进程,返回值>=0,是浏览器进程返回-1.
    所以使用时判断>=0就立即返回,不要执行后续的浏览器初始化逻辑。如果是子进程,该函数内部执行子进程逻辑,并阻塞直到进程退出。

// CEF applications have multiple sub-processes (render, plugin, GPU, etc)
// that share the same executable. This function checks the command-line and,
// if this is a sub-process, executes the appropriate logic.
int exit_code = CefExecuteProcess(main_args, app.get(), NULL);

  1. 离屏渲染的demo
    src\cef\tests\cefsimple

相关文章

网友评论

      本文标题:cef一些代码解读

      本文链接:https://www.haomeiwen.com/subject/fgcvbdtx.html