cef/libcef/browser/net_service/resource_request_handler_wrapper.h
Marshall Greenblatt 955097ea77 Remove usage of FrameTreeNode IDs (see issue #2421)
With the introduction of prerendering in Chromium it is now possible for
RenderFrameHosts (RFH) to move between FrameTrees. As a consequence we can no
longer rely on FrameTreeNode IDs to uniquely identify a RFH over its lifespan.
We must now switch to using GlobalRenderFrameHostId (child_id, frame_routing_id)
instead for that purpose. Additionally, we simplify existing code by using the
GlobalRenderFrameHostId struct in all places that previously used a
(render_process_id, render_frame_id) pair, since these concepts are equivalent.

See https://crbug.com/1179502#c8 for additional background.
2021-08-19 19:41:44 -04:00

51 lines
1.7 KiB
C++

// Copyright (c) 2019 The Chromium Embedded Framework 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 CEF_LIBCEF_BROWSER_NET_SERVICE_RESOURCE_REQUEST_HANDLER_WRAPPER_H_
#define CEF_LIBCEF_BROWSER_NET_SERVICE_RESOURCE_REQUEST_HANDLER_WRAPPER_H_
#include "base/callback_forward.h"
#include "content/public/browser/web_contents.h"
namespace content {
class BrowserContext;
class RenderFrameHost;
} // namespace content
namespace network {
struct ResourceRequest;
}
namespace url {
class Origin;
}
namespace net_service {
class InterceptedRequestHandler;
// Create an InterceptedRequestHandler that will delegate to a
// CefResourceRequestHandler. The resulting object should be passed to
// ProxyURLLoaderFactory::CreateProxy. Called on the UI thread only.
std::unique_ptr<InterceptedRequestHandler> CreateInterceptedRequestHandler(
content::BrowserContext* browser_context,
content::RenderFrameHost* frame,
int render_process_id,
bool is_navigation,
bool is_download,
const url::Origin& request_initiator);
// Create an InterceptedRequestHandler that will delegate to a
// CefResourceRequestHandler. The resulting object should be passed to
// ProxyURLLoaderFactory::CreateProxy. Called on the UI thread only.
std::unique_ptr<InterceptedRequestHandler> CreateInterceptedRequestHandler(
content::WebContents::Getter web_contents_getter,
int frame_tree_node_id,
const network::ResourceRequest& request,
const base::RepeatingClosure& unhandled_request_callback);
} // namespace net_service
#endif // CEF_LIBCEF_BROWSER_NET_SERVICE_RESOURCE_REQUEST_HANDLER_WRAPPER_H_