chromium/chrome/test/chromedriver/log_replay/devtools_log_reader.h

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

#include <fstream>
#include <memory>
#include <string>

#include "base/files/file_path.h"

// Represents one DevTools entry (command or response) in the log.
//
// These appear in the log in the following format:
// [<timestamp>][DEBUG]: DevTools <protocol_type> <event_type> <command_name>
//     (id=<id>) <payload>
// where:
//
// <protocol_type> is either HTTP or WebSocket
//
// <event_type> is either "Command:" (for WebSocket only), "Request:" (for HTTP
//   only), "Response:", or "Event:"
//
// <command_name> is the command for WebSocket (like "DOM.getDocument") or a url
// for HTTP (like "http://localhost:38845/json")
//
// <id> is a sequential number to identify WebSocket commands with their
// responses
//
// <socket_id> identifies the WebSocket instance this entry came from, if any.
//
// <payload> is either the parameters in case of a WebSocket command, or the
// response in case of any response. It is always a JSON, and always spans
// multiple lines.
class LogEntry {};

// Reads a log file for DevTools entries.
class DevToolsLogReader {};

#endif  // CHROME_TEST_CHROMEDRIVER_LOG_REPLAY_DEVTOOLS_LOG_READER_H_