1 // Copyright 2012 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file defines a class to load the main DLL of a Chrome process.
7 #ifndef CHROME_APP_MAIN_DLL_LOADER_WIN_H_
8 #define CHROME_APP_MAIN_DLL_LOADER_WIN_H_
10 #include <windows.h> // NOLINT
14 #include "base/time/time.h"
20 // Implements the common aspects of loading the main dll for both chrome and
21 // chromium scenarios.
25 virtual ~MainDllLoader();
27 // Loads and calls the entry point of chrome.dll. |instance| is the exe
28 // instance retrieved from wWinMain. |exe_entry_point_ticks| is the time
29 // when wWinMain was entered.
30 // The return value is what the main entry point of chrome.dll returns
32 int Launch(HINSTANCE instance, base::TimeTicks exe_entry_point_ticks);
34 // Launches a new instance of the browser if the current instance in
35 // persistent mode an upgrade is detected.
36 void RelaunchChromeBrowserWithNewCommandLineIfNeeded();
39 // Called after chrome.dll has been loaded but before the entry point is
40 // invoked. Derived classes can implement custom actions here. `process_type`
41 // is the argument to the `--type` command line argument (e.g., `renderer` or
42 // `watcher`). `dll_path` refers to the path of the Chrome dll being loaded.
43 virtual void OnBeforeLaunch(const std::string& process_type,
44 const base::FilePath& dll_path) {}
48 std::string process_type_;
51 // Factory for the MainDllLoader. Caller owns the pointer and should call
53 MainDllLoader* MakeMainDllLoader();
55 #endif // CHROME_APP_MAIN_DLL_LOADER_WIN_H_