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=33a691883b3956a4e2fa2937ab8dc42dc80d78c8$
13 //
14
15 #include "libcef_dll/ctocpp/media_router_ctocpp.h"
16 #include "libcef_dll/cpptoc/completion_callback_cpptoc.h"
17 #include "libcef_dll/cpptoc/media_observer_cpptoc.h"
18 #include "libcef_dll/cpptoc/media_route_create_callback_cpptoc.h"
19 #include "libcef_dll/ctocpp/media_sink_ctocpp.h"
20 #include "libcef_dll/ctocpp/media_source_ctocpp.h"
21 #include "libcef_dll/ctocpp/registration_ctocpp.h"
22 #include "libcef_dll/shutdown_checker.h"
23
24 // STATIC METHODS - Body may be edited by hand.
25
26 NO_SANITIZE("cfi-icall")
GetGlobalMediaRouter(CefRefPtr<CefCompletionCallback> callback)27 CefRefPtr<CefMediaRouter> CefMediaRouter::GetGlobalMediaRouter(
28 CefRefPtr<CefCompletionCallback> callback) {
29 shutdown_checker::AssertNotShutdown();
30
31 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
32
33 // Unverified params: callback
34
35 // Execute
36 cef_media_router_t* _retval =
37 cef_media_router_get_global(CefCompletionCallbackCppToC::Wrap(callback));
38
39 // Return type: refptr_same
40 return CefMediaRouterCToCpp::Wrap(_retval);
41 }
42
43 // VIRTUAL METHODS - Body may be edited by hand.
44
45 NO_SANITIZE("cfi-icall")
AddObserver(CefRefPtr<CefMediaObserver> observer)46 CefRefPtr<CefRegistration> CefMediaRouterCToCpp::AddObserver(
47 CefRefPtr<CefMediaObserver> observer) {
48 shutdown_checker::AssertNotShutdown();
49
50 cef_media_router_t* _struct = GetStruct();
51 if (CEF_MEMBER_MISSING(_struct, add_observer))
52 return nullptr;
53
54 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
55
56 // Verify param: observer; type: refptr_diff
57 DCHECK(observer.get());
58 if (!observer.get())
59 return nullptr;
60
61 // Execute
62 cef_registration_t* _retval =
63 _struct->add_observer(_struct, CefMediaObserverCppToC::Wrap(observer));
64
65 // Return type: refptr_same
66 return CefRegistrationCToCpp::Wrap(_retval);
67 }
68
69 NO_SANITIZE("cfi-icall")
GetSource(const CefString & urn)70 CefRefPtr<CefMediaSource> CefMediaRouterCToCpp::GetSource(
71 const CefString& urn) {
72 shutdown_checker::AssertNotShutdown();
73
74 cef_media_router_t* _struct = GetStruct();
75 if (CEF_MEMBER_MISSING(_struct, get_source))
76 return nullptr;
77
78 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
79
80 // Verify param: urn; type: string_byref_const
81 DCHECK(!urn.empty());
82 if (urn.empty())
83 return nullptr;
84
85 // Execute
86 cef_media_source_t* _retval = _struct->get_source(_struct, urn.GetStruct());
87
88 // Return type: refptr_same
89 return CefMediaSourceCToCpp::Wrap(_retval);
90 }
91
NotifyCurrentSinks()92 NO_SANITIZE("cfi-icall") void CefMediaRouterCToCpp::NotifyCurrentSinks() {
93 shutdown_checker::AssertNotShutdown();
94
95 cef_media_router_t* _struct = GetStruct();
96 if (CEF_MEMBER_MISSING(_struct, notify_current_sinks))
97 return;
98
99 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
100
101 // Execute
102 _struct->notify_current_sinks(_struct);
103 }
104
105 NO_SANITIZE("cfi-icall")
CreateRoute(CefRefPtr<CefMediaSource> source,CefRefPtr<CefMediaSink> sink,CefRefPtr<CefMediaRouteCreateCallback> callback)106 void CefMediaRouterCToCpp::CreateRoute(
107 CefRefPtr<CefMediaSource> source,
108 CefRefPtr<CefMediaSink> sink,
109 CefRefPtr<CefMediaRouteCreateCallback> callback) {
110 shutdown_checker::AssertNotShutdown();
111
112 cef_media_router_t* _struct = GetStruct();
113 if (CEF_MEMBER_MISSING(_struct, create_route))
114 return;
115
116 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
117
118 // Verify param: source; type: refptr_same
119 DCHECK(source.get());
120 if (!source.get())
121 return;
122 // Verify param: sink; type: refptr_same
123 DCHECK(sink.get());
124 if (!sink.get())
125 return;
126 // Verify param: callback; type: refptr_diff
127 DCHECK(callback.get());
128 if (!callback.get())
129 return;
130
131 // Execute
132 _struct->create_route(_struct, CefMediaSourceCToCpp::Unwrap(source),
133 CefMediaSinkCToCpp::Unwrap(sink),
134 CefMediaRouteCreateCallbackCppToC::Wrap(callback));
135 }
136
NotifyCurrentRoutes()137 NO_SANITIZE("cfi-icall") void CefMediaRouterCToCpp::NotifyCurrentRoutes() {
138 shutdown_checker::AssertNotShutdown();
139
140 cef_media_router_t* _struct = GetStruct();
141 if (CEF_MEMBER_MISSING(_struct, notify_current_routes))
142 return;
143
144 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
145
146 // Execute
147 _struct->notify_current_routes(_struct);
148 }
149
150 // CONSTRUCTOR - Do not edit by hand.
151
CefMediaRouterCToCpp()152 CefMediaRouterCToCpp::CefMediaRouterCToCpp() {}
153
154 // DESTRUCTOR - Do not edit by hand.
155
~CefMediaRouterCToCpp()156 CefMediaRouterCToCpp::~CefMediaRouterCToCpp() {
157 shutdown_checker::AssertNotShutdown();
158 }
159
160 template <>
161 cef_media_router_t*
162 CefCToCppRefCounted<CefMediaRouterCToCpp, CefMediaRouter, cef_media_router_t>::
UnwrapDerived(CefWrapperType type,CefMediaRouter * c)163 UnwrapDerived(CefWrapperType type, CefMediaRouter* c) {
164 NOTREACHED() << "Unexpected class type: " << type;
165 return nullptr;
166 }
167
168 template <>
169 CefWrapperType CefCToCppRefCounted<CefMediaRouterCToCpp,
170 CefMediaRouter,
171 cef_media_router_t>::kWrapperType =
172 WT_MEDIA_ROUTER;
173