chromium/third_party/blink/public/mojom/navigation/navigation_params.mojom

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

module blink.mojom;

import "mojo/public/mojom/base/byte_string.mojom";
import "mojo/public/mojom/base/time.mojom";
import "mojo/public/mojom/base/unguessable_token.mojom";
import "mojo/public/mojom/base/values.mojom";
import "services/network/public/mojom/content_security_policy.mojom";
import "services/network/public/mojom/fetch_api.mojom";
import "services/network/public/mojom/source_location.mojom";
import "services/network/public/mojom/storage_access_api.mojom";
import "services/network/public/mojom/trust_tokens.mojom";
import "services/network/public/mojom/url_loader.mojom";
import "services/network/public/mojom/url_request.mojom";
import "services/network/public/mojom/url_response_head.mojom";
import "services/network/public/mojom/web_client_hints_types.mojom";
import "services/network/public/mojom/web_sandbox_flags.mojom";
import "services/viz/public/mojom/compositing/local_surface_id.mojom";
import "third_party/blink/public/mojom/back_forward_cache_not_restored_reasons.mojom";
import "third_party/blink/public/mojom/conversions/conversions.mojom";
import "third_party/blink/public/mojom/fenced_frame/fenced_frame_config.mojom";
import "third_party/blink/public/mojom/fetch/fetch_api_request.mojom";
import "third_party/blink/public/mojom/frame/frame_policy.mojom";
import "third_party/blink/public/mojom/frame/view_transition_state.mojom";
import "third_party/blink/public/mojom/lcp_critical_path_predictor/lcp_critical_path_predictor.mojom";
import "third_party/blink/public/mojom/loader/mixed_content.mojom";
import "third_party/blink/public/mojom/loader/referrer.mojom";
import "third_party/blink/public/mojom/messaging/task_attribution_id.mojom";
import "third_party/blink/public/mojom/navigation/navigation_api_history_entry_arrays.mojom";
import "third_party/blink/public/mojom/navigation/navigation_initiator_activation_and_ad_status.mojom";
import "third_party/blink/public/mojom/navigation/navigation_policy.mojom";
import "third_party/blink/public/mojom/navigation/prefetched_signed_exchange_info.mojom";
import "third_party/blink/public/mojom/navigation/renderer_content_settings.mojom";
import "third_party/blink/public/mojom/navigation/system_entropy.mojom";
import "third_party/blink/public/mojom/navigation/was_activated_option.mojom";
import "third_party/blink/public/mojom/page/browsing_context_group_info.mojom";
import "third_party/blink/public/mojom/page/page.mojom";
import "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom";
import "third_party/blink/public/mojom/runtime_feature_state/runtime_feature.mojom";
import "third_party/blink/public/mojom/storage_key/storage_key.mojom";
import "third_party/blink/public/mojom/tokens/tokens.mojom";
import "url/mojom/origin.mojom";
import "url/mojom/url.mojom";

enum NavigationType {
  // Reload the page, validating only cache entry for the main resource.
  RELOAD,

  // Reload the page, bypassing any cache entries.
  RELOAD_BYPASSING_CACHE,

  // The navigation is the result of session restore (e.g. restoring tabs when
  // reopening browser, undo closed tab, duplicate tab) and should honor the
  // page's cache policy while restoring form state.  Restoring without using
  // this type would lead to the page's cache policy being ignored and the page
  // being loaded from the cache, potentially showing stale data for some
  // sites.
  // Note: In a restored session, this type is used when traversing restored
  // history entries for the first time, rather than HISTORY_SAME_DOCUMENT or
  // HISTORY_DIFFERENT_DOCUMENT. See
  // NavigationBrowserTest.TraversingToRestoredEntryUsesRestoreType.
  // TODO(https://crbug.com/40283341): This enum should be split to allow
  // differentiating same- and cross- document traversals in a restored
  // session, like HISTORY_{SAME|DIFFERENT}_DOCUMENT.
  RESTORE,

  // Like RESTORE, except that the navigation contains POST data.
  RESTORE_WITH_POST,

  // History navigation inside the same document.
  HISTORY_SAME_DOCUMENT,

  // History navigation to a different document.
  HISTORY_DIFFERENT_DOCUMENT,

  // Navigation inside the same document. It occurs when the part of the url
  // that is modified is after the '#' part.
  SAME_DOCUMENT,

  // Navigation to another document.
  DIFFERENT_DOCUMENT,
};

// Maps to
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigateevent-navigationtype-dev.
enum NavigationTypeForNavigationApi {
  kPush,
  kTraverse,
  kReplace,
  kReload,
};

// Used by the renderer to indicate a case where a standard navigation that
// pushes a history entry must not be implicity converted to replace the current
// history entry. Ignored if the current NavigationEntry is the initial entry,
// which must always be replaced.
enum ForceHistoryPush {
  kYes,
  kNo,
};

// Provided by the renderer ----------------------------------------------------
//
// This struct holds parameters sent by the renderer to the browser, that are
// needed to start a navigation.
struct BeginNavigationParams {
  // The token of the RenderFrameHost that initiated the navigation. It might
  // refer to a RenderFrameHost that doesn't exist anymore when the IPC reaches
  // the browser process.
  blink.mojom.LocalFrameToken? initiator_frame_token;

  // Additional HTTP request headers.
  string headers;

  // net::URLRequest load flags (net::LOAD_NORMAL) by default).
  int32 load_flags = 0;  // 0 == net::LOAD_NORMAL

  // True if the ServiceWorker should be skipped.
  bool skip_service_worker = false;

  // Indicates the request context type.
  blink.mojom.RequestContextType request_context_type =
      blink.mojom.RequestContextType.UNSPECIFIED;

  // The mixed content context type for potential mixed content checks.
  blink.mojom.MixedContentContextType mixed_content_context_type =
      blink.mojom.MixedContentContextType.kNotMixedContent;

  // Whether or not the navigation has been initiated by a form submission.
  bool is_form_submission = false;

  // Whether or not the navigation has been initiated by a link click.
  bool was_initiated_by_link_click = false;

  // If true, override cases where a WebFrameLoadType::kStandard navigation
  // is implicitly converted to a kReplaceCurrentItem navigation. Ignored if
  // the current NavigationEntry is the initial entry, which must always be
  // replaced.
  ForceHistoryPush force_history_push = ForceHistoryPush.kNo;

  // See WebSearchableFormData for a description of these.
  url.mojom.Url searchable_form_url;
  string searchable_form_encoding;

  // If the transition type is a client side redirect, then this holds the URL
  // of the page that had the client side redirect.
  url.mojom.Url client_side_redirect_url;

  // If the navigation is renderer-initiated and the renderer is being
  // inspected by DevTools, this field is non-null and contains the
  // initiator information in DevTools protocol format. See
  // https://chromedevtools.github.io/devtools-protocol/tot/Network#type-Initiator
  // for details.
  mojo_base.mojom.DictionaryValue? devtools_initiator;

  // Specifies whether, and how, the navigation should execute a Trust Tokens
  // operation (https://github.com/wicg/trust-token-api) and attach headers
  // conveying the result of the operation. Set on some child frame navigations.
  network.mojom.TrustTokenParams? trust_token_params;

  // Carries optional information associated with conversion measurement for
  // this navigation. Only set on navigations originating from anchors with
  // relevant impression attributes set.
  Impression? impression;

  // Timestamps of the renderer running beforeunload handlers on local frames
  // in preparation for navigating. Used for metrics.
  mojo_base.mojom.TimeTicks before_unload_start;
  mojo_base.mojom.TimeTicks before_unload_end;

  // The navigation initiator's user activation and ad status.
  blink.mojom.NavigationInitiatorActivationAndAdStatus
      initiator_activation_and_ad_status;

  // Whether this navigation was container initiated (e.g. iframe changed src).
  // This is currently partially specified in
  // https://html.spec.whatwg.org/#create-navigation-params-by-fetching
  // "If sourceSnapshotParams's fetch client is navigable's container document's
  // relevant settings object, then set request's initiator type to navigable's
  // container's local name." This means that only container initiated
  // navigations should create a resource timing entry.
  // TODO(https://github.com/whatwg/html/issues/8846): clarify this further.
  bool is_container_initiated = false;

  // The renderer's Storage Access API status (e.g. whether it has opted into
  // accessing cross-site cookies). Note that this is not trusted; cookies will
  // not actually be attached unless there is also a matching permission grant
  // created by the browser process. (Also note that the Storage Access API is
  // only relevant when third-party cookies are blocked.)
  network.mojom.StorageAccessApiStatus storage_access_api_status = kNone;

  // True if the initiator explicitly asked for opener relationships to be
  // preserved, via rel="opener".
  bool has_rel_opener = false;
};

// Provided by the browser or the renderer -------------------------------------

// Used by all navigation IPCs.
struct CommonNavigationParams {
  // The URL to navigate to.
  // May be modified when the navigation is ready to commit.
  url.mojom.Url url;

  // When a frame navigates another frame, this is the origin of the document
  // which initiated the navigation. This parameter can be null for
  // browser-initiated navigations.
  url.mojom.Origin? initiator_origin;

  // For navigations to about:blank and srcdoc frames, we require the base url
  // of the frame initiating the navigation. As with `initiator_origin`, this
  // parameter can be null.
  url.mojom.Url? initiator_base_url;

  // The URL to send in the "Referer" header field. Can be empty if there is
  // no referrer.
  blink.mojom.Referrer referrer;

  // The type of transition.
  int32 transition;

  // Type of navigation.
  NavigationType navigation_type = DIFFERENT_DOCUMENT;

  // Governs how downloads are handled by this navigation.
  blink.mojom.NavigationDownloadPolicy download_policy;

  // Informs the RenderView the pending navigation should replace the current
  // history entry when it commits.  This is used by client-side redirects to
  // indicate that when the navigation commits, it should commit in the existing
  // page.
  bool should_replace_current_entry = false;

  // Base URL for use in Blink's SubstituteData.
  // Is only used with data: URLs.
  url.mojom.Url base_url_for_data_url;

  // The navigationStart time exposed through the Navigation Timing API to JS.
  mojo_base.mojom.TimeTicks navigation_start;

  // The request method: GET, POST, etc.
  string method = "GET";

  // Body of HTTP POST request.
  network.mojom.URLRequestBody? post_data;

  // Information about the Javascript source for this navigation. Used for
  // providing information in console error messages triggered by the
  // navigation. If the navigation is not caused by Javascript, the
  // SourceLocation's URL is empty.
  network.mojom.SourceLocation source_location;

  // Whether or not this navigation was started from a context menu.
  bool started_from_context_menu = false;

  // True if the request was user initiated.
  bool has_user_gesture = false;

  // True if the navigation should allow the target document to invoke a text
  // fragment (i.e. fragments with :~:text=). This is based on user gesture
  // presence but separate from the bit above as the semantics for text
  // fragments are different. Namely, this bit is always consumed on use and is
  // propagated across client redirects.
  bool text_fragment_token = false;

  // Whether or not the CSP of the main world should apply. When the navigation
  // is initiated from a content script in an isolated world, the CSP defined
  // in the main world should not apply.
  // TODO(arthursonzogni): Instead of this boolean, the origin of the isolated
  // world which has initiated the navigation should be passed.
  // See https://crbug.com/702540
  network.mojom.CSPDisposition should_check_main_world_csp =
      network.mojom.CSPDisposition.CHECK;

  // The origin trial features activated in the initiator that should be applied
  // in the document being navigated to. The int values are blink
  // OriginTrialFeature enum values. OriginTrialFeature enum is not visible
  // outside of blink (and doesn't need to be) so these values are casted to int
  // as they are passed through content across navigations.
  array<int32> initiator_origin_trial_features;

  // The value of the hrefTranslate attribute if this navigation was initiated
  // from a link that had that attribute set.
  string href_translate;

  // Whether this is a history navigation in a newly created child frame, in
  // which case the browser process is instructing the renderer process to load
  // a URL from a session history item.  Defaults to false.
  // TODO(https://crbug.com/962518, https://crbug.com/1467502): Move this to
  // BeginNavigationParams.
  bool is_history_navigation_in_new_child_frame = false;

  // The time the input event leading to the navigation occurred. This will
  // not always be set; it depends on the creator of the CommonNavigationParams
  // setting it.
  mojo_base.mojom.TimeTicks input_start;

  // Indicates the request destination.
  network.mojom.RequestDestination request_destination =
      network.mojom.RequestDestination.kEmpty;
};

// Provided by the browser -----------------------------------------------------

// Only container-initiated navigations report resource timing to the parent.
// See https://github.com/whatwg/fetch/pull/1579
enum ParentResourceTimingAccess {
  kDoNotReport,

  // See https://fetch.spec.whatwg.org/#response-has-cross-origin-redirects
  // Whether response info (status code, content-type) can be exposed to
  // resource timing. True for CORS same-origin subresource responses and for
  // same-origin navigations without cross-origin redirects.
  // TODO(https://github.com/whatwg/fetch/issues/1602) clarify the spec around
  // this.
  kReportWithoutResponseDetails,
  kReportWithResponseDetails,
};

// Timings collected in the browser during navigation for the
// Navigation Timing API. Sent to Blink in CommitNavigationParams when
// the navigation is ready to be committed.
struct NavigationTiming {
  mojo_base.mojom.TimeTicks redirect_start;
  mojo_base.mojom.TimeTicks redirect_end;
  mojo_base.mojom.TimeTicks fetch_start;

  // Indicates the entropy state of the user agent at the time the navigation
  // begins.
  SystemEntropy system_entropy_at_navigation_start = kEmpty;

  ParentResourceTimingAccess parent_resource_timing_access =
      ParentResourceTimingAccess.kDoNotReport;
};

// Sent with CommitNavigationParams and should only be set for main-frame
// same-site navigations where we did a proactive BrowsingInstance swap and
// we're reusing the old page's process. Needed to ensure that the previous
// page's pagehide and visibilitychange handlers are run before the new page
// runs (which is what happens on other same-site main frame navigations).
struct OldPageInfo {
  // |frame_token_for_old_main_frame| contains the frame token of the old page's
  // main WebLocalFrame.
  blink.mojom.LocalFrameToken frame_token_for_old_main_frame;
  // |new_lifecycle_state_for_old_page| contains the latest PageLifecycleState
  // of the old page to ensure the PageVisibilityState gets properly updated,
  // the "persisted" property of the pagehide event is set correctly, and
  // pagehide and visibilitychange events won't get dispatched again when we
  // unload/freeze the page later on.
  blink.mojom.PageLifecycleState new_lifecycle_state_for_old_page;
};

// Used by commit IPC messages. Holds the parameters needed by the renderer to
// commit a navigation besides those in CommonNavigationParams.
struct CommitNavigationParams {
  // The origin to be used for committing the navigation, if specified.
  // It is currently only specified on error document navigations, where the
  // origin should be an opaque origin based on the URL that failed to load.
  // TODO(https://crbug.com/888079): Always provide origin_to_commit.
  url.mojom.Origin? origin_to_commit;

  // The storage key of the document that will be created by the navigation.
  // This is compatible with the origin that the browser calculates for this
  // navigation. Currently, the final origin used by a navigation is still
  // determined by the renderer, except when `origin_to_commit` above is set.
  // Until the browser is able to compute the origin accurately in all cases
  // (see https://crbug.com/888079), this is actually just a provisional
  // `storage_key`. The final storage key is computed by the document loader
  // taking into account the origin computed by the renderer.
  blink.mojom.StorageKey storage_key;

  // Whether or not the user agent override string should be used.
  bool is_overriding_user_agent = false;

  // Any redirect URLs that occurred before |url|. Useful for cross-process
  // navigations; defaults to empty.
  array<url.mojom.Url> redirects;

  // The ResourceResponseInfos received during redirects.
  array<network.mojom.URLResponseHead> redirect_response;

  // The RedirectInfos received during redirects.
  array<network.mojom.URLRequestRedirectInfo> redirect_infos;

  // The content type from the request headers for POST requests.
  string post_content_type;

  // The original URL & method for this navigation.
  url.mojom.Url original_url;
  string original_method;

  // Whether or not this url should be allowed to access local file://
  // resources.
  bool can_load_local_resources = false;

  // Encoded version of blink::PageState, opaque history state (received by
  // UpdateState Mojo message).
  mojo_base.mojom.ByteString page_state;

  // For browser-initiated navigations, this is the unique id of the
  // NavigationEntry being navigated to. (For renderer-initiated navigations it
  // is 0.) If the load succeeds, then this nav_entry_id will be reflected in
  // the resulting DidCommitProvisionalLoadParams.
  int32 nav_entry_id = 0;

  // If this is a history navigation, this contains a map of frame unique names
  // to |is_about_blank| for immediate children of the frame being navigated for
  // which there are history items.  The renderer process only needs to check
  // with the browser process for newly created subframes that have these unique
  // names (and only when not staying on about:blank).
  // TODO(creis): Expand this to a data structure including corresponding
  // same-process PageStates for the whole subtree in https://crbug.com/639842.
  map<string, bool> subframe_unique_names;

  // For browser-initiated navigations, this is true if this is a new entry
  // being navigated to. This is false otherwise. TODO(avi): Remove this when
  // the pending entry situation is made sane and the browser keeps them around
  // long enough to match them via nav_entry_id, above.
  bool intended_as_new_entry = false;

  // For history navigations, this is the offset in the history list of the
  // pending load. For non-history navigations, this will be ignored.
  int32 pending_history_list_offset = -1;

  // Where its current page contents reside in session history and the total
  // size of the session history list.
  int32 current_history_list_offset = -1;
  int32 current_history_list_length = 0;

  // Indicates that the tab was previously discarded.
  // wasDiscarded is exposed on Document after discard, see:
  // https://github.com/WICG/web-lifecycle
  bool was_discarded = false;

  // Indicates whether the navigation is to a view-source:// scheme or not.
  // It is a separate boolean as the view-source scheme is stripped from the
  // URL before it is sent to the renderer process and the RenderFrame needs
  // to be put in special view source mode.
  bool is_view_source = false;

  // Whether session history should be cleared. In that case, the RenderView
  // needs to notify the browser that the clearing was successful when the
  // navigation commits.
  bool should_clear_history_list = false;

  // Timing of navigation events.
  NavigationTiming navigation_timing;

  // Set to |kYes| if a navigation is following the rules of user activation
  // propagation. This is different from |has_user_gesture|
  // (in CommonNavigationParams) as the activation may have happened before
  // the navigation was triggered, for example.
  // In other words, the distinction isn't regarding user activation and user
  // gesture but whether there was an activation prior to the navigation or to
  // start it. `was_activated` will answer the former question while
  // `user_gesture` will answer the latter.
  blink.mojom.WasActivatedOption was_activated = kUnknown;

  // A token that should be passed to the browser process in
  // DidCommitProvisionalLoadParams.
  // TODO(clamy): Remove this once NavigationClient has shipped and
  // same-document browser-initiated navigations are properly handled as well.
  mojo_base.mojom.UnguessableToken navigation_token;

  // Prefetched signed exchanges.
  array<blink.mojom.PrefetchedSignedExchangeInfo> prefetched_signed_exchanges;

  // The real content of the data: URL. Only used in Android WebView for
  // implementing LoadDataWithBaseUrl API method to circumvent the restriction
  // on the GURL max length in the IPC layer. Short data: URLs can still be
  // passed in the |CommonNavigationParams::url| field.
  [EnableIf=is_android]
  string data_url_as_string;

  // Whether this navigation was browser initiated.
  bool is_browser_initiated = false;

  // Whether a visual transition was done by the browser before committing this
  // navigation.
  bool has_ua_visual_transition = false;

  // UKM source id to be associated with the Document that will be installed
  // in the current frame. This could be an invalid id for empty Document. Only
  // Documents that will emit UKM events need valid ids.
  int64 document_ukm_source_id;

  // A snapshot value of frame policy (both sandbox flags and container policy)
  // of the frame that is being navigated. The snapshot value is captured at the
  // start of navigation:
  // - For local frame navigation, the value is set at NavigationRequest::
  // CreateRendererInitiated.
  // - For remote frame navigation, the value is set at
  // NavigationControllerImpl::CreateNavigationRequestFromLoadParams.
  // - For navigation created from
  // NavigationControllerImpl::CreateNavigationRequestFromEntry which
  // corresponds to history navigation, the value is set to current
  // FrameTreeNode::pending_frame_policy in frame_tree_node. This behavior is
  // currently undocumented and probably need further discussion. Another
  // potential approach is to record frame policy value in NavigationEntry and
  // reuse the historical value.
  //
  // The default FramePolicy is the laxest. It is used for:
  // - Top-level browser-initiated navigations.
  // - Ctrl+click navigation (opening a link in a new tab).
  blink.mojom.FramePolicy frame_policy;

  // The names of origin trials to be force enabled for this navigation.
  array<string> force_enabled_origin_trials;

  // Whether the page is in an origin-keyed agent cluster.
  // https://html.spec.whatwg.org/C/#origin-keyed-agent-clusters
  bool origin_agent_cluster = false;

  // Whether the decision to use origin-keyed or site-keyed agent clustering
  // (which itself is recorded in origin_agent_cluster, above) has been
  // made based on absent Origin-Agent-Cluster http header.
  bool origin_agent_cluster_left_as_default = true;

  // Client-hints enabled; this is based on the top-level frame and should be
  // further narrowed down by permissions policy.
  array<network.mojom.WebClientHintsType> enabled_client_hints;

  // Whether this is a cross-site navigation that swaps BrowsingContextGroups.
  bool is_cross_site_cross_browsing_context_group = false;

  // Whether the new document should start with sticky user activation, because
  // the previously committed document did, and the navigation was same-site.
  bool should_have_sticky_user_activation = false;

  // Should only be set to a valid value for main-frame same-site navigations
  // where we did a proactive BrowsingInstance swap and we're reusing the old
  // page's process.
  OldPageInfo? old_page_info;

  // The HTTP response status code for the navigation. Set to -1 if we never
  // received response headers.
  int32 http_response_code = -1;

  // A same-origin subset of the back/forward list exposed by the
  // window.navigation API.
  NavigationApiHistoryEntryArrays navigation_api_history_entry_arrays;

  array<url.mojom.Url> early_hints_preloaded_resources;

  // The time the commit was sent from the browser.
  mojo_base.mojom.TimeTicks commit_sent;

  // When URL is about:srcdoc, this carries the srcdoc attribute's value.
  string srcdoc_value;

  // Whether the navigation should be treated as a "loadDataWithBaseURL"
  // navigation, where the "document URL" is set to the supplied base URL
  // instead of the data URL set in CommonNavigationParams' `url`. If this
  // returns false, the data: URL will still be loaded, but we won't try to use
  // the supplied base URL and history URL.
  bool is_load_data_with_base_url = false;

  // Whether a CSPEE policy exists in any of the frame's ancestors or on the
  // frame itself. Used to determine if an opaque-ads fenced frame is allowed to
  // be created in the current context. See
  // `NavigatorAuction::canLoadAdAuctionFencedFrame` for usage. At the moment,
  // this is just sending CSPEE. But this can be expanded (and renamed) in the
  // future if we need to send more information about whether a fenced frame can
  // load from the browser.
  bool ancestor_or_self_has_cspee = false;

  // Reduced Accept-Language negotiates the language when navigating to a new
  // document in the main frame, and the browser supplies the same negotiated
  // language to the main frame and all its subframes when committing a
  // navigation. This value will be used as the Accept-Language for subresource
  // requests made by the document committed by this navigation. For example,
  // when navigating to a URL with embedded image subresource request, the
  // language negotiation only happens in top-level document. It will store the
  // top-level document's negotiated language as `reduced_accept_language` here.
  // Whenever fetching image subresources, the HTTP Accept-Language header will
  // be set as the reduced accept language which was stored here. As we only do
  // language negotiation on the top-level document, all subresource requests
  // will inherit the Accept-Language header value of the top-level document.
  string reduced_accept_language;

  // Indicates how the response is served for this navigation. Observed from
  // `PerformanceNavigationTiming` APIs.
  network.mojom.NavigationDeliveryType navigation_delivery_type = kDefault;

  // Holds texture references (stored in the GPU process), geometry state, and
  // select CSS property values from the previous Document displayed by this
  // frame. This is used to support transitions when navigating between
  // same-origin Documents. Note that this is only set and used for same-origin
  // navigations. See https://drafts.csswg.org/css-view-transitions-2/ for
  // details.
  blink.mojom.ViewTransitionState? view_transition_state;

  // If any, the task ID of the initiator of the navigation. This is restricted
  // to same-document main-frame navigation initiated by the top-level document.
  // Used by SoftNavigationHeuristics to trace back the chain of events.
  TaskAttributionId? soft_navigation_heuristics_task_id;

  // Maps the blink runtime-enabled features modified in the browser process to
  // their new enabled/disabled status:
  // <enum_representing_runtime_enabled_feature, enabled/disabled>
  map<blink.mojom.RuntimeFeature, bool> modified_runtime_features;

  // A collection of properties that determines the behavior of a fenced frame.
  // Only non-null for embedder-initiated navigations of a fenced frame root,
  // and urn navigations in iframes while they're supported.
  FencedFrameProperties? fenced_frame_properties;

  // `not_restored_reasons` contains the reasons why this navigation is not
  // served from back/forward cache if applicable. This is only sent for
  // cross-document main frame history navigations.
  blink.mojom.BackForwardCacheNotRestoredReasons? not_restored_reasons;

  // The StorageAccessApiStatus value that the target document of this
  // navigation should be loaded with.
  network.mojom.StorageAccessApiStatus load_with_storage_access = kNone;

  // Indicates which browsing context group this frame belongs to. This starts
  // as nullopt and is only set when we commit a main frame in another browsing
  // context group. Same browsing context group navigations never set this
  // because no update is required. Subframes navigations never set this,
  // because they cannot change browsing context group.
  blink.mojom.BrowsingContextGroupInfo? browsing_context_group_info;

  // LCP Critical Path Predictor hint data available at navigation timing.
  blink.mojom.LCPCriticalPathPredictorNavigationTimeHint? lcpp_hint;

  // Some content settings must be enforced by the renderer. See
  // ContentSettingsType for more details.
  RendererContentSettings content_settings;

  // The cookie deprecation label for cookie deprecation facilitated testing.
  string? cookie_deprecation_label;

  // The :visited link hashtable is stored in shared memory and contains salted
  // hashes for all visits. Each salt corresponds to a unique origin, and
  // renderer processes are only informed of salts that correspond to their
  // origins. As a result, any given renderer process can only
  // learn about visits relevant to origins for which it has the salt.
  //
  // Here we store the salt corresponding to this navigation's origin to
  // be committed. It will allow the renderer process that commits this
  // navigation to learn about visits hashed with this salt. Setting a salt
  // value is optional. In these cases, VisitedLinkWriter is responsible for
  // sending salt values to the renderer after the :visited link hashtable has
  // been initialized.
  uint64? visited_link_salt;

  // Provides the LocalSurfaceId to assign to the new Document when this
  // navigation commits. This is only set for navigations where the new Document
  // uses the same compositor as the old Document, i.e., same-RFH navigations.
  //
  // Note: We always assign a LocalSurfaceId to the new Document when the
  // navigation commits in the browser (DidCommitNavigation). But if the old
  // Document will be screenshotted by the browser, we need to generate an ID
  // earlier to ensure the new Document doesn't render frames using the same ID
  // as the old Document when it is committed in the renderer.
  viz.mojom.LocalSurfaceId? local_surface_id;
};

// Parameters used to dispatch the `pageswap` event on the old Document for
// a navigation. Only generated for same-origin navigations.
struct PageSwapEventParams {
  // The URL of the destination page.
  url.mojom.Url url;

  // Used to retrieve the destination history item to create a
  // NavigationHistoryEntry. Only provided for traverse navigations.
  mojo_base.mojom.ByteString page_state;

  // The type of navigation which will hide/unload this Document.
  NavigationTypeForNavigationApi navigation_type;
};