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

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

Issue 2422643002: Windows install_static refactor. (Closed)
Patch Set: sync to position 427054 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"
25 #include "chrome_elf/chrome_elf_constants.h"
24 26
25 #define DLLEXPORT __declspec(dllexport) 27 #define DLLEXPORT __declspec(dllexport)
26 28
27 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. 29 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling.
28 extern "C" { 30 extern "C" {
29 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, 31 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance,
30 sandbox::SandboxInterfaceInfo* sandbox_info, 32 sandbox::SandboxInterfaceInfo* sandbox_info,
31 int64_t exe_entry_point_ticks); 33 int64_t exe_entry_point_ticks);
32 } 34 }
33 #elif defined(OS_POSIX) 35 #elif defined(OS_POSIX)
(...skipping 13 matching lines...) Expand all
47 #endif 49 #endif
48 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64) 50 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64)
49 // VS2013 only checks the existence of FMA3 instructions, not the enabled-ness 51 // 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 52 // 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 53 // 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. 54 // instructions when running on CPUs that support FMA3, but OSs that don't.
53 // See http://crbug.com/436603. 55 // See http://crbug.com/436603.
54 _set_FMA3_enable(0); 56 _set_FMA3_enable(0);
55 #endif // WIN && ARCH_CPU_X86_64 57 #endif // WIN && ARCH_CPU_X86_64
56 58
59 #if defined(OS_WIN)
60 install_static::InstallDetails::ImportFromModule(
61 chrome::kChromeElfDllName, kChromeElfInstallDetailsPayloadFunctionName);
62 #endif
63
57 ChromeMainDelegate chrome_main_delegate( 64 ChromeMainDelegate chrome_main_delegate(
58 base::TimeTicks::FromInternalValue(exe_entry_point_ticks)); 65 base::TimeTicks::FromInternalValue(exe_entry_point_ticks));
59 content::ContentMainParams params(&chrome_main_delegate); 66 content::ContentMainParams params(&chrome_main_delegate);
60 67
61 #if defined(OS_WIN) 68 #if defined(OS_WIN)
62 // The process should crash when going through abnormal termination. 69 // The process should crash when going through abnormal termination.
63 base::win::SetShouldCrashOnProcessDetach(true); 70 base::win::SetShouldCrashOnProcessDetach(true);
64 base::win::SetAbortBehaviorForCrashReporting(); 71 base::win::SetAbortBehaviorForCrashReporting();
65 params.instance = instance; 72 params.instance = instance;
66 params.sandbox_info = sandbox_info; 73 params.sandbox_info = sandbox_info;
(...skipping 28 matching lines...) Expand all
95 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES) 102 #endif // BUILDFLAG(ENABLE_PACKAGE_MASH_SERVICES)
96 103
97 int rv = content::ContentMain(params); 104 int rv = content::ContentMain(params);
98 105
99 #if defined(OS_WIN) 106 #if defined(OS_WIN)
100 base::win::SetShouldCrashOnProcessDetach(false); 107 base::win::SetShouldCrashOnProcessDetach(false);
101 #endif 108 #endif
102 109
103 return rv; 110 return rv;
104 } 111 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698