• 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=69faf917e01945c29e5f20a00abbcc69aac7c0a7$
13 //
14 
15 #include "libcef_dll/cpptoc/v8stack_trace_cpptoc.h"
16 #include "libcef_dll/cpptoc/v8stack_frame_cpptoc.h"
17 #include "libcef_dll/shutdown_checker.h"
18 
19 // GLOBAL FUNCTIONS - Body may be edited by hand.
20 
cef_v8stack_trace_get_current(int frame_limit)21 CEF_EXPORT cef_v8stack_trace_t* cef_v8stack_trace_get_current(int frame_limit) {
22   shutdown_checker::AssertNotShutdown();
23 
24   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
25 
26   // Execute
27   CefRefPtr<CefV8StackTrace> _retval = CefV8StackTrace::GetCurrent(frame_limit);
28 
29   // Return type: refptr_same
30   return CefV8StackTraceCppToC::Wrap(_retval);
31 }
32 
33 namespace {
34 
35 // MEMBER FUNCTIONS - Body may be edited by hand.
36 
v8stack_trace_is_valid(struct _cef_v8stack_trace_t * self)37 int CEF_CALLBACK v8stack_trace_is_valid(struct _cef_v8stack_trace_t* self) {
38   shutdown_checker::AssertNotShutdown();
39 
40   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
41 
42   DCHECK(self);
43   if (!self)
44     return 0;
45 
46   // Execute
47   bool _retval = CefV8StackTraceCppToC::Get(self)->IsValid();
48 
49   // Return type: bool
50   return _retval;
51 }
52 
53 int CEF_CALLBACK
v8stack_trace_get_frame_count(struct _cef_v8stack_trace_t * self)54 v8stack_trace_get_frame_count(struct _cef_v8stack_trace_t* self) {
55   shutdown_checker::AssertNotShutdown();
56 
57   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
58 
59   DCHECK(self);
60   if (!self)
61     return 0;
62 
63   // Execute
64   int _retval = CefV8StackTraceCppToC::Get(self)->GetFrameCount();
65 
66   // Return type: simple
67   return _retval;
68 }
69 
70 struct _cef_v8stack_frame_t* CEF_CALLBACK
v8stack_trace_get_frame(struct _cef_v8stack_trace_t * self,int index)71 v8stack_trace_get_frame(struct _cef_v8stack_trace_t* self, int index) {
72   shutdown_checker::AssertNotShutdown();
73 
74   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
75 
76   DCHECK(self);
77   if (!self)
78     return NULL;
79 
80   // Execute
81   CefRefPtr<CefV8StackFrame> _retval =
82       CefV8StackTraceCppToC::Get(self)->GetFrame(index);
83 
84   // Return type: refptr_same
85   return CefV8StackFrameCppToC::Wrap(_retval);
86 }
87 
88 }  // namespace
89 
90 // CONSTRUCTOR - Do not edit by hand.
91 
CefV8StackTraceCppToC()92 CefV8StackTraceCppToC::CefV8StackTraceCppToC() {
93   GetStruct()->is_valid = v8stack_trace_is_valid;
94   GetStruct()->get_frame_count = v8stack_trace_get_frame_count;
95   GetStruct()->get_frame = v8stack_trace_get_frame;
96 }
97 
98 // DESTRUCTOR - Do not edit by hand.
99 
~CefV8StackTraceCppToC()100 CefV8StackTraceCppToC::~CefV8StackTraceCppToC() {
101   shutdown_checker::AssertNotShutdown();
102 }
103 
104 template <>
105 CefRefPtr<CefV8StackTrace> CefCppToCRefCounted<
106     CefV8StackTraceCppToC,
107     CefV8StackTrace,
UnwrapDerived(CefWrapperType type,cef_v8stack_trace_t * s)108     cef_v8stack_trace_t>::UnwrapDerived(CefWrapperType type,
109                                         cef_v8stack_trace_t* s) {
110   NOTREACHED() << "Unexpected class type: " << type;
111   return nullptr;
112 }
113 
114 template <>
115 CefWrapperType CefCppToCRefCounted<CefV8StackTraceCppToC,
116                                    CefV8StackTrace,
117                                    cef_v8stack_trace_t>::kWrapperType =
118     WT_V8STACK_TRACE;
119