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

Side by Side Diff: chrome/app/chrome_main.cc

Issue 2422643002: Windows install_static refactor. (Closed)
Patch Set: sync to position 428354 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 unified diff | Download patch
OLDNEW
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 #include <stdint.h> 5 #include <stdint.h>
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "chrome/app/chrome_main_delegate.h" 9 #include "chrome/app/chrome_main_delegate.h"
10 #include "chrome/common/features.h" 10 #include "chrome/common/features.h"
11 #include "content/public/app/content_main.h" 11 #include "content/public/app/content_main.h"
12 12
13 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) 13 #if BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
14 #include "base/command_line.h" 14 #include "base/command_line.h"
15 #include "chrome/app/mash/mash_runner.h" 15 #include "chrome/app/mash/mash_runner.h"
16 #include "chrome/common/channel_info.h" 16 #include "chrome/common/channel_info.h"
17 #include "components/version_info/version_info.h" 17 #include "components/version_info/version_info.h"
18 #endif 18 #endif
19 19
20 #if defined(OS_WIN) 20 #if defined(OS_WIN)
21 #include "base/debug/dump_without_crashing.h" 21 #include "base/debug/dump_without_crashing.h"
22 #include "base/win/win_util.h" 22 #include "base/win/win_util.h"
23 #include "chrome/common/chrome_constants.h" 23 #include "chrome/common/chrome_constants.h"
24 #include "chrome/install_static/install_details.h"
24 25
25 #define DLLEXPORT __declspec(dllexport) 26 #define DLLEXPORT __declspec(dllexport)
26 27
27 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. 28 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling.
28 extern "C" { 29 extern "C" {
29 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, 30 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance,
30 sandbox::SandboxInterfaceInfo* sandbox_info, 31 sandbox::SandboxInterfaceInfo* sandbox_info,
31 int64_t exe_entry_point_ticks); 32 int64_t exe_entry_point_ticks);
32 } 33 }
33 #elif defined(OS_POSIX) 34 #elif defined(OS_POSIX)
(...skipping 13 matching lines...) Expand all
47 #endif 48 #endif
48 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64) 49 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64)
49 // VS2013 only checks the existence of FMA3 instructions, not the enabled-ness 50 // VS2013 only checks the existence of FMA3 instructions, not the enabled-ness
50 // of them at the OS level (this is fixed in VS2015). We force off usage of 51 // of them at the OS level (this is fixed in VS2015). We force off usage of
51 // FMA3 instructions in the CRT to avoid using that path and hitting illegal 52 // FMA3 instructions in the CRT to avoid using that path and hitting illegal
52 // instructions when running on CPUs that support FMA3, but OSs that don't. 53 // instructions when running on CPUs that support FMA3, but OSs that don't.
53 // See http://crbug.com/436603. 54 // See http://crbug.com/436603.
54 _set_FMA3_enable(0); 55 _set_FMA3_enable(0);
55 #endif // WIN && ARCH_CPU_X86_64 56 #endif // WIN && ARCH_CPU_X86_64
56 57
58 #if defined(OS_WIN)
59 install_static::InstallDetails::InitializeFromPrimaryModule(
60 chrome::kChromeElfDllName);
61 #endif
62
57 ChromeMainDelegate chrome_main_delegate( 63 ChromeMainDelegate chrome_main_delegate(
58 base::TimeTicks::FromInternalValue(exe_entry_point_ticks)); 64 base::TimeTicks::FromInternalValue(exe_entry_point_ticks));
59 content::ContentMainParams params(&chrome_main_delegate); 65 content::ContentMainParams params(&chrome_main_delegate);
60 66
61 #if defined(OS_WIN) 67 #if defined(OS_WIN)
62 // The process should crash when going through abnormal termination. 68 // The process should crash when going through abnormal termination.
63 base::win::SetShouldCrashOnProcessDetach(true); 69 base::win::SetShouldCrashOnProcessDetach(true);
64 base::win::SetAbortBehaviorForCrashReporting(); 70 base::win::SetAbortBehaviorForCrashReporting();
65 params.instance = instance; 71 params.instance = instance;
66 params.sandbox_info = sandbox_info; 72 params.sandbox_info = sandbox_info;
(...skipping 28 matching lines...) Expand all
95 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) 101 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
96 102
97 int rv = content::ContentMain(params); 103 int rv = content::ContentMain(params);
98 104
99 #if defined(OS_WIN) 105 #if defined(OS_WIN)
100 base::win::SetShouldCrashOnProcessDetach(false); 106 base::win::SetShouldCrashOnProcessDetach(false);
101 #endif 107 #endif
102 108
103 return rv; 109 return rv;
104 } 110 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698