Index: content/browser/devtools/protocol/tracing_handler.h |
diff --git a/content/browser/devtools/protocol/tracing_handler.h b/content/browser/devtools/protocol/tracing_handler.h |
index 5a235be20cd06bb218122cd5809282078b57f3d0..aa25eef56b28a30177c9dea9af8ce43db8c2e3ae 100644 |
--- a/content/browser/devtools/protocol/tracing_handler.h |
+++ b/content/browser/devtools/protocol/tracing_handler.h |
@@ -15,7 +15,7 @@ |
#include "base/macros.h" |
#include "base/memory/weak_ptr.h" |
#include "base/trace_event/trace_event.h" |
-#include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" |
+#include "content/browser/devtools/protocol/tracing.h" |
#include "content/common/content_export.h" |
#include "content/public/browser/tracing_controller.h" |
@@ -24,49 +24,48 @@ class Timer; |
} |
namespace content { |
-namespace devtools { |
class DevToolsIOContext; |
-namespace tracing { |
+namespace protocol { |
-class TracingHandler { |
+class TracingHandler : public Tracing::Backend { |
public: |
- typedef DevToolsProtocolClient::Response Response; |
- |
enum Target { Browser, Renderer }; |
TracingHandler(Target target, |
int frame_tree_node_id, |
DevToolsIOContext* io_context); |
- virtual ~TracingHandler(); |
+ ~TracingHandler() override; |
- void SetClient(std::unique_ptr<Client> client); |
+ void Wire(UberDispatcher*); |
void Detached(); |
+ Response Disable() override; |
void OnTraceDataCollected(const std::string& trace_fragment); |
void OnTraceComplete(); |
void OnTraceToStreamComplete(const std::string& stream_handle); |
// Protocol methods. |
- Response Start(DevToolsCommandId command_id, |
- const std::string* categories, |
- const std::string* options, |
- const double* buffer_usage_reporting_interval, |
- const std::string* transfer_mode, |
- const std::unique_ptr<base::DictionaryValue>& config); |
- Response End(DevToolsCommandId command_id); |
- Response GetCategories(DevToolsCommandId command); |
- Response RequestMemoryDump(DevToolsCommandId command_id); |
- Response RecordClockSyncMarker(const std::string& sync_id); |
+ void Start(Maybe<std::string> categories, |
+ Maybe<std::string> options, |
+ Maybe<double> buffer_usage_reporting_interval, |
+ Maybe<std::string> transfer_mode, |
+ Maybe<Tracing::TraceConfig> config, |
+ std::unique_ptr<StartCallback> callback) override; |
+ void End(std::unique_ptr<EndCallback> callback) override; |
+ void GetCategories(std::unique_ptr<GetCategoriesCallback> callback) override; |
+ void RequestMemoryDump( |
+ std::unique_ptr<RequestMemoryDumpCallback> callback) override; |
+ Response RecordClockSyncMarker(const std::string& sync_id) override; |
bool did_initiate_recording() { return did_initiate_recording_; } |
private: |
- void OnRecordingEnabled(DevToolsCommandId command_id); |
+ void OnRecordingEnabled(std::unique_ptr<StartCallback> callback); |
void OnBufferUsage(float percent_full, size_t approximate_event_count); |
- void OnCategoriesReceived(DevToolsCommandId command_id, |
+ void OnCategoriesReceived(std::unique_ptr<GetCategoriesCallback> callback, |
const std::set<std::string>& category_set); |
- void OnMemoryDumpFinished(DevToolsCommandId command_id, |
+ void OnMemoryDumpFinished(std::unique_ptr<RequestMemoryDumpCallback> callback, |
uint64_t dump_guid, |
bool success); |
@@ -82,7 +81,7 @@ class TracingHandler { |
std::unique_ptr<base::Timer> buffer_usage_poll_timer_; |
Target target_; |
- std::unique_ptr<Client> client_; |
+ std::unique_ptr<Tracing::Frontend> frontend_; |
DevToolsIOContext* io_context_; |
int frame_tree_node_id_; |
bool did_initiate_recording_; |
@@ -94,8 +93,7 @@ class TracingHandler { |
DISALLOW_COPY_AND_ASSIGN(TracingHandler); |
}; |
-} // namespace tracing |
-} // namespace devtools |
+} // namespace protocol |
} // namespace content |
#endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_ |