1 // Copyright (c) 2022 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 // ---------------------------------------------------------------------------
6 //
7 // This file was generated by the CEF translator tool. If making changes by
8 // hand only do so within the body of existing method and function
9 // implementations. See the translator.README.txt file in the tools directory
10 // for more information.
11 //
12 // $hash=a57c9c762ed21459113a931ad31387aa1ab2c441$
13 //
14
15 #include "libcef_dll/ctocpp/request_context_handler_ctocpp.h"
16 #include "libcef_dll/cpptoc/browser_cpptoc.h"
17 #include "libcef_dll/cpptoc/frame_cpptoc.h"
18 #include "libcef_dll/cpptoc/request_context_cpptoc.h"
19 #include "libcef_dll/cpptoc/request_cpptoc.h"
20 #include "libcef_dll/ctocpp/resource_request_handler_ctocpp.h"
21
22 // VIRTUAL METHODS - Body may be edited by hand.
23
24 NO_SANITIZE("cfi-icall")
OnRequestContextInitialized(CefRefPtr<CefRequestContext> request_context)25 void CefRequestContextHandlerCToCpp::OnRequestContextInitialized(
26 CefRefPtr<CefRequestContext> request_context) {
27 cef_request_context_handler_t* _struct = GetStruct();
28 if (CEF_MEMBER_MISSING(_struct, on_request_context_initialized))
29 return;
30
31 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
32
33 // Verify param: request_context; type: refptr_diff
34 DCHECK(request_context.get());
35 if (!request_context.get())
36 return;
37
38 // Execute
39 _struct->on_request_context_initialized(
40 _struct, CefRequestContextCppToC::Wrap(request_context));
41 }
42
43 NO_SANITIZE("cfi-icall")
44 CefRefPtr<CefResourceRequestHandler>
GetResourceRequestHandler(CefRefPtr<CefBrowser> browser,CefRefPtr<CefFrame> frame,CefRefPtr<CefRequest> request,bool is_navigation,bool is_download,const CefString & request_initiator,bool & disable_default_handling)45 CefRequestContextHandlerCToCpp::GetResourceRequestHandler(
46 CefRefPtr<CefBrowser> browser,
47 CefRefPtr<CefFrame> frame,
48 CefRefPtr<CefRequest> request,
49 bool is_navigation,
50 bool is_download,
51 const CefString& request_initiator,
52 bool& disable_default_handling) {
53 cef_request_context_handler_t* _struct = GetStruct();
54 if (CEF_MEMBER_MISSING(_struct, get_resource_request_handler))
55 return nullptr;
56
57 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
58
59 // Verify param: request; type: refptr_diff
60 DCHECK(request.get());
61 if (!request.get())
62 return nullptr;
63 // Unverified params: browser, frame, request_initiator
64
65 // Translate param: disable_default_handling; type: bool_byref
66 int disable_default_handlingInt = disable_default_handling;
67
68 // Execute
69 cef_resource_request_handler_t* _retval =
70 _struct->get_resource_request_handler(
71 _struct, CefBrowserCppToC::Wrap(browser), CefFrameCppToC::Wrap(frame),
72 CefRequestCppToC::Wrap(request), is_navigation, is_download,
73 request_initiator.GetStruct(), &disable_default_handlingInt);
74
75 // Restore param:disable_default_handling; type: bool_byref
76 disable_default_handling = disable_default_handlingInt ? true : false;
77
78 // Return type: refptr_same
79 return CefResourceRequestHandlerCToCpp::Wrap(_retval);
80 }
81
82 // CONSTRUCTOR - Do not edit by hand.
83
CefRequestContextHandlerCToCpp()84 CefRequestContextHandlerCToCpp::CefRequestContextHandlerCToCpp() {}
85
86 // DESTRUCTOR - Do not edit by hand.
87
~CefRequestContextHandlerCToCpp()88 CefRequestContextHandlerCToCpp::~CefRequestContextHandlerCToCpp() {}
89
90 template <>
91 cef_request_context_handler_t* CefCToCppRefCounted<
92 CefRequestContextHandlerCToCpp,
93 CefRequestContextHandler,
UnwrapDerived(CefWrapperType type,CefRequestContextHandler * c)94 cef_request_context_handler_t>::UnwrapDerived(CefWrapperType type,
95 CefRequestContextHandler* c) {
96 NOTREACHED() << "Unexpected class type: " << type;
97 return nullptr;
98 }
99
100 template <>
101 CefWrapperType
102 CefCToCppRefCounted<CefRequestContextHandlerCToCpp,
103 CefRequestContextHandler,
104 cef_request_context_handler_t>::kWrapperType =
105 WT_REQUEST_CONTEXT_HANDLER;
106