#ifndef CONTENT_WEB_TEST_BROWSER_WEB_TEST_TRACING_CONTROLLER_H_
#define CONTENT_WEB_TEST_BROWSER_WEB_TEST_TRACING_CONTROLLER_H_
#include <optional>
#include "base/files/file.h"
#include "base/run_loop.h"
#include "content/common/content_export.h"
namespace perfetto {
class TracingSession;
}
namespace content {
class WebTestTracingController {
public:
explicit WebTestTracingController(base::FilePath trace_file_path);
~WebTestTracingController();
void StartTracing();
void StopTracing();
void TracingFinished();
private:
void OnTracingStopped();
base::FilePath trace_file_path_;
base::File tracing_file_;
std::unique_ptr<perfetto::TracingSession> tracing_session_;
std::optional<base::RunLoop> stop_tracing_run_loop_;
bool tracing_is_stopping_ = false;
};
}
#endif