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

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

Issue 100179: Merge 14891 - A better fix for http://www.crbug.com/2044: crash... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/branches/172/src/
Patch Set: Created 11 years, 7 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/app/DEPS ('k') | skia/corecg/SkMemory_stdlib.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/chrome/app/chrome_dll_main.cc:r69-2775
Merged /trunk/src/chrome/app/chrome_dll_main.cc:r13132,13255,13273,13285,13348,13453,13611,13636,13723,13916,13926,14234,14242,14891
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 // TODO(port): the ifdefs in here are a first step towards trying to determine 5 // TODO(port): the ifdefs in here are a first step towards trying to determine
6 // the correct abstraction for all the OS functionality required at this 6 // the correct abstraction for all the OS functionality required at this
7 // stage of process initialization. It should not be taken as a final 7 // stage of process initialization. It should not be taken as a final
8 // abstraction. 8 // abstraction.
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "chrome/common/main_function_params.h" 47 #include "chrome/common/main_function_params.h"
48 #include "chrome/common/resource_bundle.h" 48 #include "chrome/common/resource_bundle.h"
49 #include "chrome/common/sandbox_init_wrapper.h" 49 #include "chrome/common/sandbox_init_wrapper.h"
50 #if defined(OS_WIN) 50 #if defined(OS_WIN)
51 #include "sandbox/src/sandbox.h" 51 #include "sandbox/src/sandbox.h"
52 #include "tools/memory_watcher/memory_watcher.h" 52 #include "tools/memory_watcher/memory_watcher.h"
53 #endif 53 #endif
54 #if defined(OS_MACOSX) 54 #if defined(OS_MACOSX)
55 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h" 55 #include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h"
56 #endif 56 #endif
57 #include "skia/include/corecg/SkTypes.h"
57 58
58 extern int BrowserMain(const MainFunctionParams&); 59 extern int BrowserMain(const MainFunctionParams&);
59 extern int RendererMain(const MainFunctionParams&); 60 extern int RendererMain(const MainFunctionParams&);
60 extern int PluginMain(const MainFunctionParams&); 61 extern int PluginMain(const MainFunctionParams&);
61 extern int WorkerMain(const MainFunctionParams&); 62 extern int WorkerMain(const MainFunctionParams&);
62 63
63 #if defined(OS_WIN) 64 #if defined(OS_WIN)
64 // TODO(erikkay): isn't this already defined somewhere? 65 // TODO(erikkay): isn't this already defined somewhere?
65 #define DLLEXPORT __declspec(dllexport) 66 #define DLLEXPORT __declspec(dllexport)
66 67
(...skipping 30 matching lines...) Expand all
97 const wchar_t* file, unsigned int line, 98 const wchar_t* file, unsigned int line,
98 uintptr_t reserved) { 99 uintptr_t reserved) {
99 __debugbreak(); 100 __debugbreak();
100 } 101 }
101 102
102 void PureCall() { 103 void PureCall() {
103 __debugbreak(); 104 __debugbreak();
104 } 105 }
105 106
106 int OnNoMemory(size_t memory_size) { 107 int OnNoMemory(size_t memory_size) {
108 // Skia indicates that it can safely handle some NULL allocs by clearing
109 // this flag. In this case, we'll ignore the new_handler and won't crash.
110 if (!sk_malloc_will_throw()) {
111 return;
112 }
113
107 __debugbreak(); 114 __debugbreak();
108 // Return memory_size so it is not optimized out. Make sure the return value 115 // Return memory_size so it is not optimized out. Make sure the return value
109 // is at least 1 so malloc/new is retried, especially useful when under a 116 // is at least 1 so malloc/new is retried, especially useful when under a
110 // debugger. 117 // debugger.
111 return memory_size ? static_cast<int>(memory_size) : 1; 118 return memory_size ? static_cast<int>(memory_size) : 1;
112 } 119 }
113 120
114 // Handlers to silently dump the current process when there is an assert in 121 // Handlers to silently dump the current process when there is an assert in
115 // chrome. 122 // chrome.
116 void ChromeAssert(const std::string& str) { 123 void ChromeAssert(const std::string& str) {
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 _CrtDumpMemoryLeaks(); 417 _CrtDumpMemoryLeaks();
411 #endif // _CRTDBG_MAP_ALLOC 418 #endif // _CRTDBG_MAP_ALLOC
412 419
413 _Module.Term(); 420 _Module.Term();
414 #endif 421 #endif
415 422
416 logging::CleanupChromeLogging(); 423 logging::CleanupChromeLogging();
417 424
418 return rv; 425 return rv;
419 } 426 }
OLDNEW
« no previous file with comments | « chrome/app/DEPS ('k') | skia/corecg/SkMemory_stdlib.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698