#include "chrome/test/chromedriver/performance_logger.h"
#include <string>
#include <vector>
#include "base/functional/bind.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "chrome/test/chromedriver/chrome/chrome.h"
#include "chrome/test/chromedriver/chrome/devtools_client.h"
#include "chrome/test/chromedriver/chrome/devtools_client_impl.h"
#include "chrome/test/chromedriver/chrome/log.h"
#include "chrome/test/chromedriver/chrome/status.h"
#include "chrome/test/chromedriver/chrome/web_view.h"
#include "chrome/test/chromedriver/chrome/web_view_impl.h"
#include "chrome/test/chromedriver/net/timeout.h"
#include "chrome/test/chromedriver/session.h"
namespace {
const char* const kDomains[] = …;
const char* const kRequestTraceCommands[] = …;
bool IsBrowserwideClient(DevToolsClient* client) { … }
bool IsEnabled(const PerfLoggingPrefs::InspectorDomainStatus& domain_status) { … }
bool ShouldRequestTraceEvents(const std::string& command,
const bool log_emptied) { … }
bool ShouldLogEvent(const std::string& method) { … }
}
PerformanceLogger::PerformanceLogger(Log* log, const Session* session)
: … { … }
PerformanceLogger::PerformanceLogger(Log* log,
const Session* session,
const PerfLoggingPrefs& prefs,
bool enable_service_worker)
: … { … }
bool PerformanceLogger::subscribes_to_browser() { … }
Status PerformanceLogger::OnConnected(DevToolsClient* client) { … }
Status PerformanceLogger::OnEvent(DevToolsClient* client,
const std::string& method,
const base::Value::Dict& params) { … }
Status PerformanceLogger::BeforeCommand(const std::string& command_name) { … }
void PerformanceLogger::AddLogEntry(Log::Level level,
const std::string& webview,
const std::string& method,
const base::Value::Dict& params) { … }
void PerformanceLogger::AddLogEntry(const std::string& webview,
const std::string& method,
const base::Value::Dict& params) { … }
Status PerformanceLogger::EnableInspectorDomains(DevToolsClient* client) { … }
Status PerformanceLogger::HandleInspectorEvents(
DevToolsClient* client,
const std::string& method,
const base::Value::Dict& params) { … }
Status PerformanceLogger::HandleTraceEvents(DevToolsClient* client,
const std::string& method,
const base::Value::Dict& params) { … }
Status PerformanceLogger::StartTrace() { … }
Status PerformanceLogger::CollectTraceEvents() { … }
Status PerformanceLogger::IsTraceDone(bool* trace_done) const { … }