Chrome browser Main entry point

I myself learning the Chrome internals by going through the source code. This codebase is quite big. I decided to use this blog to save all my understanding on Chrome for my future reference.

Chrome Main Entry point:

This is the basic flow of function calls when you launch the chrome.exe application.

chromium/src/chrome/app/chrome_exe_main_gtk.cc
    main() calls ChromeMain()

    chromium/src/chrome/app/chrome_main.cc:
        ChromeMain() calls content::ContentMain()

        chromium/src/content/app/content_main.cc:
            content::ContentMain() calls RunNamedProcessTypeMain()

            chromium/src/content/app/content_main.cc
                Calls various *Main functions based on the process_type we passed as command line argument "type".
   

chromium/src/content/app/content_main.cc – starting point of browser based on the browser type we pass as the argument to chrome.exe.

  static const MainFunction kMainFunctions[] = {
    { "",                                                         BrowserMain },                    // hiddencodes: This is the entry point of the chrome.exe that runs with the high integrity level.
    { switches::kRendererProcess,          RendererMain },                  // hiddencodes: This is the entry point of the chrome.exe that runs with the low integrity level.
    { switches::kPluginProcess,              PluginMain },                         // hiddencodes: This is the entry point of the chrome.exe that runs the plugin.
    { switches::kWorkerProcess,            WorkerMain },
    { switches::kPpapiPluginProcess,    PpapiPluginMain },
    { switches::kPpapiBrokerProcess,   PpapiBrokerMain },
    { switches::kUtilityProcess,              UtilityMain },
    { switches::kGpuProcess,                  GpuMain },
  };

// Causes the process to run as renderer instead of as browser. 
const char kRendererProcess[]               = "renderer";

// Causes the process to run as a plugin subprocess.
const char kPluginProcess[]                 = "plugin";

// Causes the process to run as a worker subprocess.
const char kWorkerProcess[]                 = "worker";

// Argument to the process type that indicates a PPAPI plugin process type.
const char kPpapiPluginProcess[]            = "ppapi";

// Argument to the process type that indicates a PPAPI broker process type.
const char kPpapiBrokerProcess[]            = "ppapi-broker";

// Causes the process to run as a utility subprocess.
const char kUtilityProcess[]                = "utility";

// Makes this process a GPU sub-process.
const char kGpuProcess[]                    = "gpu-process";

Advertisements
This entry was posted in browser, Chrome and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s