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

Unified Diff: content/public/browser/trace_subscriber.h

Issue 101543004: Revert of Revert "Revert 237280 "Remove TraceController"" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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 | « content/public/browser/trace_controller.h ('k') | content/public/browser/tracing_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/trace_subscriber.h
diff --git a/content/public/browser/trace_subscriber.h b/content/public/browser/trace_subscriber.h
new file mode 100644
index 0000000000000000000000000000000000000000..8b63d3588e80d81d56c20f123d9fa63d8f39906d
--- /dev/null
+++ b/content/public/browser/trace_subscriber.h
@@ -0,0 +1,43 @@
+// Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_TRACE_SUBSCRIBER_H_
+#define CONTENT_PUBLIC_BROWSER_TRACE_SUBSCRIBER_H_
+
+#include <set>
+
+#include "base/memory/ref_counted_memory.h"
+
+namespace content {
+
+// Objects interested in receiving trace data derive from TraceSubscriber. All
+// callbacks occur on the UI thread.
+// See also: trace_message_filter.h
+// See also: child_trace_message_filter.h
+class TraceSubscriber {
+ public:
+ // Called once after TraceController::EndTracingAsync.
+ virtual void OnEndTracingComplete() {}
+
+ // Called 0 or more times between TraceController::BeginTracing and
+ // OnEndTracingComplete. Use base::debug::TraceResultBuffer to convert one or
+ // more trace fragments to JSON.
+ virtual void OnTraceDataCollected(
+ const scoped_refptr<base::RefCountedString>& trace_fragment) = 0;
+
+ // Called once after TraceController::GetKnownCategoryGroupsAsync.
+ virtual void OnKnownCategoriesCollected(
+ const std::set<std::string>& known_categories) {}
+
+ virtual void OnTraceBufferPercentFullReply(float percent_full) {}
+
+ virtual void OnEventWatchNotification() {}
+
+ protected:
+ virtual ~TraceSubscriber() {}
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_TRACE_SUBSCRIBER_H_
« no previous file with comments | « content/public/browser/trace_controller.h ('k') | content/public/browser/tracing_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698