diff options
author | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-06 08:05:53 +0000 |
---|---|---|
committer | earthdok@chromium.org <earthdok@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-06 08:05:53 +0000 |
commit | 9923d5812259817a182f653dab8490835cf3d518 (patch) | |
tree | 66869be75f657990f5334dccc0ddf70ea69daea9 | |
parent | 2c8fe64dedeffc6139b5ac31126e53ec912102d6 (diff) | |
download | chromium_src-9923d5812259817a182f653dab8490835cf3d518.zip chromium_src-9923d5812259817a182f653dab8490835cf3d518.tar.gz chromium_src-9923d5812259817a182f653dab8490835cf3d518.tar.bz2 |
Invoke LeakSanitizer early in the utility process.
Avoid reporting shutdown-only leaks, the same way we do for the browser process.
Also, fix a IWYU violation in base/debug/leak_annotations.h.
BUG=307043, 326148
R=mpcomplete@chromium.org
TBR=thakis@chromium.org
Review URL: https://codereview.chromium.org/106953002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239150 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/debug/leak_annotations.h | 1 | ||||
-rw-r--r-- | content/utility/utility_main.cc | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/base/debug/leak_annotations.h b/base/debug/leak_annotations.h index 199cfdc..cac1eaf2 100644 --- a/base/debug/leak_annotations.h +++ b/base/debug/leak_annotations.h @@ -5,6 +5,7 @@ #ifndef BASE_DEBUG_LEAK_ANNOTATIONS_H_ #define BASE_DEBUG_LEAK_ANNOTATIONS_H_ +#include "base/basictypes.h" #include "build/build_config.h" // This file defines macros which can be used to annotate intentional memory diff --git a/content/utility/utility_main.cc b/content/utility/utility_main.cc index 29fd01b..c150d94 100644 --- a/content/utility/utility_main.cc +++ b/content/utility/utility_main.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/command_line.h" +#include "base/debug/leak_annotations.h" #include "base/message_loop/message_loop.h" #include "base/threading/platform_thread.h" #include "base/timer/hi_res_timer_manager.h" @@ -84,6 +85,12 @@ int UtilityMain(const MainFunctionParams& parameters) { base::MessageLoop::current()->Run(); +#if defined(LEAK_SANITIZER) + // Invoke LeakSanitizer before shutting down the utility thread, to avoid + // reporting shutdown-only leaks. + __lsan_do_leak_check(); +#endif + return 0; } |