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

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

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
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | components/metrics/leak_detector/leak_detector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/leak_detector/leak_detector.h
diff --git a/components/metrics/leak_detector/leak_detector.h b/components/metrics/leak_detector/leak_detector.h
index fb624a281dd2eb59bdd951eb1a46634a5d4e73d7..de5d40f900e8de1b52fd66db097268386ac2f540 100644
--- a/components/metrics/leak_detector/leak_detector.h
+++ b/components/metrics/leak_detector/leak_detector.h
@@ -20,7 +20,6 @@
#include "base/synchronization/lock.h"
#include "base/task_runner.h"
#include "base/threading/thread_checker.h"
-#include "components/metrics/proto/memory_leak_report.pb.h"
namespace base {
template <typename T>
@@ -29,6 +28,9 @@ struct DefaultLazyInstanceTraits;
namespace metrics {
+class MemoryLeakReportProto;
+class MemoryLeakReportProto_Params;
+
namespace leak_detector {
class LeakDetectorImpl;
}
@@ -66,13 +68,16 @@ class LeakDetector {
// Initializes leak detector. Args:
// - |params| is a set of parameters used by the leak detector. See definition
- // of MemoryLeakReportProto::Params for info about individual parameters.
+ // of MemoryLeakReportProto_Params for info about individual parameters.
// - |task_runner| is a TaskRunner to which NotifyObservers() should be
// posted, if it is initally called from a different thread than the one on
// which |task_runner| runs.
- void Init(const MemoryLeakReportProto::Params& params,
+ void Init(const MemoryLeakReportProto_Params& params,
scoped_refptr<base::TaskRunner> task_runner);
+ // Initializes the thread-local storage slot to be used by LeakDetector.
+ static void InitTLSSlot();
+
// Add |observer| to the list of stored Observers, i.e. |observers_|, to which
// the leak detector will report leaks.
void AddObserver(Observer* observer);
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | components/metrics/leak_detector/leak_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698