1 // Copyright (c) 2019 The Chromium Embedded Framework Authors. All rights 2 // reserved. Use of this source code is governed by a BSD-style license that 3 // can be found in the LICENSE file. 4 5 #ifndef CEF_LIBCEF_BROWSER_NET_SERVICE_RESOURCE_REQUEST_HANDLER_WRAPPER_H_ 6 #define CEF_LIBCEF_BROWSER_NET_SERVICE_RESOURCE_REQUEST_HANDLER_WRAPPER_H_ 7 8 #include "base/callback_forward.h" 9 #include "content/public/browser/web_contents.h" 10 11 namespace content { 12 class BrowserContext; 13 class RenderFrameHost; 14 } // namespace content 15 16 namespace network { 17 struct ResourceRequest; 18 } 19 20 namespace url { 21 class Origin; 22 } 23 24 namespace net_service { 25 26 class InterceptedRequestHandler; 27 28 // Create an InterceptedRequestHandler that will delegate to a 29 // CefResourceRequestHandler. The resulting object should be passed to 30 // ProxyURLLoaderFactory::CreateProxy. Called on the UI thread only. 31 std::unique_ptr<InterceptedRequestHandler> CreateInterceptedRequestHandler( 32 content::BrowserContext* browser_context, 33 content::RenderFrameHost* frame, 34 int render_process_id, 35 bool is_navigation, 36 bool is_download, 37 const url::Origin& request_initiator); 38 39 // Create an InterceptedRequestHandler that will delegate to a 40 // CefResourceRequestHandler. The resulting object should be passed to 41 // ProxyURLLoaderFactory::CreateProxy. Called on the UI thread only. 42 std::unique_ptr<InterceptedRequestHandler> CreateInterceptedRequestHandler( 43 content::WebContents::Getter web_contents_getter, 44 int frame_tree_node_id, 45 const network::ResourceRequest& request, 46 const base::RepeatingClosure& unhandled_request_callback); 47 48 } // namespace net_service 49 50 #endif // CEF_LIBCEF_BROWSER_NET_SERVICE_RESOURCE_REQUEST_HANDLER_WRAPPER_H_ 51