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

Unified Diff: content/browser/devtools/protocol/tracing_handler.h

Issue 2500093002: [DevTools] Move IO and Tracing to new generator. (Closed)
Patch Set: roll Created 4 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: 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..41250a7defd49b6b38b89dc1aebc8d81cb7e2db4 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,47 @@ 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 Detached();
+ void Wire(UberDispatcher*);
+ 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 +80,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 +92,7 @@ class TracingHandler {
DISALLOW_COPY_AND_ASSIGN(TracingHandler);
};
-} // namespace tracing
-} // namespace devtools
+} // namespace protocol
} // namespace content
#endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_
« no previous file with comments | « content/browser/devtools/protocol/io_handler.cc ('k') | content/browser/devtools/protocol/tracing_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698