blob: 3294653f6eb383e7d5a985a206ececd43a4c9100 [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module content.mojom;
import "content/public/common/load_timing_info.mojom";
import "content/public/common/resource_type.mojom";
import "services/network/public/mojom/ip_address.mojom";
import "services/network/public/mojom/network_param.mojom";
import "url/mojom/url.mojom";
// Network related information reported for loads and redirects.
struct CommonNetworkInfo {
// True if the request accessed the network in the process of retrieving data.
bool network_accessed;
// True if loading this resource always requires accessing the network, either
// because it should always be revalidated or because it should not be cached.
bool always_access_network;
// The host IP and port of the response.
network.mojom.HostPortPair? ip_port_pair;
};
// Information for a redirect.
struct RedirectInfo {
// The URL after the redirect.
url.mojom.Url url;
// Various network related information.
CommonNetworkInfo network_info;
};
// Information pertaining to resource loading.
// This will be passed to ResourceResponse callback methods.
struct ResourceLoadInfo {
// An ID that uniquely identifies this request.
int64 request_id;
// The URL of the response.
url.mojom.Url url;
// The response referrer.
url.mojom.Url referrer;
// The original URL is the URL used to initialize the subresource request, and
// it may differ from |url| if the request was redirected.
url.mojom.Url original_url;
// The request method used to fetch this response.
string method;
// The resource type.
ResourceType resource_type;
// The mime type.
string mime_type;
// True if the response was fetched from the network cache.
bool was_cached;
// Various network related information.
CommonNetworkInfo network_info;
// The network error code, net::OK if no error happened.
int32 net_error;
// The timing info.
content.mojom.LoadTimingInfo load_timing_info;
// The size of the response body before removing any content encodings.
// Does not include redirects or sub-requests issued at lower levels (range
// requests or auth). Does include bytes from the cache.
int64 raw_body_bytes;
// The total amount of data received from network after SSL decoding and proxy
// handling. Pertains only to the last request, i.e. reset on redirects, but
// not reset when multiple roundtrips are used for range requests or auth.
int64 total_received_bytes;
// The list of redirects that led to this resource load. Empty if there were
// no redirects.
array<RedirectInfo> redirect_info_chain;
};