Index: base/debug/trace_event.cc |
diff --git a/base/debug/trace_event.cc b/base/debug/trace_event.cc |
index 879f3a978f9361900a8658b61c4ead4ef5f75f0b..39a74841fca2cc223d500c3f0c6742d529f2a0fb 100644 |
--- a/base/debug/trace_event.cc |
+++ b/base/debug/trace_event.cc |
@@ -20,6 +20,14 @@ |
#define USE_UNRELIABLE_NOW |
+class DeleteTraceLogForTesting { |
+ public: |
+ static void Delete() { |
+ Singleton<base::debug::TraceLog, |
+ StaticMemorySingletonTraits<base::debug::TraceLog> >::OnExit(0); |
+ } |
+}; |
+ |
namespace base { |
namespace debug { |
@@ -410,7 +418,7 @@ void TraceLog::Flush() { |
i < previous_logged_events.size(); |
i += kTraceEventBatchSize) { |
scoped_refptr<RefCountedString> json_events_str_ptr = |
- new RefCountedString(); |
+ new RefCountedString(); |
TraceEvent::AppendEventsAsJSON(previous_logged_events, |
i, |
kTraceEventBatchSize, |
@@ -547,6 +555,10 @@ void TraceLog::AddCurrentMetadataEvents() { |
} |
} |
+void TraceLog::DeleteForTesting() { |
+ DeleteTraceLogForTesting::Delete(); |
+} |
+ |
void TraceLog::Resurrect() { |
StaticMemorySingletonTraits<TraceLog>::Resurrect(); |
} |