#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include <stddef.h>
#include <string_view>
#include "base/functional/bind.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/devtools/device/android_device_manager.h"
namespace {
#define SEPARATOR …
const char kAllCommands[] = …;
const char kSeparator[] = …;
#undef SEPARATOR
const char kScreenSizePrefix[] = …;
const char kUserInfoPrefix[] = …;
const char kDevToolsSocketSuffix[] = …;
const char kChromeDefaultName[] = …;
const char kChromeDefaultSocket[] = …;
const char kWebViewSocketPrefix[] = …;
const char kWebViewNameTemplate[] = …;
struct BrowserDescriptor { … };
const BrowserDescriptor kBrowserDescriptors[] = …;
const BrowserDescriptor* FindBrowserDescriptor(const std::string& package) { … }
bool BrowserCompare(const AndroidDeviceManager::BrowserInfo& a,
const AndroidDeviceManager::BrowserInfo& b) { … }
StringMap;
void MapProcessesToPackages(const std::string& response,
StringMap* pid_to_package,
StringMap* pid_to_user) { … }
StringMap MapSocketsToProcesses(const std::string& response) { … }
gfx::Size ParseScreenSize(std::string_view str) { … }
gfx::Size ParseWindowPolicyResponse(const std::string& response) { … }
StringMap MapIdsToUsers(const std::string& response) { … }
std::string GetUserName(const std::string& unix_user,
const StringMap id_to_username) { … }
AndroidDeviceManager::BrowserInfo::Type
GetBrowserType(const std::string& socket) { … }
void ReceivedResponse(AndroidDeviceManager::DeviceInfoCallback callback,
int result,
const std::string& response) { … }
}
std::string AndroidDeviceManager::GetBrowserName(const std::string& socket,
const std::string& package) { … }
void AndroidDeviceManager::QueryDeviceInfo(RunCommandCallback command_callback,
DeviceInfoCallback callback) { … }