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

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

Issue 2345933002: Break chrome_initial's dependence on //components/startup_metric_utils/browser:lib (Closed)
Patch Set: Created 4 years, 3 months 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 "chrome/app/chrome_main_delegate.h" 5 #include "chrome/app/chrome_main_delegate.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "chrome/common/features.h" 8 #include "chrome/common/features.h"
9 #include "content/public/app/content_main.h" 9 #include "content/public/app/content_main.h"
10 10
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 #elif defined(OS_POSIX) 28 #elif defined(OS_POSIX)
29 extern "C" { 29 extern "C" {
30 __attribute__((visibility("default"))) 30 __attribute__((visibility("default")))
31 int ChromeMain(int argc, const char** argv); 31 int ChromeMain(int argc, const char** argv);
32 } 32 }
33 #endif 33 #endif
34 34
35 #if defined(OS_WIN) 35 #if defined(OS_WIN)
36 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, 36 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance,
37 sandbox::SandboxInterfaceInfo* sandbox_info) { 37 sandbox::SandboxInterfaceInfo* sandbox_info,
38 int64_t exe_entry_point_ticks) {
38 #elif defined(OS_POSIX) 39 #elif defined(OS_POSIX)
39 int ChromeMain(int argc, const char** argv) { 40 int ChromeMain(int argc, const char** argv) {
40 #endif 41 #endif
41 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64) 42 #if defined(OS_WIN) && defined(ARCH_CPU_X86_64)
42 // VS2013 only checks the existence of FMA3 instructions, not the enabled-ness 43 // VS2013 only checks the existence of FMA3 instructions, not the enabled-ness
43 // of them at the OS level (this is fixed in VS2015). We force off usage of 44 // of them at the OS level (this is fixed in VS2015). We force off usage of
44 // FMA3 instructions in the CRT to avoid using that path and hitting illegal 45 // FMA3 instructions in the CRT to avoid using that path and hitting illegal
45 // instructions when running on CPUs that support FMA3, but OSs that don't. 46 // instructions when running on CPUs that support FMA3, but OSs that don't.
46 // See http://crbug.com/436603. 47 // See http://crbug.com/436603.
47 _set_FMA3_enable(0); 48 _set_FMA3_enable(0);
48 #endif // WIN && ARCH_CPU_X86_64 49 #endif // WIN && ARCH_CPU_X86_64
49 50
50 ChromeMainDelegate chrome_main_delegate; 51 ChromeMainDelegate chrome_main_delegate(exe_entry_point_ticks);
51 content::ContentMainParams params(&chrome_main_delegate); 52 content::ContentMainParams params(&chrome_main_delegate);
52 53
53 #if defined(OS_WIN) 54 #if defined(OS_WIN)
54 // The process should crash when going through abnormal termination. 55 // The process should crash when going through abnormal termination.
55 base::win::SetShouldCrashOnProcessDetach(true); 56 base::win::SetShouldCrashOnProcessDetach(true);
56 base::win::SetAbortBehaviorForCrashReporting(); 57 base::win::SetAbortBehaviorForCrashReporting();
57 params.instance = instance; 58 params.instance = instance;
58 params.sandbox_info = sandbox_info; 59 params.sandbox_info = sandbox_info;
59 60
60 // SetDumpWithoutCrashingFunction must be passed the DumpProcess function 61 // SetDumpWithoutCrashingFunction must be passed the DumpProcess function
(...skipping 22 matching lines...) Expand all
83 #endif 84 #endif
84 85
85 int rv = content::ContentMain(params); 86 int rv = content::ContentMain(params);
86 87
87 #if defined(OS_WIN) 88 #if defined(OS_WIN)
88 base::win::SetShouldCrashOnProcessDetach(false); 89 base::win::SetShouldCrashOnProcessDetach(false);
89 #endif 90 #endif
90 91
91 return rv; 92 return rv;
92 } 93 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698