Index: base/trace_event/memory_tracing_frontend.h |
diff --git a/base/trace_event/memory_tracing_frontend.h b/base/trace_event/memory_tracing_frontend.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6e43ea14796f48a522134b3a6264183504e2f065 |
--- /dev/null |
+++ b/base/trace_event/memory_tracing_frontend.h |
@@ -0,0 +1,42 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef BASE_TRACE_EVENT_MEMORY_TRACING_FRONTEND_H_ |
+#define BASE_TRACE_EVENT_MEMORY_TRACING_FRONTEND_H_ |
+ |
+#include "base/trace_event/memory_dump_manager.h" |
+#include "base/trace_event/trace_event.h" |
+ |
+namespace base { |
+ |
+namespace trace_event { |
+ |
+// This is the interface exposed to the rest of the codebase to deal with |
+// memory tracing. The main entry point for clients is represented by |
+// RequestDumpPoint(). The extension by Un(RegisterDumpProvider). |
ssid
2017/04/14 23:33:09
What is RequestDumpPoint()
hjd
2017/04/19 09:54:56
...I'm not sure, I think I must have pasted some r
|
+class BASE_EXPORT MemoryTracingFrontend |
ssid
2017/04/14 23:33:09
Why is this called frontend? Why not MemoryTracing
hjd
2017/04/19 09:54:56
Done.
|
+ : public TraceLog::EnabledStateObserver { |
+ public: |
+ static const char* const kTraceCategory; |
+ |
+ static void Initialize(MemoryDumpManager*); |
ssid
2017/04/14 23:33:09
Why do you need this argument?
hjd
2017/04/19 09:54:56
Gone in the new version.
|
+ |
+ MemoryTracingFrontend(TraceLog*, MemoryDumpManager*); |
ssid
2017/04/14 23:33:09
Why are you passing these pointers to singleton?
hjd
2017/04/19 09:54:56
Code that uses singletons directly is difficult to
|
+ ~MemoryTracingFrontend() override; |
+ |
+ // TraceLog::EnabledStateObserver implementation. |
+ void OnTraceLogEnabled() override; |
+ void OnTraceLogDisabled() override; |
+ |
+ private: |
+ bool IsMemoryInfraTracingEnabled(); |
+ bool enabled_; |
+ MemoryDumpManager* memory_dump_manager_; |
+ TraceLog* trace_log_; |
+}; |
+ |
+} // namespace trace_event |
+} // namespace base |
+ |
+#endif // BASE_TRACE_EVENT_MEMORY_TRACING_FRONTEND_H_ |