chromium/services/network/public/cpp/resource_request.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "services/network/public/cpp/resource_request.h"

#include "base/strings/string_number_conversions.h"
#include "base/trace_event/typed_macros.h"
#include "base/types/optional_util.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "net/base/load_flags.h"
#include "net/log/net_log_source.h"
#include "services/network/public/mojom/cookie_access_observer.mojom.h"
#include "services/network/public/mojom/devtools_observer.mojom.h"
#include "services/network/public/mojom/trust_token_access_observer.mojom.h"
#include "services/network/public/mojom/url_request.mojom.h"
#include "services/network/public/mojom/web_bundle_handle.mojom.h"

namespace network {

namespace {

mojo::PendingRemote<mojom::CookieAccessObserver> Clone(
    mojo::PendingRemote<mojom::CookieAccessObserver>* observer) {}

mojo::PendingRemote<mojom::TrustTokenAccessObserver> Clone(
    mojo::PendingRemote<mojom::TrustTokenAccessObserver>* observer) {}

mojo::PendingRemote<mojom::URLLoaderNetworkServiceObserver> Clone(
    mojo::PendingRemote<mojom::URLLoaderNetworkServiceObserver>* observer) {}

mojo::PendingRemote<mojom::DevToolsObserver> Clone(
    mojo::PendingRemote<mojom::DevToolsObserver>* observer) {}

mojo::PendingRemote<mojom::AcceptCHFrameObserver> Clone(
    mojo::PendingRemote<mojom::AcceptCHFrameObserver>& observer) {}

mojo::PendingRemote<mojom::SharedDictionaryAccessObserver> Clone(
    mojo::PendingRemote<mojom::SharedDictionaryAccessObserver>& observer) {}

// Returns true iff either holds true:
//
//  - both |lhs| and |rhs| are nullopt, or
//  - neither is nullopt and they both contain equal values
//
bool OptionalTrustedParamsEqualsForTesting(
    const std::optional<ResourceRequest::TrustedParams>& lhs,
    const std::optional<ResourceRequest::TrustedParams>& rhs) {}

bool OptionalWebBundleTokenParamsEqualsForTesting(  // IN-TEST
    const std::optional<ResourceRequest::WebBundleTokenParams>& lhs,
    const std::optional<ResourceRequest::WebBundleTokenParams>& rhs) {}

bool OptionalNetLogInfoEqualsForTesting(
    const std::optional<net::NetLogSource>& lhs,
    const std::optional<net::NetLogSource>& rhs) {}

base::debug::CrashKeyString* GetRequestUrlCrashKey() {}

base::debug::CrashKeyString* GetRequestInitiatorCrashKey() {}

base::debug::CrashKeyString* GetRequestResourceTypeCrashKey() {}

}  // namespace

ResourceRequest::TrustedParams::TrustedParams() = default;
ResourceRequest::TrustedParams::~TrustedParams() = default;

ResourceRequest::TrustedParams::TrustedParams(const TrustedParams& other) {}

ResourceRequest::TrustedParams& ResourceRequest::TrustedParams::operator=(
    const TrustedParams& other) {}

ResourceRequest::TrustedParams::TrustedParams(TrustedParams&& other) = default;
ResourceRequest::TrustedParams& ResourceRequest::TrustedParams::operator=(
    TrustedParams&& other) = default;

bool ResourceRequest::TrustedParams::EqualsForTesting(
    const TrustedParams& other) const {}

ResourceRequest::WebBundleTokenParams::WebBundleTokenParams() = default;
ResourceRequest::WebBundleTokenParams::~WebBundleTokenParams() = default;

ResourceRequest::WebBundleTokenParams::WebBundleTokenParams(
    const WebBundleTokenParams& other) {}

ResourceRequest::WebBundleTokenParams&
ResourceRequest::WebBundleTokenParams::operator=(
    const WebBundleTokenParams& other) {}

ResourceRequest::WebBundleTokenParams::WebBundleTokenParams(
    const GURL& bundle_url,
    const base::UnguessableToken& token,
    mojo::PendingRemote<mojom::WebBundleHandle> handle)
    :{}

ResourceRequest::WebBundleTokenParams::WebBundleTokenParams(
    const GURL& bundle_url,
    const base::UnguessableToken& token,
    int32_t render_process_id)
    :{}

bool ResourceRequest::WebBundleTokenParams::EqualsForTesting(
    const WebBundleTokenParams& other) const {}

mojo::PendingRemote<mojom::WebBundleHandle>
ResourceRequest::WebBundleTokenParams::CloneHandle() const {}

ResourceRequest::ResourceRequest() = default;
ResourceRequest::ResourceRequest(const ResourceRequest& request) {}
ResourceRequest& ResourceRequest::operator=(const ResourceRequest& other) =
    default;
ResourceRequest::ResourceRequest(ResourceRequest&& other) = default;
ResourceRequest& ResourceRequest::operator=(ResourceRequest&& other) = default;
ResourceRequest::~ResourceRequest() = default;

bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const {}

bool ResourceRequest::SendsCookies() const {}

bool ResourceRequest::SavesCookies() const {}

net::ReferrerPolicy ReferrerPolicyForUrlRequest(
    mojom::ReferrerPolicy referrer_policy) {}

namespace debug {

ScopedResourceRequestCrashKeys::ScopedResourceRequestCrashKeys(
    const network::ResourceRequest& request)
    :{}

ScopedResourceRequestCrashKeys::~ScopedResourceRequestCrashKeys() = default;

}  // namespace debug
}  // namespace network