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

Unified Diff: base/debug/trace_event.cc

Issue 7778033: Add trace code to track all posted tasks in message_loop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trace_event.h formatting fix Created 9 years, 3 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 | « base/debug/trace_event.h ('k') | base/debug/trace_event_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « base/debug/trace_event.h ('k') | base/debug/trace_event_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698