blob: 14ee7ad65cf06d812fc86261658814377bbf0852 [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 "services/network/public/mojom/url_loader.mojom";
import "services/network/public/mojom/url_loader_factory.mojom";
import "content/common/url_loader_factory_bundle.mojom";
import "content/public/common/transferrable_url_loader.mojom";
import "mojo/public/mojom/base/unguessable_token.mojom";
import "url/mojom/url.mojom";
import "third_party/blink/public/mojom/service_worker/controller_service_worker.mojom";
import "third_party/blink/public/web/commit_result.mojom";
// See src/content/common/navigation_params.h
[Native]
struct CommonNavigationParams;
// See src/content/common/navigation_params.h
[Native]
struct RequestNavigationParams;
interface NavigationClient {
// Tells the renderer that a navigation is ready to commit.
//
// The renderer should bind the |url_loader_client_endpoints| to an
// URLLoaderClient implementation to continue loading the document that will
// be the result of the committed navigation.
//
// Note: |url_loader_client_endpoints| will be empty iff the navigation URL
// wasn't handled by the network stack (i.e. about:blank, ...)
//
// When the Network Service is enabled, |subresource_loader_factories| may
// also be provided by the browser as a a means for the renderer to load
// subresources where applicable.
//
// |controller_service_worker_info| may also be provided by the browser if the
// frame that is being navigated is supposed to be controlled by a Service
// Worker.
// |prefetch_loader_factory| is populated only when Network Service is
// enabled. The pointer is used to start a prefetch loading via the browser
// process.
//
// For automation driver-initiated navigations over the devtools protocol,
// |devtools_navigation_token_| is used to tag the navigation. This navigation
// token is then sent into the renderer and lands on the DocumentLoader. That
// way subsequent Blink-level frame lifecycle events can be associated with
// the concrete navigation.
// - The value should not be sent back to the browser.
// - The value on DocumentLoader may be generated in the renderer in some
// cases, and thus shouldn't be trusted.
// TODO(crbug.com/783506): Replace devtools navigation token with the generic
// navigation token that can be passed from renderer to the browser.
CommitNavigation(
network.mojom.URLResponseHead head,
CommonNavigationParams common_params,
RequestNavigationParams request_params,
network.mojom.URLLoaderClientEndpoints? url_loader_client_endpoints,
URLLoaderFactoryBundle? subresource_loader_factories,
array<TransferrableURLLoader>? subresource_overrides,
blink.mojom.ControllerServiceWorkerInfo? controller_service_worker_info,
network.mojom.URLLoaderFactory? prefetch_loader_factory,
mojo_base.mojom.UnguessableToken devtools_navigation_token)
=> (blink.mojom.CommitResult commit_result);
// Tells the renderer that a failed navigation is ready to commit.
//
// The result of this commit usually results in displaying an error page.
// Note |error_page_content| may contain the content of the error page
// (i.e. flattened HTML, JS, CSS).
//
// When the Network Service is enabled, |subresource_loader_factories| may
// also be provided by the browser as a means for the renderer to load
// subresources where applicable.
CommitFailedNavigation(
CommonNavigationParams common_params,
RequestNavigationParams request_params,
bool has_stale_copy_in_cache,
int32 error_code,
string? error_page_content,
URLLoaderFactoryBundle? subresource_loader_factories)
=> (blink.mojom.CommitResult commit_result);
};