Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4116)

Unified Diff: chrome/app/chrome_main.cc

Issue 2422643002: Windows install_static refactor. (Closed)
Patch Set: sync to position 431863 Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/app/chrome_main.cc
diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc
index cf3502e5dce1d42530a93a1cfc293100626b1c6f..e24c4675287833e7a2654dccbe050ebe1dc89f10 100644
--- a/chrome/app/chrome_main.cc
+++ b/chrome/app/chrome_main.cc
@@ -21,6 +21,7 @@
#include "base/debug/dump_without_crashing.h"
#include "base/win/win_util.h"
#include "chrome/common/chrome_constants.h"
+#include "chrome/install_static/install_details.h"
#define DLLEXPORT __declspec(dllexport)
@@ -54,6 +55,11 @@ int ChromeMain(int argc, const char** argv) {
_set_FMA3_enable(0);
#endif // WIN && ARCH_CPU_X86_64
+#if defined(OS_WIN)
+ install_static::InstallDetails::InitializeFromPrimaryModule(
+ chrome::kChromeElfDllName);
+#endif
+
ChromeMainDelegate chrome_main_delegate(
base::TimeTicks::FromInternalValue(exe_entry_point_ticks));
content::ContentMainParams params(&chrome_main_delegate);
@@ -66,7 +72,7 @@ int ChromeMain(int argc, const char** argv) {
params.sandbox_info = sandbox_info;
// SetDumpWithoutCrashingFunction must be passed the DumpProcess function
- // from the EXE and not from the DLL in order for DumpWithoutCrashing to
+ // from chrome_elf and not from the DLL in order for DumpWithoutCrashing to
// function correctly.
typedef void (__cdecl *DumpProcessFunction)();
DumpProcessFunction DumpProcess = reinterpret_cast<DumpProcessFunction>(
@@ -74,6 +80,11 @@ int ChromeMain(int argc, const char** argv) {
"DumpProcessWithoutCrash"));
CHECK(DumpProcess);
base::debug::SetDumpWithoutCrashingFunction(DumpProcess);
+
+ // Verify that chrome_elf and this module (chrome.dll and chrome_child.dll)
+ // have the same version.
+ if (install_static::InstallDetails::Get().VersionMismatch())
+ base::debug::DumpWithoutCrashing();
#else
params.argc = argc;
params.argv = argv;

Powered by Google App Engine
This is Rietveld 408576698