| Index: content/browser/tracing/tracing_ui.cc
|
| diff --git a/content/browser/tracing/tracing_ui.cc b/content/browser/tracing/tracing_ui.cc
|
| index 193774a6ea091bba7ef026c9a6ccf0cf488e3a3d..b9374600fe917f9c275f56a26291f24b4133f353 100644
|
| --- a/content/browser/tracing/tracing_ui.cc
|
| +++ b/content/browser/tracing/tracing_ui.cc
|
| @@ -13,7 +13,6 @@
|
| #include "base/bind_helpers.h"
|
| #include "base/command_line.h"
|
| #include "base/debug/trace_event.h"
|
| -#include "base/file_util.h"
|
| #include "base/format_macros.h"
|
| #include "base/json/json_reader.h"
|
| #include "base/json/json_writer.h"
|
| @@ -136,23 +135,6 @@ void OnTraceBufferPercentFullResult(
|
| callback.Run(base::RefCountedString::TakeString(&str));
|
| }
|
|
|
| -void ReadRecordingResult(const WebUIDataSource::GotDataCallback& callback,
|
| - const base::FilePath& path) {
|
| - std::string tmp;
|
| - if (!base::ReadFileToString(path, &tmp))
|
| - LOG(ERROR) << "Failed to read file " << path.value();
|
| - base::DeleteFile(path, false);
|
| - callback.Run(base::RefCountedString::TakeString(&tmp));
|
| -}
|
| -
|
| -void BeginReadingRecordingResult(
|
| - const WebUIDataSource::GotDataCallback& callback,
|
| - const base::FilePath& path) {
|
| - BrowserThread::PostTask(
|
| - BrowserThread::FILE, FROM_HERE,
|
| - base::Bind(ReadRecordingResult, callback, path));
|
| -}
|
| -
|
| void OnMonitoringEnabledAck(const WebUIDataSource::GotDataCallback& callback);
|
|
|
| bool EnableMonitoring(const std::string& data64,
|
| @@ -205,23 +187,6 @@ void GetMonitoringStatus(const WebUIDataSource::GotDataCallback& callback) {
|
| callback.Run(monitoring_options_base64);
|
| }
|
|
|
| -void ReadMonitoringSnapshot(const WebUIDataSource::GotDataCallback& callback,
|
| - const base::FilePath& path) {
|
| - std::string tmp;
|
| - if (!base::ReadFileToString(path, &tmp))
|
| - LOG(ERROR) << "Failed to read file " << path.value();
|
| - base::DeleteFile(path, false);
|
| - callback.Run(base::RefCountedString::TakeString(&tmp));
|
| -}
|
| -
|
| -void OnMonitoringSnapshotCaptured(
|
| - const WebUIDataSource::GotDataCallback& callback,
|
| - const base::FilePath& path) {
|
| - BrowserThread::PostTask(
|
| - BrowserThread::FILE, FROM_HERE,
|
| - base::Bind(ReadMonitoringSnapshot, callback, path));
|
| -}
|
| -
|
| bool OnBeginJSONRequest(const std::string& path,
|
| const WebUIDataSource::GotDataCallback& callback) {
|
| if (path == "json/categories") {
|
| @@ -240,7 +205,7 @@ bool OnBeginJSONRequest(const std::string& path,
|
| }
|
| if (path == "json/end_recording") {
|
| return TracingController::GetInstance()->DisableRecording(
|
| - base::FilePath(), base::Bind(BeginReadingRecordingResult, callback));
|
| + TracingControllerImpl::CreateStringSink(callback));
|
| }
|
|
|
| const char* enableMonitoringPath = "json/begin_monitoring?";
|
| @@ -254,7 +219,7 @@ bool OnBeginJSONRequest(const std::string& path,
|
| }
|
| if (path == "json/capture_monitoring") {
|
| TracingController::GetInstance()->CaptureMonitoringSnapshot(
|
| - base::FilePath(), base::Bind(OnMonitoringSnapshotCaptured, callback));
|
| + TracingControllerImpl::CreateStringSink(callback));
|
| return true;
|
| }
|
| if (path == "json/get_monitoring_status") {
|
|
|