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

Unified Diff: content/browser/tracing/tracing_controller_impl.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
Index: content/browser/tracing/tracing_controller_impl.h
diff --git a/content/browser/tracing/tracing_controller_impl.h b/content/browser/tracing/tracing_controller_impl.h
index ed3c8fd65193d00b65f7f4512446f3fd09c52069..7eab907ce95a3b6b84d16502af39814ae0db1977 100644
--- a/content/browser/tracing/tracing_controller_impl.h
+++ b/content/browser/tracing/tracing_controller_impl.h
@@ -11,11 +11,8 @@
#include "base/files/file_path.h"
#include "base/lazy_instance.h"
+#include "content/public/browser/trace_subscriber.h"
#include "content/public/browser/tracing_controller.h"
-
-namespace base {
-class RefCountedString;
-}
namespace content {
@@ -26,36 +23,32 @@
static TracingControllerImpl* GetInstance();
// TracingController implementation.
- virtual bool GetCategories(
+ virtual void GetCategories(
const GetCategoriesDoneCallback& callback) OVERRIDE;
virtual bool EnableRecording(
- const std::string& category_filter,
+ const base::debug::CategoryFilter& filter,
TracingController::Options options,
const EnableRecordingDoneCallback& callback) OVERRIDE;
virtual bool DisableRecording(
const base::FilePath& result_file_path,
const TracingFileResultCallback& callback) OVERRIDE;
- virtual bool EnableMonitoring(const std::string& category_filter,
+ virtual bool EnableMonitoring(const base::debug::CategoryFilter& filter,
TracingController::Options options,
const EnableMonitoringDoneCallback& callback) OVERRIDE;
virtual bool DisableMonitoring(
const DisableMonitoringDoneCallback& callback) OVERRIDE;
virtual void GetMonitoringStatus(
bool* out_enabled,
- std::string* out_category_filter,
+ base::debug::CategoryFilter* out_filter,
TracingController::Options* out_options) OVERRIDE;
- virtual bool CaptureMonitoringSnapshot(
+ virtual void CaptureMonitoringSnapshot(
const base::FilePath& result_file_path,
const TracingFileResultCallback& callback) OVERRIDE;
virtual bool GetTraceBufferPercentFull(
const GetTraceBufferPercentFullCallback& callback) OVERRIDE;
- virtual bool SetWatchEvent(const std::string& category_name,
- const std::string& event_name,
- const WatchEventCallback& callback) OVERRIDE;
- virtual bool CancelWatchEvent() OVERRIDE;
private:
- typedef std::set<scoped_refptr<TraceMessageFilter> > TraceMessageFilterMap;
+ typedef std::set<scoped_refptr<TraceMessageFilter> > FilterMap;
class ResultFile;
friend struct base::DefaultLazyInstanceTraits<TracingControllerImpl>;
@@ -84,13 +77,9 @@
return pending_trace_buffer_percent_full_callback_.is_null();
}
- bool can_cancel_watch_event() const {
- return !watch_event_callback_.is_null();
- }
-
// Methods for use by TraceMessageFilter.
- void AddTraceMessageFilter(TraceMessageFilter* trace_message_filter);
- void RemoveTraceMessageFilter(TraceMessageFilter* trace_message_filter);
+ void AddFilter(TraceMessageFilter* filter);
+ void RemoveFilter(TraceMessageFilter* filter);
void OnTraceDataCollected(
const scoped_refptr<base::RefCountedString>& events_str_ptr);
@@ -113,11 +102,10 @@
void OnCaptureMonitoringSnapshotAcked();
void OnMonitoringSnapshotFileClosed();
+ void OnTraceNotification(int notification);
void OnTraceBufferPercentFullReply(float percent_full);
- void OnWatchEventMatched();
-
- TraceMessageFilterMap trace_message_filters_;
+ FilterMap filters_;
// Pending acks for DisableRecording.
int pending_disable_recording_ack_count_;
// Pending acks for CaptureMonitoringSnapshot.
@@ -134,11 +122,8 @@
TracingFileResultCallback pending_capture_monitoring_snapshot_done_callback_;
GetTraceBufferPercentFullCallback pending_trace_buffer_percent_full_callback_;
- std::string watch_category_name_;
- std::string watch_event_name_;
- WatchEventCallback watch_event_callback_;
-
std::set<std::string> known_category_groups_;
+ base::debug::CategoryFilter category_filter_;
scoped_ptr<ResultFile> result_file_;
scoped_ptr<ResultFile> monitoring_snapshot_file_;
DISALLOW_COPY_AND_ASSIGN(TracingControllerImpl);
« no previous file with comments | « content/browser/tracing/tracing_controller_browsertest.cc ('k') | content/browser/tracing/tracing_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698