| 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 #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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |