chromium/chrome/test/chromedriver/performance_logger.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// DevTools event domain prefixes to intercept.
const char* const kDomains[] =;

// Whitelist of WebDriver commands on which to request buffered trace events.
const char* const kRequestTraceCommands[] =;

bool IsBrowserwideClient(DevToolsClient* client) {}

bool IsEnabled(const PerfLoggingPrefs::InspectorDomainStatus& domain_status) {}

// Returns whether |command| is in kRequestTraceCommands[] (case-insensitive).
// In the case of GetLog, also check if it has been called previously, that it
// was emptying an empty log.
bool ShouldRequestTraceEvents(const std::string& command,
                              const bool log_emptied) {}

// Returns whether the event belongs to one of kDomains.
bool ShouldLogEvent(const std::string& method) {}

}  // namespace

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 {}