• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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=2e085c019a8e5c4701db0ee23fbd06b275e6342b$
13 //
14 
15 #include "libcef_dll/cpptoc/request_context_handler_cpptoc.h"
16 #include "libcef_dll/cpptoc/resource_request_handler_cpptoc.h"
17 #include "libcef_dll/ctocpp/browser_ctocpp.h"
18 #include "libcef_dll/ctocpp/frame_ctocpp.h"
19 #include "libcef_dll/ctocpp/request_context_ctocpp.h"
20 #include "libcef_dll/ctocpp/request_ctocpp.h"
21 
22 namespace {
23 
24 // MEMBER FUNCTIONS - Body may be edited by hand.
25 
request_context_handler_on_request_context_initialized(struct _cef_request_context_handler_t * self,cef_request_context_t * request_context)26 void CEF_CALLBACK request_context_handler_on_request_context_initialized(
27     struct _cef_request_context_handler_t* self,
28     cef_request_context_t* request_context) {
29   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
30 
31   DCHECK(self);
32   if (!self)
33     return;
34   // Verify param: request_context; type: refptr_diff
35   DCHECK(request_context);
36   if (!request_context)
37     return;
38 
39   // Execute
40   CefRequestContextHandlerCppToC::Get(self)->OnRequestContextInitialized(
41       CefRequestContextCToCpp::Wrap(request_context));
42 }
43 
44 struct _cef_resource_request_handler_t* CEF_CALLBACK
request_context_handler_get_resource_request_handler(struct _cef_request_context_handler_t * self,cef_browser_t * browser,cef_frame_t * frame,cef_request_t * request,int is_navigation,int is_download,const cef_string_t * request_initiator,int * disable_default_handling)45 request_context_handler_get_resource_request_handler(
46     struct _cef_request_context_handler_t* self,
47     cef_browser_t* browser,
48     cef_frame_t* frame,
49     cef_request_t* request,
50     int is_navigation,
51     int is_download,
52     const cef_string_t* request_initiator,
53     int* disable_default_handling) {
54   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
55 
56   DCHECK(self);
57   if (!self)
58     return NULL;
59   // Verify param: request; type: refptr_diff
60   DCHECK(request);
61   if (!request)
62     return NULL;
63   // Verify param: disable_default_handling; type: bool_byref
64   DCHECK(disable_default_handling);
65   if (!disable_default_handling)
66     return NULL;
67   // Unverified params: browser, frame, request_initiator
68 
69   // Translate param: disable_default_handling; type: bool_byref
70   bool disable_default_handlingBool =
71       (disable_default_handling && *disable_default_handling) ? true : false;
72 
73   // Execute
74   CefRefPtr<CefResourceRequestHandler> _retval =
75       CefRequestContextHandlerCppToC::Get(self)->GetResourceRequestHandler(
76           CefBrowserCToCpp::Wrap(browser), CefFrameCToCpp::Wrap(frame),
77           CefRequestCToCpp::Wrap(request), is_navigation ? true : false,
78           is_download ? true : false, CefString(request_initiator),
79           disable_default_handlingBool);
80 
81   // Restore param: disable_default_handling; type: bool_byref
82   if (disable_default_handling)
83     *disable_default_handling = disable_default_handlingBool ? true : false;
84 
85   // Return type: refptr_same
86   return CefResourceRequestHandlerCppToC::Wrap(_retval);
87 }
88 
89 }  // namespace
90 
91 // CONSTRUCTOR - Do not edit by hand.
92 
CefRequestContextHandlerCppToC()93 CefRequestContextHandlerCppToC::CefRequestContextHandlerCppToC() {
94   GetStruct()->on_request_context_initialized =
95       request_context_handler_on_request_context_initialized;
96   GetStruct()->get_resource_request_handler =
97       request_context_handler_get_resource_request_handler;
98 }
99 
100 // DESTRUCTOR - Do not edit by hand.
101 
~CefRequestContextHandlerCppToC()102 CefRequestContextHandlerCppToC::~CefRequestContextHandlerCppToC() {}
103 
104 template <>
105 CefRefPtr<CefRequestContextHandler> CefCppToCRefCounted<
106     CefRequestContextHandlerCppToC,
107     CefRequestContextHandler,
UnwrapDerived(CefWrapperType type,cef_request_context_handler_t * s)108     cef_request_context_handler_t>::UnwrapDerived(CefWrapperType type,
109                                                   cef_request_context_handler_t*
110                                                       s) {
111   NOTREACHED() << "Unexpected class type: " << type;
112   return nullptr;
113 }
114 
115 template <>
116 CefWrapperType
117     CefCppToCRefCounted<CefRequestContextHandlerCppToC,
118                         CefRequestContextHandler,
119                         cef_request_context_handler_t>::kWrapperType =
120         WT_REQUEST_CONTEXT_HANDLER;
121