#include "extensions/common/permissions/socket_permission_entry.h"
#include <stdint.h>
#include <cstdlib>
#include <memory>
#include <sstream>
#include <string_view>
#include <tuple>
#include <vector>
#include "base/check.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "extensions/common/permissions/api_permission.h"
#include "extensions/common/permissions/socket_permission.h"
#include "url/url_canon.h"
namespace {
SocketPermissionRequest;
const char kColon = …;
const char kDot = …;
const char kWildcard[] = …;
const uint16_t kWildcardPortNumber = …;
const uint16_t kInvalidPort = …;
bool StartsOrEndsWithWhitespace(const std::string& str) { … }
}
namespace extensions {
SocketPermissionEntry::SocketPermissionEntry()
: … { … }
SocketPermissionEntry::~SocketPermissionEntry() = default;
bool SocketPermissionEntry::operator<(const SocketPermissionEntry& rhs) const { … }
bool SocketPermissionEntry::operator==(const SocketPermissionEntry& rhs) const { … }
bool SocketPermissionEntry::Check(
const content::SocketPermissionRequest& request) const { … }
SocketPermissionEntry::HostType SocketPermissionEntry::GetHostType() const { … }
bool SocketPermissionEntry::IsAddressBoundType() const { … }
bool SocketPermissionEntry::ParseHostPattern(
SocketPermissionRequest::OperationType type,
const std::string& pattern,
SocketPermissionEntry* entry) { … }
bool SocketPermissionEntry::ParseHostPattern(
SocketPermissionRequest::OperationType type,
const std::vector<std::string>& pattern_tokens,
SocketPermissionEntry* entry) { … }
std::string SocketPermissionEntry::GetHostPatternAsString() const { … }
}