#include "content/browser/interest_group/interest_group_permissions_checker.h"
#include "base/functional/callback.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/time/time.h"
#include "content/browser/interest_group/interest_group_permissions_cache.h"
#include "content/public/browser/global_request_id.h"
#include "net/base/network_isolation_key.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_response_headers.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/data_decoder/public/cpp/data_decoder.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "third_party/blink/public/common/mime_util/mime_util.h"
#include "url/gurl.h"
#include "url/origin.h"
#include "url/url_constants.h"
namespace content {
namespace {
constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation = …;
}
constexpr base::TimeDelta InterestGroupPermissionsChecker::kRequestTimeout = …;
InterestGroupPermissionsChecker::ActiveRequest::ActiveRequest() = default;
InterestGroupPermissionsChecker::ActiveRequest::~ActiveRequest() = default;
InterestGroupPermissionsChecker::PendingPermissionsCheck::
PendingPermissionsCheck(Operation operation,
PermissionsCheckCallback permissions_check_callback)
: … { … }
InterestGroupPermissionsChecker::PendingPermissionsCheck::
PendingPermissionsCheck(PendingPermissionsCheck&&) = default;
InterestGroupPermissionsChecker::PendingPermissionsCheck::
~PendingPermissionsCheck() = default;
InterestGroupPermissionsChecker::InterestGroupPermissionsChecker() = default;
InterestGroupPermissionsChecker::~InterestGroupPermissionsChecker() = default;
void InterestGroupPermissionsChecker::CheckPermissions(
Operation operation,
const url::Origin& frame_origin,
const url::Origin& interest_group_owner,
const net::NetworkIsolationKey& network_isolation_key,
network::mojom::URLLoaderFactory& url_loader_factory,
PermissionsCheckCallback permissions_check_callback) { … }
void InterestGroupPermissionsChecker::ClearCache() { … }
void InterestGroupPermissionsChecker::OnRequestComplete(
ActiveRequestMap::iterator active_request,
std::unique_ptr<std::string> response_body) { … }
void InterestGroupPermissionsChecker::OnJsonParsed(
ActiveRequestMap::iterator active_request,
data_decoder::DataDecoder::ValueOrError result) { … }
void InterestGroupPermissionsChecker::OnActiveRequestComplete(
ActiveRequestMap::iterator active_request,
Permissions permissions) { … }
bool InterestGroupPermissionsChecker::AllowsOperation(Permissions permissions,
Operation operation) { … }
}