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=a8a10af1258edd37dbb8d079a10943070c1e9c4c$
13 //
14
15 #include "libcef_dll/cpptoc/dev_tools_message_observer_cpptoc.h"
16 #include "libcef_dll/ctocpp/browser_ctocpp.h"
17 #include "libcef_dll/shutdown_checker.h"
18
19 namespace {
20
21 // MEMBER FUNCTIONS - Body may be edited by hand.
22
dev_tools_message_observer_on_dev_tools_message(struct _cef_dev_tools_message_observer_t * self,cef_browser_t * browser,const void * message,size_t message_size)23 int CEF_CALLBACK dev_tools_message_observer_on_dev_tools_message(
24 struct _cef_dev_tools_message_observer_t* self,
25 cef_browser_t* browser,
26 const void* message,
27 size_t message_size) {
28 shutdown_checker::AssertNotShutdown();
29
30 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
31
32 DCHECK(self);
33 if (!self)
34 return 0;
35 // Verify param: browser; type: refptr_diff
36 DCHECK(browser);
37 if (!browser)
38 return 0;
39 // Verify param: message; type: simple_byaddr
40 DCHECK(message);
41 if (!message)
42 return 0;
43
44 // Execute
45 bool _retval = CefDevToolsMessageObserverCppToC::Get(self)->OnDevToolsMessage(
46 CefBrowserCToCpp::Wrap(browser), message, message_size);
47
48 // Return type: bool
49 return _retval;
50 }
51
dev_tools_message_observer_on_dev_tools_method_result(struct _cef_dev_tools_message_observer_t * self,cef_browser_t * browser,int message_id,int success,const void * result,size_t result_size)52 void CEF_CALLBACK dev_tools_message_observer_on_dev_tools_method_result(
53 struct _cef_dev_tools_message_observer_t* self,
54 cef_browser_t* browser,
55 int message_id,
56 int success,
57 const void* result,
58 size_t result_size) {
59 shutdown_checker::AssertNotShutdown();
60
61 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
62
63 DCHECK(self);
64 if (!self)
65 return;
66 // Verify param: browser; type: refptr_diff
67 DCHECK(browser);
68 if (!browser)
69 return;
70 // Unverified params: result
71
72 // Execute
73 CefDevToolsMessageObserverCppToC::Get(self)->OnDevToolsMethodResult(
74 CefBrowserCToCpp::Wrap(browser), message_id, success ? true : false,
75 result, result_size);
76 }
77
dev_tools_message_observer_on_dev_tools_event(struct _cef_dev_tools_message_observer_t * self,cef_browser_t * browser,const cef_string_t * method,const void * params,size_t params_size)78 void CEF_CALLBACK dev_tools_message_observer_on_dev_tools_event(
79 struct _cef_dev_tools_message_observer_t* self,
80 cef_browser_t* browser,
81 const cef_string_t* method,
82 const void* params,
83 size_t params_size) {
84 shutdown_checker::AssertNotShutdown();
85
86 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
87
88 DCHECK(self);
89 if (!self)
90 return;
91 // Verify param: browser; type: refptr_diff
92 DCHECK(browser);
93 if (!browser)
94 return;
95 // Verify param: method; type: string_byref_const
96 DCHECK(method);
97 if (!method)
98 return;
99 // Unverified params: params
100
101 // Execute
102 CefDevToolsMessageObserverCppToC::Get(self)->OnDevToolsEvent(
103 CefBrowserCToCpp::Wrap(browser), CefString(method), params, params_size);
104 }
105
dev_tools_message_observer_on_dev_tools_agent_attached(struct _cef_dev_tools_message_observer_t * self,cef_browser_t * browser)106 void CEF_CALLBACK dev_tools_message_observer_on_dev_tools_agent_attached(
107 struct _cef_dev_tools_message_observer_t* self,
108 cef_browser_t* browser) {
109 shutdown_checker::AssertNotShutdown();
110
111 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
112
113 DCHECK(self);
114 if (!self)
115 return;
116 // Verify param: browser; type: refptr_diff
117 DCHECK(browser);
118 if (!browser)
119 return;
120
121 // Execute
122 CefDevToolsMessageObserverCppToC::Get(self)->OnDevToolsAgentAttached(
123 CefBrowserCToCpp::Wrap(browser));
124 }
125
dev_tools_message_observer_on_dev_tools_agent_detached(struct _cef_dev_tools_message_observer_t * self,cef_browser_t * browser)126 void CEF_CALLBACK dev_tools_message_observer_on_dev_tools_agent_detached(
127 struct _cef_dev_tools_message_observer_t* self,
128 cef_browser_t* browser) {
129 shutdown_checker::AssertNotShutdown();
130
131 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
132
133 DCHECK(self);
134 if (!self)
135 return;
136 // Verify param: browser; type: refptr_diff
137 DCHECK(browser);
138 if (!browser)
139 return;
140
141 // Execute
142 CefDevToolsMessageObserverCppToC::Get(self)->OnDevToolsAgentDetached(
143 CefBrowserCToCpp::Wrap(browser));
144 }
145
146 } // namespace
147
148 // CONSTRUCTOR - Do not edit by hand.
149
CefDevToolsMessageObserverCppToC()150 CefDevToolsMessageObserverCppToC::CefDevToolsMessageObserverCppToC() {
151 GetStruct()->on_dev_tools_message =
152 dev_tools_message_observer_on_dev_tools_message;
153 GetStruct()->on_dev_tools_method_result =
154 dev_tools_message_observer_on_dev_tools_method_result;
155 GetStruct()->on_dev_tools_event =
156 dev_tools_message_observer_on_dev_tools_event;
157 GetStruct()->on_dev_tools_agent_attached =
158 dev_tools_message_observer_on_dev_tools_agent_attached;
159 GetStruct()->on_dev_tools_agent_detached =
160 dev_tools_message_observer_on_dev_tools_agent_detached;
161 }
162
163 // DESTRUCTOR - Do not edit by hand.
164
~CefDevToolsMessageObserverCppToC()165 CefDevToolsMessageObserverCppToC::~CefDevToolsMessageObserverCppToC() {
166 shutdown_checker::AssertNotShutdown();
167 }
168
169 template <>
170 CefRefPtr<CefDevToolsMessageObserver>
171 CefCppToCRefCounted<CefDevToolsMessageObserverCppToC,
172 CefDevToolsMessageObserver,
173 cef_dev_tools_message_observer_t>::
UnwrapDerived(CefWrapperType type,cef_dev_tools_message_observer_t * s)174 UnwrapDerived(CefWrapperType type, cef_dev_tools_message_observer_t* s) {
175 NOTREACHED() << "Unexpected class type: " << type;
176 return nullptr;
177 }
178
179 template <>
180 CefWrapperType
181 CefCppToCRefCounted<CefDevToolsMessageObserverCppToC,
182 CefDevToolsMessageObserver,
183 cef_dev_tools_message_observer_t>::kWrapperType =
184 WT_DEV_TOOLS_MESSAGE_OBSERVER;
185