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

Unified Diff: chrome/app/chrome_dll_main.cc

Issue 100163: When skia ok's a NULL malloc, don't call __debugbreak. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/DEPS ('k') | skia/corecg/SkMemory_stdlib.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_dll_main.cc
===================================================================
--- chrome/app/chrome_dll_main.cc (revision 14854)
+++ chrome/app/chrome_dll_main.cc (working copy)
@@ -60,6 +60,7 @@
#if defined(OS_MACOSX)
#include "third_party/WebKit/WebKit/mac/WebCoreSupport/WebSystemInterface.h"
#endif
+#include "skia/include/corecg/SkTypes.h"
extern int BrowserMain(const MainFunctionParams&);
extern int RendererMain(const MainFunctionParams&);
@@ -110,6 +111,12 @@
}
void OnNoMemory() {
+ // Skia indicates that it can safely handle some NULL allocs by clearing
+ // this flag. In this case, we'll ignore the new_handler and won't crash.
+ if (!sk_malloc_will_throw()) {
+ return;
+ }
+
// Kill the process. This is important for security, since WebKit doesn't
// NULL-check many memory allocations. If a malloc fails, returns NULL, and
// the buffer is then used, it provides a handy mapping of memory starting at
« 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