| 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 d2fc77307b92cd2fa0238089ca170c9c8b3d70a8..152eee646d4dd360ae15db270d871ae4f89de758 100644
|
| --- a/content/browser/devtools/protocol/tracing_handler.h
|
| +++ b/content/browser/devtools/protocol/tracing_handler.h
|
| @@ -5,7 +5,18 @@
|
| #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_
|
| #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_TRACING_HANDLER_H_
|
|
|
| +#include <set>
|
| +#include <string>
|
| +
|
| +#include "base/debug/trace_event.h"
|
| +#include "base/memory/weak_ptr.h"
|
| #include "content/browser/devtools/protocol/devtools_protocol_handler_impl.h"
|
| +#include "content/public/browser/tracing_controller.h"
|
| +
|
| +namespace base {
|
| +class RefCountedString;
|
| +class Timer;
|
| +}
|
|
|
| namespace content {
|
| namespace devtools {
|
| @@ -15,31 +26,45 @@ class TracingHandler {
|
| public:
|
| typedef DevToolsProtocolClient::Response Response;
|
|
|
| - TracingHandler();
|
| + enum Target { Browser, Renderer };
|
| + explicit TracingHandler(Target target);
|
| virtual ~TracingHandler();
|
|
|
| void SetClient(scoped_ptr<Client> client);
|
| + void Detached();
|
| +
|
| + void OnTraceDataCollected(const std::string& trace_fragment);
|
| + void OnTraceComplete();
|
|
|
| - // TODO(dgozman): remove sync version after migration.
|
| - Response Start(const std::string& categories,
|
| - const std::string& options,
|
| - const double* buffer_usage_reporting_interval);
|
| scoped_refptr<DevToolsProtocol::Response> Start(
|
| const std::string& categories,
|
| const std::string& options,
|
| const double* buffer_usage_reporting_interval,
|
| scoped_refptr<DevToolsProtocol::Command> command);
|
| -
|
| - // TODO(dgozman): remove sync version after migration.
|
| - Response End();
|
| scoped_refptr<DevToolsProtocol::Response> End(
|
| scoped_refptr<DevToolsProtocol::Command> command);
|
| -
|
| scoped_refptr<DevToolsProtocol::Response> GetCategories(
|
| scoped_refptr<DevToolsProtocol::Command> command);
|
|
|
| private:
|
| + void OnRecordingEnabled(scoped_refptr<DevToolsProtocol::Command> command);
|
| + void OnBufferUsage(float usage);
|
| +
|
| + void OnCategoriesReceived(scoped_refptr<DevToolsProtocol::Command> command,
|
| + const std::set<std::string>& category_set);
|
| +
|
| + base::debug::TraceOptions TraceOptionsFromString(const std::string& options);
|
| +
|
| + void SetupTimer(double usage_reporting_interval);
|
| +
|
| + void DisableRecording(bool abort);
|
| +
|
| + scoped_ptr<base::Timer> buffer_usage_poll_timer_;
|
| + Target target_;
|
| + bool is_recording_;
|
| +
|
| scoped_ptr<Client> client_;
|
| + base::WeakPtrFactory<TracingHandler> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(TracingHandler);
|
| };
|
|
|