Fix a leak in wm::AnimateOnChildWindowVisibilityChanged().
[chromium-blink-merge.git] / chrome / app / chrome_main.cc
blobc1cf145b014eb62c59ee4c6ac216e32b4e39bec5
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
3 // found in the LICENSE file.
5 #include "chrome/app/chrome_main_delegate.h"
7 #include "content/public/app/content_main.h"
9 #if defined(OS_WIN)
10 #include "base/win/win_util.h"
12 #define DLLEXPORT __declspec(dllexport)
14 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling.
15 extern "C" {
16 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance,
17 sandbox::SandboxInterfaceInfo* sandbox_info);
19 #elif defined(OS_POSIX)
20 extern "C" {
21 __attribute__((visibility("default")))
22 int ChromeMain(int argc, const char** argv);
24 #endif
26 #if defined(OS_WIN)
27 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance,
28 sandbox::SandboxInterfaceInfo* sandbox_info) {
29 #elif defined(OS_POSIX)
30 int ChromeMain(int argc, const char** argv) {
31 #endif
32 ChromeMainDelegate chrome_main_delegate;
33 content::ContentMainParams params(&chrome_main_delegate);
35 #if defined(OS_WIN)
36 // The process should crash when going through abnormal termination.
37 base::win::SetShouldCrashOnProcessDetach(true);
38 base::win::SetAbortBehaviorForCrashReporting();
39 params.instance = instance;
40 params.sandbox_info = sandbox_info;
41 #else
42 params.argc = argc;
43 params.argv = argv;
44 #endif
46 int rv = content::ContentMain(params);
48 #if defined(OS_WIN)
49 base::win::SetShouldCrashOnProcessDetach(false);
50 #endif
52 return rv;