#include "content/public/test/shared_storage_test_utils.h"
#include <map>
#include <memory>
#include <string>
#include <utility>
#include "base/functional/overloaded.h"
#include "base/memory/weak_ptr.h"
#include "base/notreached.h"
#include "base/strings/string_split.h"
#include "components/services/storage/shared_storage/shared_storage_manager.h"
#include "content/browser/renderer_host/frame_tree_node.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/shared_storage/shared_storage_document_service_impl.h"
#include "content/browser/shared_storage/shared_storage_worklet_host.h"
#include "content/browser/shared_storage/shared_storage_worklet_host_manager.h"
#include "content/browser/storage_partition_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_frame_navigation_observer.h"
#include "content/public/test/test_shared_storage_header_observer.h"
#include "content/test/fenced_frame_test_utils.h"
#include "services/network/public/mojom/optional_bool.mojom.h"
#include "services/network/public/mojom/url_loader_network_service_observer.mojom.h"
#include "url/gurl.h"
namespace content {
namespace {
std::string SharedStorageOperationTypeToString(OperationType operation_type) { … }
std::string SharedStorageOperationResultToString(OperationResult result) { … }
std::string OptionalStringToString(const std::optional<std::string>& str) { … }
std::string OptionalBoolToString(std::optional<bool> opt_bool) { … }
std::optional<bool> MojomToAbslOptionalBool(
network::mojom::OptionalBool opt_bool) { … }
}
SharedStorageWorkletHostManager*
GetSharedStorageWorkletHostManagerForStoragePartition(
StoragePartition* storage_partition) { … }
std::string GetSharedStorageDisabledMessage() { … }
std::string GetSharedStorageSelectURLDisabledMessage() { … }
std::string GetSharedStorageAddModuleDisabledMessage() { … }
size_t GetAttachedSharedStorageWorkletHostsCount(
StoragePartition* storage_partition) { … }
size_t GetKeepAliveSharedStorageWorkletHostsCount(
StoragePartition* storage_partition) { … }
RenderFrameHost* CreateFencedFrame(RenderFrameHost* root,
const FencedFrameNavigationTarget& target) { … }
network::mojom::OptionalBool AbslToMojomOptionalBool(
std::optional<bool> opt_bool) { … }
SharedStorageWriteOperationAndResult
SharedStorageWriteOperationAndResult::SetOperation(
const url::Origin& request_origin,
std::string key,
std::string value,
std::optional<bool> ignore_if_present,
OperationResult result) { … }
SharedStorageWriteOperationAndResult
SharedStorageWriteOperationAndResult::AppendOperation(
const url::Origin& request_origin,
std::string key,
std::string value,
OperationResult result) { … }
SharedStorageWriteOperationAndResult
SharedStorageWriteOperationAndResult::DeleteOperation(
const url::Origin& request_origin,
std::string key,
OperationResult result) { … }
SharedStorageWriteOperationAndResult
SharedStorageWriteOperationAndResult::ClearOperation(
const url::Origin& request_origin,
OperationResult result) { … }
SharedStorageWriteOperationAndResult::SharedStorageWriteOperationAndResult(
const url::Origin& request_origin,
OperationType operation_type,
std::optional<std::string> key,
std::optional<std::string> value,
std::optional<bool> ignore_if_present,
OperationResult result)
: … { … }
SharedStorageWriteOperationAndResult::SharedStorageWriteOperationAndResult(
const url::Origin& request_origin,
OperationType operation_type,
std::optional<std::string> key,
std::optional<std::string> value,
network::mojom::OptionalBool ignore_if_present,
OperationResult result)
: … { … }
SharedStorageWriteOperationAndResult::SharedStorageWriteOperationAndResult(
const url::Origin& request_origin,
OperationPtr operation,
OperationResult result)
: … { … }
SharedStorageWriteOperationAndResult::SharedStorageWriteOperationAndResult(
const SharedStorageWriteOperationAndResult&) = default;
SharedStorageWriteOperationAndResult::~SharedStorageWriteOperationAndResult() =
default;
bool operator==(const SharedStorageWriteOperationAndResult& a,
const SharedStorageWriteOperationAndResult& b) { … }
PrivateAggregationHost::PipeResult
GetPrivateAggregationHostPipeReportSuccessValue() { … }
PrivateAggregationHost::PipeResult
GetPrivateAggregationHostPipeApiDisabledValue() { … }
base::WeakPtr<TestSharedStorageHeaderObserver>
CreateAndOverrideSharedStorageHeaderObserver(StoragePartition* partition) { … }
base::StringPairs SharedStorageCrossOriginWorkletResponseHeaderReplacement(
const std::string& access_control_allow_origin_replacement,
const std::string& shared_storage_cross_origin_allowed_replacement) { … }
}