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

Unified Diff: content/app/content_main_runner.cc

Issue 1577883002: Add run-time CHECK to smoke-test allocator overrides (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: AAAAArgh, inconsistent trailing dot in README.chromium Created 4 years, 11 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 | « base/base.gypi ('k') | third_party/tcmalloc/README.chromium » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/app/content_main_runner.cc
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index 3b5f88ad7b58b76de4d0aed66959c37b6a70758f..037c79bd512ed948ee71b560b89076cdbf2300fb 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -10,6 +10,7 @@
#include <string>
#include <utility>
+#include "base/allocator/allocator_check.h"
#include "base/allocator/allocator_extension.h"
#include "base/at_exit.h"
#include "base/command_line.h"
@@ -654,6 +655,12 @@ class ContentMainRunnerImpl : public ContentMainRunner {
base::win::SetupCRT(command_line);
#endif
+ // If we are on a platform where the default allocator is overridden (shim
+ // layer on windows, tcmalloc on Linux Desktop) smoke-tests that the
+ // overriding logic is working correctly. If not causes a hard crash, as its
+ // unexpected absence has security implications.
+ CHECK(base::allocator::IsAllocatorInitialized());
+
#if defined(OS_POSIX)
if (!process_type.empty()) {
// When you hit Ctrl-C in a terminal running the browser
« no previous file with comments | « base/base.gypi ('k') | third_party/tcmalloc/README.chromium » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698