Add WebBundle-related fields to network::mojom::URLRequest
The WebBundle subresource loading POC CL is https://crrev.com/c/2503068. This CL is a part of the POC, focusing only on updating URLRequest and other related types so we can land this CL separately. The design doc: https://docs.google.com/document/d/1_AqUBS4Gr45MPPtXGTUl7Q0DMIEw2zUeWO0zo6Sj0z4/edit#heading=h.5g0nmaz8ctg This CL itself is no-op; no one is using the added fields. Follow-up CLs will use the added fields. Bug: 1082020 Change-Id: I0475aa37d935997bb9487a1705100c4fc6cc0fd9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2560526 Reviewed-by: Karan Bhatia <karandeepb@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Matt Falkenhagen <falken@chromium.org> Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org> Commit-Queue: Hayato Ito <hayato@chromium.org> Cr-Commit-Position: refs/heads/master@{#834125}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
c3cf1bd6d7
commit
823e10f920
chrome/browser/predictors
extensions/browser/api/web_request
services/network/public
cpp
request_destination.ccresource_request.ccresource_request.hurl_request_mojom_traits.ccurl_request_mojom_traits.hurl_request_mojom_traits_unittest.cc
mojom
third_party/blink
public
platform
renderer
platform
exported
loader
fetch
@ -62,6 +62,7 @@ net::RequestPriority GetRequestPriority(
|
||||
case network::mojom::RequestDestination::kSharedWorker:
|
||||
case network::mojom::RequestDestination::kTrack:
|
||||
case network::mojom::RequestDestination::kVideo:
|
||||
case network::mojom::RequestDestination::kWebBundle:
|
||||
case network::mojom::RequestDestination::kWorker:
|
||||
case network::mojom::RequestDestination::kXslt:
|
||||
return net::LOWEST;
|
||||
|
@ -93,6 +93,7 @@ WebRequestResourceType ToWebRequestResourceType(
|
||||
case network::mojom::RequestDestination::kAudioWorklet:
|
||||
case network::mojom::RequestDestination::kManifest:
|
||||
case network::mojom::RequestDestination::kPaintWorklet:
|
||||
case network::mojom::RequestDestination::kWebBundle:
|
||||
return WebRequestResourceType::OTHER;
|
||||
}
|
||||
NOTREACHED();
|
||||
|
@ -47,6 +47,8 @@ const char* RequestDestinationToString(
|
||||
return "track";
|
||||
case network::mojom::RequestDestination::kVideo:
|
||||
return "video";
|
||||
case network::mojom::RequestDestination::kWebBundle:
|
||||
return "webbundle";
|
||||
case network::mojom::RequestDestination::kWorker:
|
||||
return "worker";
|
||||
case network::mojom::RequestDestination::kXslt:
|
||||
@ -56,4 +58,4 @@ const char* RequestDestinationToString(
|
||||
return "empty";
|
||||
}
|
||||
|
||||
} // namespace network
|
||||
} // namespace network
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "mojo/public/cpp/bindings/pending_remote.h"
|
||||
#include "net/base/load_flags.h"
|
||||
#include "services/network/public/mojom/cookie_access_observer.mojom.h"
|
||||
#include "services/network/public/mojom/web_bundle_handle.mojom.h"
|
||||
|
||||
namespace network {
|
||||
|
||||
@ -34,6 +35,13 @@ bool OptionalTrustedParamsEqualsForTesting(
|
||||
return (!lhs && !rhs) || (lhs && rhs && lhs->EqualsForTesting(*rhs));
|
||||
}
|
||||
|
||||
bool OptionalWebBundleTokenParamsEqualsForTesting( // IN-TEST
|
||||
const base::Optional<ResourceRequest::WebBundleTokenParams>& lhs,
|
||||
const base::Optional<ResourceRequest::WebBundleTokenParams>& rhs) {
|
||||
return (!lhs && !rhs) ||
|
||||
(lhs && rhs && lhs->EqualsForTesting(*rhs)); // IN-TEST
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
ResourceRequest::TrustedParams::TrustedParams() = default;
|
||||
@ -63,6 +71,47 @@ bool ResourceRequest::TrustedParams::EqualsForTesting(
|
||||
client_security_state == trusted_params.client_security_state;
|
||||
}
|
||||
|
||||
ResourceRequest::WebBundleTokenParams::WebBundleTokenParams() = default;
|
||||
ResourceRequest::WebBundleTokenParams::~WebBundleTokenParams() = default;
|
||||
|
||||
ResourceRequest::WebBundleTokenParams::WebBundleTokenParams(
|
||||
const WebBundleTokenParams& other) {
|
||||
*this = other;
|
||||
}
|
||||
|
||||
ResourceRequest::WebBundleTokenParams&
|
||||
ResourceRequest::WebBundleTokenParams::operator=(
|
||||
const WebBundleTokenParams& other) {
|
||||
token = other.token;
|
||||
handle = other.CloneHandle();
|
||||
return *this;
|
||||
}
|
||||
|
||||
ResourceRequest::WebBundleTokenParams::WebBundleTokenParams(
|
||||
const base::UnguessableToken& token,
|
||||
mojo::PendingRemote<mojom::WebBundleHandle> handle)
|
||||
: token(token), handle(std::move(handle)) {}
|
||||
|
||||
bool ResourceRequest::WebBundleTokenParams::EqualsForTesting(
|
||||
const WebBundleTokenParams& other) const {
|
||||
return token == other.token &&
|
||||
((handle && other.handle) || (!handle && !other.handle));
|
||||
}
|
||||
|
||||
mojo::PendingRemote<mojom::WebBundleHandle>
|
||||
ResourceRequest::WebBundleTokenParams::CloneHandle() const {
|
||||
if (!handle)
|
||||
return mojo::NullRemote();
|
||||
mojo::Remote<network::mojom::WebBundleHandle> remote(std::move(
|
||||
const_cast<mojo::PendingRemote<network::mojom::WebBundleHandle>&>(
|
||||
handle)));
|
||||
mojo::PendingRemote<network::mojom::WebBundleHandle> new_remote;
|
||||
remote->Clone(new_remote.InitWithNewPipeAndPassReceiver());
|
||||
const_cast<mojo::PendingRemote<network::mojom::WebBundleHandle>&>(handle) =
|
||||
remote.Unbind();
|
||||
return new_remote;
|
||||
}
|
||||
|
||||
ResourceRequest::ResourceRequest() {}
|
||||
ResourceRequest::ResourceRequest(const ResourceRequest& request) = default;
|
||||
ResourceRequest::~ResourceRequest() {}
|
||||
@ -122,7 +171,9 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const {
|
||||
recursive_prefetch_token == request.recursive_prefetch_token &&
|
||||
OptionalTrustedParamsEqualsForTesting(trusted_params,
|
||||
request.trusted_params) &&
|
||||
trust_token_params == request.trust_token_params;
|
||||
trust_token_params == request.trust_token_params &&
|
||||
OptionalWebBundleTokenParamsEqualsForTesting( // IN-TEST
|
||||
web_bundle_token_params, request.web_bundle_token_params);
|
||||
}
|
||||
|
||||
bool ResourceRequest::SendsCookies() const {
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "services/network/public/mojom/fetch_api.mojom-shared.h"
|
||||
#include "services/network/public/mojom/referrer_policy.mojom-shared.h"
|
||||
#include "services/network/public/mojom/trust_tokens.mojom.h"
|
||||
#include "services/network/public/mojom/web_bundle_handle.mojom.h"
|
||||
#include "url/gurl.h"
|
||||
#include "url/origin.h"
|
||||
|
||||
@ -57,6 +58,32 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest {
|
||||
mojom::ClientSecurityStatePtr client_security_state;
|
||||
};
|
||||
|
||||
// Typemapped to network.mojom.WebBundleTokenParams, see comments there
|
||||
// for details of each field.
|
||||
struct COMPONENT_EXPORT(NETWORK_CPP_BASE) WebBundleTokenParams {
|
||||
WebBundleTokenParams();
|
||||
~WebBundleTokenParams();
|
||||
// Define a non-default copy-constructor because:
|
||||
// 1. network::ResourceRequest has a requirement that all of
|
||||
// the members be trivially copyable.
|
||||
// 2. mojo::PendingRemote is non-copyable.
|
||||
WebBundleTokenParams(const WebBundleTokenParams& params);
|
||||
WebBundleTokenParams& operator=(const WebBundleTokenParams& other);
|
||||
|
||||
WebBundleTokenParams(const base::UnguessableToken& token,
|
||||
mojo::PendingRemote<mojom::WebBundleHandle> handle);
|
||||
|
||||
// For testing. Regarding the equality of |handle|, |this| equals |other| if
|
||||
// both |handle| exists, or neither exists, because we cannot test the
|
||||
// equality of two mojo handles.
|
||||
bool EqualsForTesting(const WebBundleTokenParams& other) const;
|
||||
|
||||
mojo::PendingRemote<mojom::WebBundleHandle> CloneHandle() const;
|
||||
|
||||
base::UnguessableToken token;
|
||||
mojo::PendingRemote<mojom::WebBundleHandle> handle;
|
||||
};
|
||||
|
||||
ResourceRequest();
|
||||
ResourceRequest(const ResourceRequest& request);
|
||||
~ResourceRequest();
|
||||
@ -125,6 +152,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest {
|
||||
// field trivially copyable; see OptionalTrustTokenParams's definition for
|
||||
// more context.
|
||||
OptionalTrustTokenParams trust_token_params;
|
||||
base::Optional<WebBundleTokenParams> web_bundle_token_params;
|
||||
};
|
||||
|
||||
// This does not accept |kDefault| referrer policy.
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "services/network/public/mojom/cookie_access_observer.mojom.h"
|
||||
#include "services/network/public/mojom/trust_tokens.mojom.h"
|
||||
#include "services/network/public/mojom/url_loader.mojom-shared.h"
|
||||
#include "services/network/public/mojom/web_bundle_handle.mojom.h"
|
||||
#include "url/mojom/origin_mojom_traits.h"
|
||||
#include "url/mojom/url_gurl_mojom_traits.h"
|
||||
|
||||
@ -162,6 +163,18 @@ bool StructTraits<network::mojom::TrustedUrlRequestParamsDataView,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool StructTraits<network::mojom::WebBundleTokenParamsDataView,
|
||||
network::ResourceRequest::WebBundleTokenParams>::
|
||||
Read(network::mojom::WebBundleTokenParamsDataView data,
|
||||
network::ResourceRequest::WebBundleTokenParams* out) {
|
||||
if (!data.ReadToken(&out->token)) {
|
||||
return false;
|
||||
}
|
||||
out->handle = data.TakeWebBundleHandle<
|
||||
mojo::PendingRemote<network::mojom::WebBundleHandle>>();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool StructTraits<
|
||||
network::mojom::URLRequestDataView,
|
||||
network::ResourceRequest>::Read(network::mojom::URLRequestDataView data,
|
||||
@ -203,7 +216,8 @@ bool StructTraits<
|
||||
!data.ReadFetchWindowId(&out->fetch_window_id) ||
|
||||
!data.ReadDevtoolsRequestId(&out->devtools_request_id) ||
|
||||
!data.ReadDevtoolsStackId(&out->devtools_stack_id) ||
|
||||
!data.ReadRecursivePrefetchToken(&out->recursive_prefetch_token)) {
|
||||
!data.ReadRecursivePrefetchToken(&out->recursive_prefetch_token) ||
|
||||
!data.ReadWebBundleTokenParams(&out->web_bundle_token_params)) {
|
||||
// Note that data.ReadTrustTokenParams is temporarily handled below.
|
||||
return false;
|
||||
}
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include "services/network/public/mojom/data_pipe_getter.mojom.h"
|
||||
#include "services/network/public/mojom/trust_tokens.mojom.h"
|
||||
#include "services/network/public/mojom/url_loader.mojom-shared.h"
|
||||
#include "services/network/public/mojom/web_bundle_handle.mojom-shared.h"
|
||||
#include "url/mojom/url_gurl_mojom_traits.h"
|
||||
|
||||
namespace mojo {
|
||||
@ -85,6 +86,27 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
|
||||
network::ResourceRequest::TrustedParams* out);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
|
||||
StructTraits<network::mojom::WebBundleTokenParamsDataView,
|
||||
network::ResourceRequest::WebBundleTokenParams> {
|
||||
static const base::UnguessableToken& token(
|
||||
const network::ResourceRequest::WebBundleTokenParams& params) {
|
||||
return params.token;
|
||||
}
|
||||
static mojo::PendingRemote<network::mojom::WebBundleHandle> web_bundle_handle(
|
||||
const network::ResourceRequest::WebBundleTokenParams& params) {
|
||||
if (!params.handle)
|
||||
return mojo::NullRemote();
|
||||
return std::move(
|
||||
const_cast<network::ResourceRequest::WebBundleTokenParams&>(params)
|
||||
.handle);
|
||||
}
|
||||
|
||||
static bool Read(network::mojom::WebBundleTokenParamsDataView data,
|
||||
network::ResourceRequest::WebBundleTokenParams* out);
|
||||
};
|
||||
|
||||
template <>
|
||||
struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
|
||||
StructTraits<network::mojom::URLRequestDataView, network::ResourceRequest> {
|
||||
@ -264,6 +286,10 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
|
||||
const network::ResourceRequest& request) {
|
||||
return request.trust_token_params.as_ptr();
|
||||
}
|
||||
static const base::Optional<network::ResourceRequest::WebBundleTokenParams>&
|
||||
web_bundle_token_params(const network::ResourceRequest& request) {
|
||||
return request.web_bundle_token_params;
|
||||
}
|
||||
|
||||
static bool Read(network::mojom::URLRequestDataView data,
|
||||
network::ResourceRequest* out);
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "services/network/public/cpp/url_request_mojom_traits.h"
|
||||
|
||||
#include "base/optional.h"
|
||||
#include "base/test/gtest_util.h"
|
||||
#include "mojo/public/cpp/base/unguessable_token_mojom_traits.h"
|
||||
#include "mojo/public/cpp/test_support/test_utils.h"
|
||||
@ -101,6 +102,10 @@ TEST(URLRequestMojomTraitsTest, Roundtrips_ResourceRequest) {
|
||||
mojom::TrustTokenSignRequestData::kInclude;
|
||||
original.trust_token_params->additional_signed_headers.push_back(
|
||||
"some_header");
|
||||
original.web_bundle_token_params =
|
||||
base::make_optional(ResourceRequest::WebBundleTokenParams(
|
||||
base::UnguessableToken::Create(),
|
||||
mojo::PendingRemote<network::mojom::WebBundleHandle>()));
|
||||
|
||||
network::ResourceRequest copied;
|
||||
EXPECT_TRUE(
|
||||
|
@ -584,6 +584,10 @@ mojom("mojom") {
|
||||
mojom = "network.mojom.TrustedUrlRequestParams"
|
||||
cpp = "::network::ResourceRequest::TrustedParams"
|
||||
},
|
||||
{
|
||||
mojom = "network.mojom.WebBundleTokenParams"
|
||||
cpp = "::network::ResourceRequest::WebBundleTokenParams"
|
||||
},
|
||||
{
|
||||
mojom = "network.mojom.URLRequest"
|
||||
cpp = "::network::ResourceRequest"
|
||||
|
@ -47,6 +47,14 @@ enum RequestDestination {
|
||||
kStyle,
|
||||
kTrack,
|
||||
kVideo,
|
||||
// kWebBundle represents a request for a WebBundle. A <link> element whose
|
||||
// rel is "webbundle" uses this destination.
|
||||
//
|
||||
// e.g. <link rel=webbundle href="example.com/foo.wbn" resources="...">
|
||||
//
|
||||
// Fetch specifiction does not define this destination yet.
|
||||
// Tracking issue: https://github.com/whatwg/fetch/issues/1120
|
||||
kWebBundle,
|
||||
kWorker,
|
||||
kXslt,
|
||||
};
|
||||
|
@ -20,6 +20,7 @@ import "services/network/public/mojom/network_param.mojom";
|
||||
import "services/network/public/mojom/site_for_cookies.mojom";
|
||||
import "services/network/public/mojom/trust_tokens.mojom";
|
||||
import "services/network/public/mojom/url_response_head.mojom";
|
||||
import "services/network/public/mojom/web_bundle_handle.mojom";
|
||||
import "url/mojom/origin.mojom";
|
||||
import "url/mojom/url.mojom";
|
||||
|
||||
@ -97,6 +98,17 @@ struct TrustedUrlRequestParams {
|
||||
ClientSecurityState? client_security_state;
|
||||
};
|
||||
|
||||
// Options that may only be set on URLRequests which are related to WebBundle.
|
||||
struct WebBundleTokenParams {
|
||||
// Unique token to identify a WebBundle.
|
||||
mojo_base.mojom.UnguessableToken token;
|
||||
// Handle for the WebBundle-related communication between the network process
|
||||
// and the renderer. This is also used as a 'keep-alive' handle. We clean up
|
||||
// the WebBundle data in the network process when the renderer-side endpoint
|
||||
// is deleted.
|
||||
pending_remote<WebBundleHandle>? web_bundle_handle;
|
||||
};
|
||||
|
||||
// Typemapped to network::ResourceRequest.
|
||||
struct URLRequest {
|
||||
// The request method: GET, POST, etc.
|
||||
@ -402,6 +414,10 @@ struct URLRequest {
|
||||
// and the request has set the trustToken Fetch parameter, denoting that it
|
||||
// wishes to execute a Trust Tokens protocol operation.
|
||||
TrustTokenParams? trust_token_params;
|
||||
|
||||
// Set for WebBundle related requests. See the comment of WebBundleTokenParams
|
||||
// for details.
|
||||
WebBundleTokenParams? web_bundle_token_params;
|
||||
};
|
||||
|
||||
// URLRequestBody represents body (i.e. upload data) of a HTTP request.
|
||||
|
@ -318,6 +318,9 @@ class WebURLRequest {
|
||||
BLINK_PLATFORM_EXPORT network::OptionalTrustTokenParams TrustTokenParams()
|
||||
const;
|
||||
|
||||
BLINK_PLATFORM_EXPORT base::Optional<base::UnguessableToken> WebBundleToken()
|
||||
const;
|
||||
|
||||
#if INSIDE_BLINK
|
||||
BLINK_PLATFORM_EXPORT ResourceRequest& ToMutableResourceRequest();
|
||||
BLINK_PLATFORM_EXPORT const ResourceRequest& ToResourceRequest() const;
|
||||
|
@ -548,6 +548,13 @@ network::OptionalTrustTokenParams WebURLRequest::TrustTokenParams() const {
|
||||
return ConvertTrustTokenParams(resource_request_->TrustTokenParams());
|
||||
}
|
||||
|
||||
base::Optional<base::UnguessableToken> WebURLRequest::WebBundleToken() const {
|
||||
if (resource_request_->GetWebBundleTokenParams()) {
|
||||
return resource_request_->GetWebBundleTokenParams()->token;
|
||||
}
|
||||
return base::nullopt;
|
||||
}
|
||||
|
||||
WebURLRequest::WebURLRequest(ResourceRequest& r) : resource_request_(&r) {}
|
||||
|
||||
} // namespace blink
|
||||
|
@ -30,6 +30,7 @@
|
||||
|
||||
#include "base/unguessable_token.h"
|
||||
#include "services/network/public/mojom/ip_address_space.mojom-blink.h"
|
||||
#include "services/network/public/mojom/web_bundle_handle.mojom-blink.h"
|
||||
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
|
||||
#include "third_party/blink/public/platform/web_url_request.h"
|
||||
#include "third_party/blink/renderer/platform/network/encoded_form_data.h"
|
||||
@ -40,6 +41,38 @@
|
||||
|
||||
namespace blink {
|
||||
|
||||
ResourceRequestHead::WebBundleTokenParams&
|
||||
ResourceRequestHead::WebBundleTokenParams::operator=(
|
||||
const WebBundleTokenParams& other) {
|
||||
token = other.token;
|
||||
handle = other.CloneHandle();
|
||||
return *this;
|
||||
}
|
||||
|
||||
ResourceRequestHead::WebBundleTokenParams::WebBundleTokenParams(
|
||||
const WebBundleTokenParams& other) {
|
||||
*this = other;
|
||||
}
|
||||
|
||||
ResourceRequestHead::WebBundleTokenParams::WebBundleTokenParams(
|
||||
const base::UnguessableToken& web_bundle_token,
|
||||
mojo::PendingRemote<network::mojom::WebBundleHandle> web_bundle_handle)
|
||||
: token(web_bundle_token), handle(std::move(web_bundle_handle)) {}
|
||||
|
||||
mojo::PendingRemote<network::mojom::WebBundleHandle>
|
||||
ResourceRequestHead::WebBundleTokenParams::CloneHandle() const {
|
||||
if (!handle)
|
||||
return mojo::NullRemote();
|
||||
mojo::Remote<network::mojom::WebBundleHandle> remote(std::move(
|
||||
const_cast<mojo::PendingRemote<network::mojom::WebBundleHandle>&>(
|
||||
handle)));
|
||||
mojo::PendingRemote<network::mojom::WebBundleHandle> new_remote;
|
||||
remote->Clone(new_remote.InitWithNewPipeAndPassReceiver());
|
||||
const_cast<mojo::PendingRemote<network::mojom::WebBundleHandle>&>(handle) =
|
||||
remote.Unbind();
|
||||
return new_remote;
|
||||
}
|
||||
|
||||
const base::TimeDelta ResourceRequestHead::default_timeout_interval_ =
|
||||
base::TimeDelta::Max();
|
||||
|
||||
|
@ -41,6 +41,8 @@
|
||||
#include "services/network/public/mojom/fetch_api.mojom-blink-forward.h"
|
||||
#include "services/network/public/mojom/ip_address_space.mojom-blink-forward.h"
|
||||
#include "services/network/public/mojom/trust_tokens.mojom-blink.h"
|
||||
#include "services/network/public/mojom/url_loader.mojom-blink.h"
|
||||
#include "services/network/public/mojom/web_bundle_handle.mojom-blink.h"
|
||||
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink-forward.h"
|
||||
#include "third_party/blink/public/platform/resource_request_blocked_reason.h"
|
||||
#include "third_party/blink/public/platform/web_url_request_extra_data.h"
|
||||
@ -80,6 +82,21 @@ class PLATFORM_EXPORT ResourceRequestHead {
|
||||
: original_url(original_url), previous_url(previous_url) {}
|
||||
};
|
||||
|
||||
struct PLATFORM_EXPORT WebBundleTokenParams {
|
||||
WebBundleTokenParams() = delete;
|
||||
WebBundleTokenParams(const WebBundleTokenParams& other);
|
||||
WebBundleTokenParams& operator=(const WebBundleTokenParams& other);
|
||||
|
||||
WebBundleTokenParams(
|
||||
const base::UnguessableToken& token,
|
||||
mojo::PendingRemote<network::mojom::WebBundleHandle> handle);
|
||||
|
||||
mojo::PendingRemote<network::mojom::WebBundleHandle> CloneHandle() const;
|
||||
|
||||
base::UnguessableToken token;
|
||||
mojo::PendingRemote<network::mojom::WebBundleHandle> handle;
|
||||
};
|
||||
|
||||
ResourceRequestHead();
|
||||
explicit ResourceRequestHead(const KURL&);
|
||||
|
||||
@ -486,6 +503,16 @@ class PLATFORM_EXPORT ResourceRequestHead {
|
||||
return allowHTTP1ForStreamingUpload_;
|
||||
}
|
||||
|
||||
const base::Optional<ResourceRequestHead::WebBundleTokenParams>&
|
||||
GetWebBundleTokenParams() const {
|
||||
return web_bundle_token_params_;
|
||||
}
|
||||
|
||||
void SetWebBundleTokenParams(
|
||||
ResourceRequestHead::WebBundleTokenParams params) {
|
||||
web_bundle_token_params_ = params;
|
||||
}
|
||||
|
||||
private:
|
||||
const CacheControlHeader& GetCacheControlHeader() const;
|
||||
|
||||
@ -581,6 +608,11 @@ class PLATFORM_EXPORT ResourceRequestHead {
|
||||
// prefetch responses. The browser process uses this token to ensure the
|
||||
// request is cached correctly.
|
||||
base::Optional<base::UnguessableToken> recursive_prefetch_token_;
|
||||
|
||||
// This is used when fetching either a WebBundle or a subresrouce in the
|
||||
// WebBundle. The network process uses this token to associate the request to
|
||||
// the bundle.
|
||||
base::Optional<WebBundleTokenParams> web_bundle_token_params_;
|
||||
};
|
||||
|
||||
class PLATFORM_EXPORT ResourceRequestBody {
|
||||
|
@ -303,6 +303,12 @@ void PopulateResourceRequest(const ResourceRequestHead& src,
|
||||
dest->credentials_mode = src.GetCredentialsMode();
|
||||
dest->redirect_mode = src.GetRedirectMode();
|
||||
dest->fetch_integrity = src.GetFetchIntegrity().Utf8();
|
||||
if (src.GetWebBundleTokenParams().has_value()) {
|
||||
dest->web_bundle_token_params =
|
||||
base::make_optional(network::ResourceRequest::WebBundleTokenParams(
|
||||
src.GetWebBundleTokenParams()->token,
|
||||
src.GetWebBundleTokenParams()->CloneHandle()));
|
||||
}
|
||||
|
||||
mojom::ResourceType resource_type =
|
||||
RequestContextToResourceType(src.GetRequestContext());
|
||||
|
Reference in New Issue
Block a user