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

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

Issue 507893002: Revert of Improve the ScopedHandle verifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « chrome/BUILD.gn ('k') | chrome/app/close_handle_hook_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/public/app/content_main.h" 7 #include "content/public/app/content_main.h"
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include "base/debug/dump_without_crashing.h" 10 #include "base/debug/dump_without_crashing.h"
11 #include "base/win/win_util.h" 11 #include "base/win/win_util.h"
12 #include "chrome/app/close_handle_hook_win.h"
13 #include "chrome/common/chrome_constants.h" 12 #include "chrome/common/chrome_constants.h"
14 13
15 #define DLLEXPORT __declspec(dllexport) 14 #define DLLEXPORT __declspec(dllexport)
16 15
17 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling. 16 // We use extern C for the prototype DLLEXPORT to avoid C++ name mangling.
18 extern "C" { 17 extern "C" {
19 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance, 18 DLLEXPORT int __cdecl ChromeMain(HINSTANCE instance,
20 sandbox::SandboxInterfaceInfo* sandbox_info); 19 sandbox::SandboxInterfaceInfo* sandbox_info);
21 } 20 }
22 #elif defined(OS_POSIX) 21 #elif defined(OS_POSIX)
(...skipping 12 matching lines...) Expand all
35 ChromeMainDelegate chrome_main_delegate; 34 ChromeMainDelegate chrome_main_delegate;
36 content::ContentMainParams params(&chrome_main_delegate); 35 content::ContentMainParams params(&chrome_main_delegate);
37 36
38 #if defined(OS_WIN) 37 #if defined(OS_WIN)
39 // The process should crash when going through abnormal termination. 38 // The process should crash when going through abnormal termination.
40 base::win::SetShouldCrashOnProcessDetach(true); 39 base::win::SetShouldCrashOnProcessDetach(true);
41 base::win::SetAbortBehaviorForCrashReporting(); 40 base::win::SetAbortBehaviorForCrashReporting();
42 params.instance = instance; 41 params.instance = instance;
43 params.sandbox_info = sandbox_info; 42 params.sandbox_info = sandbox_info;
44 43
45 InstallCloseHandleHooks();
46
47 // SetDumpWithoutCrashingFunction must be passed the DumpProcess function 44 // SetDumpWithoutCrashingFunction must be passed the DumpProcess function
48 // from the EXE and not from the DLL in order for DumpWithoutCrashing to 45 // from the EXE and not from the DLL in order for DumpWithoutCrashing to
49 // function correctly. 46 // function correctly.
50 typedef void (__cdecl *DumpProcessFunction)(); 47 typedef void (__cdecl *DumpProcessFunction)();
51 DumpProcessFunction DumpProcess = reinterpret_cast<DumpProcessFunction>( 48 DumpProcessFunction DumpProcess = reinterpret_cast<DumpProcessFunction>(
52 ::GetProcAddress(::GetModuleHandle(chrome::kBrowserProcessExecutableName), 49 ::GetProcAddress(::GetModuleHandle(chrome::kBrowserProcessExecutableName),
53 "DumpProcessWithoutCrash")); 50 "DumpProcessWithoutCrash"));
54 base::debug::SetDumpWithoutCrashingFunction(DumpProcess); 51 base::debug::SetDumpWithoutCrashingFunction(DumpProcess);
55 #else 52 #else
56 params.argc = argc; 53 params.argc = argc;
57 params.argv = argv; 54 params.argv = argv;
58 #endif 55 #endif
59 56
60 int rv = content::ContentMain(params); 57 int rv = content::ContentMain(params);
61 58
62 #if defined(OS_WIN) 59 #if defined(OS_WIN)
63 RemoveCloseHandleHooks();
64 base::win::SetShouldCrashOnProcessDetach(false); 60 base::win::SetShouldCrashOnProcessDetach(false);
65 #endif 61 #endif
66 62
67 return rv; 63 return rv;
68 } 64 }
OLDNEW
« no previous file with comments | « chrome/BUILD.gn ('k') | chrome/app/close_handle_hook_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698