#include "chrome/test/chromedriver/session.h"
#include <list>
#include <utility>
#include <string.h>
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "chrome/test/chromedriver/chrome/chrome.h"
#include "chrome/test/chromedriver/chrome/status.h"
#include "chrome/test/chromedriver/chrome/web_view.h"
#include "chrome/test/chromedriver/logging.h"
#include "third_party/abseil-cpp/absl/base/attributes.h"
namespace {
ABSL_CONST_INIT thread_local Session* session = …;
}
namespace internal {
Status SplitChannel(std::string* channel,
int* connection_id,
std::string* suffix) { … }
}
FrameInfo::FrameInfo(const std::string& parent_frame_id,
const std::string& frame_id,
const std::string& chromedriver_frame_id)
: … { … }
InputCancelListEntry::InputCancelListEntry(base::Value::Dict* input_state,
const MouseEvent* mouse_event,
const TouchEvent* touch_event,
const KeyEvent* key_event)
: … { … }
InputCancelListEntry::InputCancelListEntry(InputCancelListEntry&& other) =
default;
InputCancelListEntry::~InputCancelListEntry() = default;
BidiConnection::BidiConnection(int connection_id,
SendTextFunc send_response,
CloseFunc close_connection)
: … { … }
BidiConnection::BidiConnection(BidiConnection&& other) = default;
BidiConnection::~BidiConnection() = default;
BidiConnection& BidiConnection::operator=(BidiConnection&& other) = default;
const base::TimeDelta Session::kDefaultImplicitWaitTimeout = …;
const base::TimeDelta Session::kDefaultPageLoadTimeout = …;
const base::TimeDelta Session::kDefaultScriptTimeout = …;
const base::TimeDelta Session::kDefaultBrowserStartupTimeout = …;
const char Session::kChannelSuffix[] = …;
const char Session::kNoChannelSuffix[] = …;
const char Session::kBlockingChannelSuffix[] = …;
Session::Session(const std::string& id)
: … { … }
Session::Session(const std::string& id, std::unique_ptr<Chrome> chrome)
: … { … }
Session::Session(const std::string& id, const std::string& host) : … { … }
Session::~Session() { … }
Status Session::GetTargetWindow(WebView** web_view) { … }
void Session::SwitchToTopFrame() { … }
void Session::SwitchToParentFrame() { … }
void Session::SwitchToSubFrame(const std::string& frame_id,
const std::string& chromedriver_frame_id) { … }
std::string Session::GetCurrentFrameId() const { … }
std::vector<WebDriverLog*> Session::GetAllLogs() const { … }
void Session::SwitchFrameInternal(bool for_top_frame) { … }
Status Session::OnBidiResponse(base::Value::Dict payload) { … }
void Session::AddBidiConnection(int connection_id,
SendTextFunc send_response,
CloseFunc close_connection) { … }
void Session::RemoveBidiConnection(int connection_id) { … }
void Session::CloseAllConnections() { … }
Session* GetThreadLocalSession() { … }
void SetThreadLocalSession(std::unique_ptr<Session> new_session) { … }