chromium启动流程

来源:互联网 发布:linux 设置代理服务器 编辑:程序博客网 时间:2024/05/17 05:10

1:进入ChromeMain()函数,该函数在\chrome\app\chrome_main.cc

2:在ChromeMain()函数中,调用ContentMain(),该函数在\content\app\content_main.cc

3:在ContentMain()中调用int Run(),该函数在\content\app\content_main_runner.cc中

4:在Run()中调用RunNamedProcessTypeMain(),根据命令行参数调用该函数创建其他进程。该函数在\content\app\content_main_runner.cc

int Run() override {
    DCHECK(is_initialized_);
    DCHECK(!is_shutdown_);
    const base::CommandLine& command_line =
        *base::CommandLine::ForCurrentProcess();
    std::string process_type =
        command_line.GetSwitchValueASCII(switches::kProcessType);


    base::HistogramBase::EnableActivityReportHistogram(process_type);


    MainFunctionParams main_params(command_line);
    main_params.ui_task = ui_task_;
#if defined(OS_WIN)
    main_params.sandbox_info = &sandbox_info_;
#elif defined(OS_MACOSX)
    main_params.autorelease_pool = autorelease_pool_.get();
#endif


    return RunNamedProcessTypeMain(process_type, main_params, delegate_);
  }

0 0
原创粉丝点击