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

Unified Diff: trunk/src/content/browser/tracing/tracing_controller_impl.h

Issue 89753004: Revert 237280 "Remove TraceController" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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: trunk/src/content/browser/tracing/tracing_controller_impl.h
===================================================================
--- trunk/src/content/browser/tracing/tracing_controller_impl.h (revision 237451)
+++ trunk/src/content/browser/tracing/tracing_controller_impl.h (working copy)
@@ -11,12 +11,9 @@
#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 {
class TraceMessageFilter;
@@ -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);

Powered by Google App Engine
This is Rietveld 408576698