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

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

Issue 541763002: tracing: get rid of files in TracingController interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed system trace collection Created 6 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
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 bd4aaa10aaabf0e1e33bbd3a0b64b5441f88ea67..c494a21362f3b31edf5e12d498eec607610631db 100644
--- a/content/browser/tracing/tracing_controller_impl.h
+++ b/content/browser/tracing/tracing_controller_impl.h
@@ -9,12 +9,12 @@
#include <string>
#include <vector>
-#include "base/files/file_path.h"
#include "base/lazy_instance.h"
#include "content/public/browser/tracing_controller.h"
namespace base {
class RefCountedString;
+class RefCountedMemory;
}
namespace content {
@@ -34,8 +34,7 @@ class TracingControllerImpl : public TracingController {
const base::debug::TraceOptions& trace_options,
const EnableRecordingDoneCallback& callback) OVERRIDE;
virtual bool DisableRecording(
- const base::FilePath& result_file_path,
- const TracingFileResultCallback& callback) OVERRIDE;
+ const scoped_refptr<TraceDataSink>& sink) OVERRIDE;
virtual bool EnableMonitoring(
const base::debug::CategoryFilter& category_filter,
const base::debug::TraceOptions& trace_options,
@@ -47,8 +46,7 @@ class TracingControllerImpl : public TracingController {
base::debug::CategoryFilter* out_category_filter,
base::debug::TraceOptions* out_trace_options) OVERRIDE;
virtual bool CaptureMonitoringSnapshot(
- const base::FilePath& result_file_path,
- const TracingFileResultCallback& callback) OVERRIDE;
+ const scoped_refptr<TraceDataSink>& sink) OVERRIDE;
virtual bool GetTraceBufferPercentFull(
const GetTraceBufferPercentFullCallback& callback) OVERRIDE;
virtual bool SetWatchEvent(const std::string& category_name,
@@ -61,7 +59,6 @@ class TracingControllerImpl : public TracingController {
private:
typedef std::set<scoped_refptr<TraceMessageFilter> > TraceMessageFilterSet;
- class ResultFile;
friend struct base::DefaultLazyInstanceTraits<TracingControllerImpl>;
friend class TraceMessageFilter;
@@ -74,7 +71,7 @@ class TracingControllerImpl : public TracingController {
}
bool can_disable_recording() const {
- return is_recording_ && !result_file_;
+ return is_recording_ && !trace_data_sink_.get();
}
bool can_enable_monitoring() const {
@@ -82,7 +79,7 @@ class TracingControllerImpl : public TracingController {
}
bool can_disable_monitoring() const {
- return is_monitoring_ && !monitoring_snapshot_file_;
+ return is_monitoring_ && !monitoring_data_sink_.get();
}
bool can_get_trace_buffer_percent_full() const {
@@ -114,8 +111,6 @@ class TracingControllerImpl : public TracingController {
void OnDisableRecordingAcked(
TraceMessageFilter* trace_message_filter,
const std::vector<std::string>& known_category_groups);
- void OnDisableRecordingComplete();
- void OnResultFileClosed();
#if defined(OS_CHROMEOS) || defined(OS_WIN)
void OnEndSystemTracingAcked(
@@ -124,7 +119,6 @@ class TracingControllerImpl : public TracingController {
void OnCaptureMonitoringSnapshotAcked(
TraceMessageFilter* trace_message_filter);
- void OnMonitoringSnapshotFileClosed();
void OnTraceBufferPercentFullReply(
TraceMessageFilter* trace_message_filter,
@@ -141,8 +135,7 @@ class TracingControllerImpl : public TracingController {
void OnEnableRecordingDone(const base::debug::CategoryFilter& category_filter,
const base::debug::TraceOptions& trace_options,
const EnableRecordingDoneCallback& callback);
- void OnDisableRecordingDone(const base::FilePath& result_file_path,
- const TracingFileResultCallback& callback);
+ void OnDisableRecordingDone();
void OnEnableMonitoringDone(
const base::debug::CategoryFilter& category_filter,
const base::debug::TraceOptions& trace_options,
@@ -172,8 +165,6 @@ class TracingControllerImpl : public TracingController {
base::debug::TraceOptions trace_options_;
GetCategoriesDoneCallback pending_get_categories_done_callback_;
- TracingFileResultCallback pending_disable_recording_done_callback_;
- TracingFileResultCallback pending_capture_monitoring_snapshot_done_callback_;
GetTraceBufferPercentFullCallback pending_trace_buffer_percent_full_callback_;
std::string watch_category_name_;
@@ -182,8 +173,8 @@ class TracingControllerImpl : public TracingController {
std::set<std::string> known_category_groups_;
std::set<TracingUI*> tracing_uis_;
- scoped_ptr<ResultFile> result_file_;
- scoped_ptr<ResultFile> monitoring_snapshot_file_;
+ scoped_refptr<TraceDataSink> trace_data_sink_;
+ scoped_refptr<TraceDataSink> monitoring_data_sink_;
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