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=3df118413888e04f3e10121c80e68014de545462$
13 //
14
15 #include "libcef_dll/ctocpp/media_route_ctocpp.h"
16 #include "libcef_dll/ctocpp/media_sink_ctocpp.h"
17 #include "libcef_dll/ctocpp/media_source_ctocpp.h"
18 #include "libcef_dll/shutdown_checker.h"
19
20 // VIRTUAL METHODS - Body may be edited by hand.
21
GetId()22 NO_SANITIZE("cfi-icall") CefString CefMediaRouteCToCpp::GetId() {
23 shutdown_checker::AssertNotShutdown();
24
25 cef_media_route_t* _struct = GetStruct();
26 if (CEF_MEMBER_MISSING(_struct, get_id))
27 return CefString();
28
29 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
30
31 // Execute
32 cef_string_userfree_t _retval = _struct->get_id(_struct);
33
34 // Return type: string
35 CefString _retvalStr;
36 _retvalStr.AttachToUserFree(_retval);
37 return _retvalStr;
38 }
39
40 NO_SANITIZE("cfi-icall")
GetSource()41 CefRefPtr<CefMediaSource> CefMediaRouteCToCpp::GetSource() {
42 shutdown_checker::AssertNotShutdown();
43
44 cef_media_route_t* _struct = GetStruct();
45 if (CEF_MEMBER_MISSING(_struct, get_source))
46 return nullptr;
47
48 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
49
50 // Execute
51 cef_media_source_t* _retval = _struct->get_source(_struct);
52
53 // Return type: refptr_same
54 return CefMediaSourceCToCpp::Wrap(_retval);
55 }
56
57 NO_SANITIZE("cfi-icall")
GetSink()58 CefRefPtr<CefMediaSink> CefMediaRouteCToCpp::GetSink() {
59 shutdown_checker::AssertNotShutdown();
60
61 cef_media_route_t* _struct = GetStruct();
62 if (CEF_MEMBER_MISSING(_struct, get_sink))
63 return nullptr;
64
65 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
66
67 // Execute
68 cef_media_sink_t* _retval = _struct->get_sink(_struct);
69
70 // Return type: refptr_same
71 return CefMediaSinkCToCpp::Wrap(_retval);
72 }
73
74 NO_SANITIZE("cfi-icall")
SendRouteMessage(const void * message,size_t message_size)75 void CefMediaRouteCToCpp::SendRouteMessage(const void* message,
76 size_t message_size) {
77 shutdown_checker::AssertNotShutdown();
78
79 cef_media_route_t* _struct = GetStruct();
80 if (CEF_MEMBER_MISSING(_struct, send_route_message))
81 return;
82
83 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
84
85 // Verify param: message; type: simple_byaddr
86 DCHECK(message);
87 if (!message)
88 return;
89
90 // Execute
91 _struct->send_route_message(_struct, message, message_size);
92 }
93
Terminate()94 NO_SANITIZE("cfi-icall") void CefMediaRouteCToCpp::Terminate() {
95 shutdown_checker::AssertNotShutdown();
96
97 cef_media_route_t* _struct = GetStruct();
98 if (CEF_MEMBER_MISSING(_struct, terminate))
99 return;
100
101 // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
102
103 // Execute
104 _struct->terminate(_struct);
105 }
106
107 // CONSTRUCTOR - Do not edit by hand.
108
CefMediaRouteCToCpp()109 CefMediaRouteCToCpp::CefMediaRouteCToCpp() {}
110
111 // DESTRUCTOR - Do not edit by hand.
112
~CefMediaRouteCToCpp()113 CefMediaRouteCToCpp::~CefMediaRouteCToCpp() {
114 shutdown_checker::AssertNotShutdown();
115 }
116
117 template <>
118 cef_media_route_t*
119 CefCToCppRefCounted<CefMediaRouteCToCpp, CefMediaRoute, cef_media_route_t>::
UnwrapDerived(CefWrapperType type,CefMediaRoute * c)120 UnwrapDerived(CefWrapperType type, CefMediaRoute* c) {
121 NOTREACHED() << "Unexpected class type: " << type;
122 return nullptr;
123 }
124
125 template <>
126 CefWrapperType CefCToCppRefCounted<CefMediaRouteCToCpp,
127 CefMediaRoute,
128 cef_media_route_t>::kWrapperType =
129 WT_MEDIA_ROUTE;
130