cef3 webkit 内核 总览

做cef这一块有一段时间了,当时废了不少精力,才一两个月没有用就差点忘记完了。。。。。心痛

// Create a ClientApp of the correct type.
  CefRefPtr<CefApp> app;
  ClientApp::ProcessType process_type = ClientApp::GetProcessType(command_line);
  if (process_type == ClientApp::BrowserProcess)
    app = new ClientAppBrowser();
  else if (process_type == ClientApp::RendererProcess)
    app = new ClientAppRenderer();
  else if (process_type == ClientApp::OtherProcess)
    app = new ClientAppOther();

  // Execute the secondary process, if any.
  int exit_code = CefExecuteProcess(main_args, app, sandbox_info);
  if (exit_code >= 0)
    return exit_code;

cef会有三个进程:

Browser,Render,Ohter

Browser:浏览器进程处理窗口的创建和绘制,以及网络访问等,浏览器进程包含了应用程序的主要逻辑。

Render:渲染进程负责渲染 HTML 以及执行 JavaScript ,访问 DOM 等

这种创建方式通常情况下没有问题,在某些机器上,render进程并没有退到后台,会造成两个窗口,所以用一个轻量型的agent是个很好的选择

猜你喜欢

转载自blog.csdn.net/yufanghu/article/details/81111822