]> git.sesse.net Git - casparcg/blob - dependencies64/cef/linux/libcef_dll/cpptoc/v8accessor_cpptoc.cc
d7a46523894886c06c2fe3d09ce98b2400d2a26c
[casparcg] / dependencies64 / cef / linux / libcef_dll / cpptoc / v8accessor_cpptoc.cc
1 // Copyright (c) 2017 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
13 #include "libcef_dll/cpptoc/v8accessor_cpptoc.h"
14 #include "libcef_dll/ctocpp/v8value_ctocpp.h"
15
16
17 namespace {
18
19 // MEMBER FUNCTIONS - Body may be edited by hand.
20
21 int CEF_CALLBACK v8accessor_get(struct _cef_v8accessor_t* self,
22     const cef_string_t* name, struct _cef_v8value_t* object,
23     struct _cef_v8value_t** retval, cef_string_t* exception) {
24   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
25
26   DCHECK(self);
27   if (!self)
28     return 0;
29   // Verify param: name; type: string_byref_const
30   DCHECK(name);
31   if (!name)
32     return 0;
33   // Verify param: object; type: refptr_diff
34   DCHECK(object);
35   if (!object)
36     return 0;
37   // Verify param: retval; type: refptr_diff_byref
38   DCHECK(retval);
39   if (!retval)
40     return 0;
41   // Verify param: exception; type: string_byref
42   DCHECK(exception);
43   if (!exception)
44     return 0;
45
46   // Translate param: retval; type: refptr_diff_byref
47   CefRefPtr<CefV8Value> retvalPtr;
48   if (retval && *retval)
49     retvalPtr = CefV8ValueCToCpp::Wrap(*retval);
50   CefV8Value* retvalOrig = retvalPtr.get();
51   // Translate param: exception; type: string_byref
52   CefString exceptionStr(exception);
53
54   // Execute
55   bool _retval = CefV8AccessorCppToC::Get(self)->Get(
56       CefString(name),
57       CefV8ValueCToCpp::Wrap(object),
58       retvalPtr,
59       exceptionStr);
60
61   // Restore param: retval; type: refptr_diff_byref
62   if (retval) {
63     if (retvalPtr.get()) {
64       if (retvalPtr.get() != retvalOrig) {
65         *retval = CefV8ValueCToCpp::Unwrap(retvalPtr);
66       }
67     } else {
68       *retval = NULL;
69     }
70   }
71
72   // Return type: bool
73   return _retval;
74 }
75
76 int CEF_CALLBACK v8accessor_set(struct _cef_v8accessor_t* self,
77     const cef_string_t* name, struct _cef_v8value_t* object,
78     struct _cef_v8value_t* value, cef_string_t* exception) {
79   // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
80
81   DCHECK(self);
82   if (!self)
83     return 0;
84   // Verify param: name; type: string_byref_const
85   DCHECK(name);
86   if (!name)
87     return 0;
88   // Verify param: object; type: refptr_diff
89   DCHECK(object);
90   if (!object)
91     return 0;
92   // Verify param: value; type: refptr_diff
93   DCHECK(value);
94   if (!value)
95     return 0;
96   // Verify param: exception; type: string_byref
97   DCHECK(exception);
98   if (!exception)
99     return 0;
100
101   // Translate param: exception; type: string_byref
102   CefString exceptionStr(exception);
103
104   // Execute
105   bool _retval = CefV8AccessorCppToC::Get(self)->Set(
106       CefString(name),
107       CefV8ValueCToCpp::Wrap(object),
108       CefV8ValueCToCpp::Wrap(value),
109       exceptionStr);
110
111   // Return type: bool
112   return _retval;
113 }
114
115 }  // namespace
116
117
118 // CONSTRUCTOR - Do not edit by hand.
119
120 CefV8AccessorCppToC::CefV8AccessorCppToC() {
121   GetStruct()->get = v8accessor_get;
122   GetStruct()->set = v8accessor_set;
123 }
124
125 template<> CefRefPtr<CefV8Accessor> CefCppToCRefCounted<CefV8AccessorCppToC,
126     CefV8Accessor, cef_v8accessor_t>::UnwrapDerived(CefWrapperType type,
127     cef_v8accessor_t* s) {
128   NOTREACHED() << "Unexpected class type: " << type;
129   return NULL;
130 }
131
132 #if DCHECK_IS_ON()
133 template<> base::AtomicRefCount CefCppToCRefCounted<CefV8AccessorCppToC,
134     CefV8Accessor, cef_v8accessor_t>::DebugObjCt = 0;
135 #endif
136
137 template<> CefWrapperType CefCppToCRefCounted<CefV8AccessorCppToC,
138     CefV8Accessor, cef_v8accessor_t>::kWrapperType = WT_V8ACCESSOR;