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

Unified Diff: components/metrics/leak_detector/leak_detector.cc

Issue 2023133003: Add Static Initializer for leak detector TLS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include protobuf header in unittest; Browser publicly depends on leak_detector Created 4 years, 6 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
Index: components/metrics/leak_detector/leak_detector.cc
diff --git a/components/metrics/leak_detector/leak_detector.cc b/components/metrics/leak_detector/leak_detector.cc
index b90d21833221c1627987e8aa6d19643cb15dde7a..5f33bab50fc7e9ffa661b08749068f8ec78f4014 100644
--- a/components/metrics/leak_detector/leak_detector.cc
+++ b/components/metrics/leak_detector/leak_detector.cc
@@ -17,6 +17,7 @@
#include "base/threading/thread_local.h"
#include "components/metrics/leak_detector/custom_allocator.h"
#include "components/metrics/leak_detector/leak_detector_impl.h"
+#include "components/metrics/proto/memory_leak_report.pb.h"
#if defined(OS_CHROMEOS)
#include <link.h> // for dl_iterate_phdr
@@ -160,6 +161,11 @@ LeakDetector* LeakDetector::GetInstance() {
return g_instance.Pointer();
}
+// static
+void LeakDetector::InitTLSSlot() {
+ ignore_result(g_hook_data_tls.Get());
+}
+
void LeakDetector::Init(const MemoryLeakReportProto::Params& params,
scoped_refptr<base::TaskRunner> task_runner) {
DCHECK(thread_checker_.CalledOnValidThread());
« no previous file with comments | « components/metrics/leak_detector/leak_detector.h ('k') | components/metrics/leak_detector/leak_detector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698