chromium/extensions/common/api/sockets/sockets_manifest_permission.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 "extensions/common/api/sockets/sockets_manifest_permission.h"

#include <memory>

#include "base/stl_util.h"
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "extensions/common/api/extensions_manifest_types.h"
#include "extensions/common/api/sockets/sockets_manifest_data.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/strings/grit/extensions_strings.h"
#include "ipc/ipc_message.h"
#include "ui/base/l10n/l10n_util.h"

APIPermissionID;

namespace extensions {

namespace sockets_errors {
const char kErrorInvalidHostPattern[] =;
}

Sockets;
SocketHostPatterns;
SocketPermissionRequest;

namespace {

static bool ParseHostPattern(
    SocketsManifestPermission* permission,
    content::SocketPermissionRequest::OperationType operation_type,
    const std::string& host_pattern,
    std::u16string* error) {}

static bool ParseHostPatterns(
    SocketsManifestPermission* permission,
    content::SocketPermissionRequest::OperationType operation_type,
    const std::optional<SocketHostPatterns>& host_patterns,
    std::u16string* error) {}

static void SetHostPatterns(
    std::optional<SocketHostPatterns>& host_patterns,
    const SocketsManifestPermission* permission,
    content::SocketPermissionRequest::OperationType operation_type) {}

// Helper function for adding the 'any host' permission. Determines if the
// message is needed from |sockets|, and adds the permission to |ids|.
// Returns true if it added the message.
bool AddAnyHostMessage(const SocketPermissionEntrySet& sockets,
                       PermissionIDSet* ids) {}

// Helper function for adding subdomain socket permissions. Determines what
// messages are needed from |sockets|, and adds permissions to |ids|.
void AddSubdomainHostMessage(const SocketPermissionEntrySet& sockets,
                             PermissionIDSet* ids) {}

// Helper function for adding specific host socket permissions. Determines what
// messages are needed from |sockets|, and adds permissions to |ids|.
void AddSpecificHostMessage(const SocketPermissionEntrySet& sockets,
                            PermissionIDSet* ids) {}

// Helper function for adding the network list socket permission. Determines if
// the message is needed from |sockets|, and adds the permission to |ids|.
void AddNetworkListMessage(const SocketPermissionEntrySet& sockets,
                           PermissionIDSet* ids) {}

}  // namespace

SocketsManifestPermission::SocketsManifestPermission() = default;

SocketsManifestPermission::~SocketsManifestPermission() = default;

// static
std::unique_ptr<SocketsManifestPermission> SocketsManifestPermission::FromValue(
    const base::Value& value,
    std::u16string* error) {}

bool SocketsManifestPermission::CheckRequest(
    const Extension* extension,
    const SocketPermissionRequest& request) const {}

std::string SocketsManifestPermission::name() const {}

std::string SocketsManifestPermission::id() const {}

PermissionIDSet SocketsManifestPermission::GetPermissions() const {}

bool SocketsManifestPermission::FromValue(const base::Value* value) {}

std::unique_ptr<base::Value> SocketsManifestPermission::ToValue() const {}

std::unique_ptr<ManifestPermission> SocketsManifestPermission::Diff(
    const ManifestPermission* rhs) const {}

std::unique_ptr<ManifestPermission> SocketsManifestPermission::Union(
    const ManifestPermission* rhs) const {}

std::unique_ptr<ManifestPermission> SocketsManifestPermission::Intersect(
    const ManifestPermission* rhs) const {}

void SocketsManifestPermission::AddPermission(
    const SocketPermissionEntry& entry) {}

// static
void SocketsManifestPermission::AddSocketHostPermissions(
    const SocketPermissionEntrySet& sockets,
    PermissionIDSet* ids) {}

bool SocketsManifestPermission::RequiresManagementUIWarning() const {}

bool SocketsManifestPermission::RequiresManagedSessionFullLoginWarning() const {}

}  // namespace extensions