CEF多进程框架:CEF初始化进程过程

文章目录

  • CEF如何创建进程
  • CefExecuteProcess函数

CEF如何创建进程

CEF框架启动后,会有多个进程,之前也提到过,有Browser进程,Render进程,GPU进程等。

比如CEF框架代码中的cefsimple,cefclient启动后都是如此。

CEF框架是通过CefExecuteProcess函数来初始化线程相关内容的,在cefsimple代码如下:

  // CEF applications have multiple sub-processes (render, GPU, etc) that share
  // the same executable. This function checks the command-line and, if this is
  // a sub-process, executes the appropriate logic.
  exit_code = CefExecuteProcess(main_args, nullptr, sandbox_info);
  if (exit_code >= 0) {
    // The sub-process has completed so return here.
    return exit_code;
  }

针对这个CefExecuteProcess函数,可以也稍微扩展一下,在CEF框架中,可以通过在启动命令参数中给定–type=render&#

你可能感兴趣的:(C++编程实战大杂烩,CEF,render进程,browser进程,CEF多进程,CEF进程创建)