Remove EWK_BRINGUPS for M120 #3
[platform/framework/web/chromium-efl.git] / chrome / app / main_dll_loader_win.h
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.
4
5 // This file defines a class to load the main DLL of a Chrome process.
6
7 #ifndef CHROME_APP_MAIN_DLL_LOADER_WIN_H_
8 #define CHROME_APP_MAIN_DLL_LOADER_WIN_H_
9
10 #include <windows.h>  // NOLINT
11
12 #include <string>
13
14 #include "base/time/time.h"
15
16 namespace base {
17 class FilePath;
18 }  // namespace base
19
20 // Implements the common aspects of loading the main dll for both chrome and
21 // chromium scenarios.
22 class MainDllLoader {
23  public:
24   MainDllLoader();
25   virtual ~MainDllLoader();
26
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
31   // upon termination.
32   int Launch(HINSTANCE instance, base::TimeTicks exe_entry_point_ticks);
33
34   // Launches a new instance of the browser if the current instance in
35   // persistent mode an upgrade is detected.
36   void RelaunchChromeBrowserWithNewCommandLineIfNeeded();
37
38  protected:
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) {}
45
46  private:
47   HMODULE dll_;
48   std::string process_type_;
49 };
50
51 // Factory for the MainDllLoader. Caller owns the pointer and should call
52 // delete to free it.
53 MainDllLoader* MakeMainDllLoader();
54
55 #endif  // CHROME_APP_MAIN_DLL_LOADER_WIN_H_