| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file defines a class to load the main DLL of a Chrome process. | 5 // This file defines a class to load the main DLL of a Chrome process. |
| 6 | 6 |
| 7 #ifndef CHROME_APP_MAIN_DLL_LOADER_WIN_H_ | 7 #ifndef CHROME_APP_MAIN_DLL_LOADER_WIN_H_ |
| 8 #define CHROME_APP_MAIN_DLL_LOADER_WIN_H_ | 8 #define CHROME_APP_MAIN_DLL_LOADER_WIN_H_ |
| 9 | 9 |
| 10 #include <windows.h> // NOLINT | 10 #include <windows.h> // NOLINT |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class FilePath; | 17 class FilePath; |
| 18 class TimeTicks; |
| 18 } | 19 } |
| 19 | 20 |
| 20 // Implements the common aspects of loading the main dll for both chrome and | 21 // Implements the common aspects of loading the main dll for both chrome and |
| 21 // chromium scenarios, which are in charge of implementing two abstract | 22 // chromium scenarios, which are in charge of implementing two abstract |
| 22 // methods: GetRegistryPath() and OnBeforeLaunch(). | 23 // methods: GetRegistryPath() and OnBeforeLaunch(). |
| 23 class MainDllLoader { | 24 class MainDllLoader { |
| 24 public: | 25 public: |
| 25 MainDllLoader(); | 26 MainDllLoader(); |
| 26 virtual ~MainDllLoader(); | 27 virtual ~MainDllLoader(); |
| 27 | 28 |
| 28 // Loads and calls the entry point of chrome.dll. |instance| is the exe | 29 // Loads and calls the entry point of chrome.dll. |instance| is the exe |
| 29 // instance retrieved from wWinMain. | 30 // instance retrieved from wWinMain. |exe_entry_point_ticks| is the time |
| 31 // when wWinMain was entered. |
| 30 // The return value is what the main entry point of chrome.dll returns | 32 // The return value is what the main entry point of chrome.dll returns |
| 31 // upon termination. | 33 // upon termination. |
| 32 int Launch(HINSTANCE instance); | 34 int Launch(HINSTANCE instance, const base::TimeTicks& exe_entry_point_ticks); |
| 33 | 35 |
| 34 // Launches a new instance of the browser if the current instance in | 36 // Launches a new instance of the browser if the current instance in |
| 35 // persistent mode an upgrade is detected. | 37 // persistent mode an upgrade is detected. |
| 36 void RelaunchChromeBrowserWithNewCommandLineIfNeeded(); | 38 void RelaunchChromeBrowserWithNewCommandLineIfNeeded(); |
| 37 | 39 |
| 38 protected: | 40 protected: |
| 39 // Called after chrome.dll has been loaded but before the entry point | 41 // Called after chrome.dll has been loaded but before the entry point |
| 40 // is invoked. Derived classes can implement custom actions here. | 42 // is invoked. Derived classes can implement custom actions here. |
| 41 // |process_type| is the argument to the --type command line argument, e.g. | 43 // |process_type| is the argument to the --type command line argument, e.g. |
| 42 // "renderer", "watcher", etc. | 44 // "renderer", "watcher", etc. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 58 private: | 60 private: |
| 59 HMODULE dll_; | 61 HMODULE dll_; |
| 60 std::string process_type_; | 62 std::string process_type_; |
| 61 }; | 63 }; |
| 62 | 64 |
| 63 // Factory for the MainDllLoader. Caller owns the pointer and should call | 65 // Factory for the MainDllLoader. Caller owns the pointer and should call |
| 64 // delete to free it. | 66 // delete to free it. |
| 65 MainDllLoader* MakeMainDllLoader(); | 67 MainDllLoader* MakeMainDllLoader(); |
| 66 | 68 |
| 67 #endif // CHROME_APP_MAIN_DLL_LOADER_WIN_H_ | 69 #endif // CHROME_APP_MAIN_DLL_LOADER_WIN_H_ |
| OLD | NEW |