forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnavigation_client.h
55 lines (44 loc) · 2.08 KB
/
navigation_client.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// 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.
#ifndef CONTENT_RENDERER_NAVIGATION_CLIENT_H_
#define CONTENT_RENDERER_NAVIGATION_CLIENT_H_
#include "content/common/navigation_client.mojom.h"
#include "mojo/public/cpp/bindings/associated_binding.h"
namespace content {
class RenderFrameImpl;
class NavigationClient : mojom::NavigationClient {
public:
explicit NavigationClient(RenderFrameImpl* render_frame);
~NavigationClient() override;
// mojom::NavigationClient implementation:
void CommitNavigation(
const network::ResourceResponseHead& head,
const CommonNavigationParams& common_params,
const RequestNavigationParams& request_params,
network::mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints,
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loaders,
base::Optional<std::vector<::content::mojom::TransferrableURLLoaderPtr>>
subresource_overrides,
mojom::ControllerServiceWorkerInfoPtr controller_service_worker_info,
const base::UnguessableToken& devtools_navigation_token) override;
void CommitFailedNavigation(
const CommonNavigationParams& common_params,
const RequestNavigationParams& request_params,
bool has_stale_copy_in_cache,
int error_code,
const base::Optional<std::string>& error_page_content,
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loaders) override;
void Bind(mojom::NavigationClientAssociatedRequest request);
private:
// OnDroppedNavigation is bound from BeginNavigation till CommitNavigation.
// During this period, it is called when the interface pipe is closed from the
// browser side, leading to the ongoing navigation cancelation.
void OnDroppedNavigation();
void SetDisconnectionHandler();
void ResetDisconnectionHandler();
mojo::AssociatedBinding<mojom::NavigationClient> navigation_client_binding_;
RenderFrameImpl* render_frame_;
};
} // namespace content
#endif // CONTENT_RENDERER_NAVIGATION_CLIENT_H_