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

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: Created 4 years, 7 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.h
diff --git a/components/metrics/leak_detector/leak_detector.h b/components/metrics/leak_detector/leak_detector.h
index fb624a281dd2eb59bdd951eb1a46634a5d4e73d7..0faf821c5e78f21f198dbc3a30af56578b4d76ca 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 static elements within this class, such as TLS.
+ static void StaticInit();
Primiano Tucci (use gerrit) 2016/06/01 21:26:30 I'd call it InitTLSSlot() and not static init. Tec
Simon Que 2016/06/02 17:55:17 Done.
+
// 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 | « no previous file | components/metrics/leak_detector/leak_detector.cc » ('j') | components/metrics/leak_detector/leak_detector.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698