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.
5 // ---------------------------------------------------------------------------
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.
13 #include "libcef_dll/cpptoc/v8accessor_cpptoc.h"
14 #include "libcef_dll/ctocpp/v8value_ctocpp.h"
19 // MEMBER FUNCTIONS - Body may be edited by hand.
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
29 // Verify param: name; type: string_byref_const
33 // Verify param: object; type: refptr_diff
37 // Verify param: retval; type: refptr_diff_byref
41 // Verify param: exception; type: string_byref
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);
55 bool _retval = CefV8AccessorCppToC::Get(self)->Get(
57 CefV8ValueCToCpp::Wrap(object),
61 // Restore param: retval; type: refptr_diff_byref
63 if (retvalPtr.get()) {
64 if (retvalPtr.get() != retvalOrig) {
65 *retval = CefV8ValueCToCpp::Unwrap(retvalPtr);
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
84 // Verify param: name; type: string_byref_const
88 // Verify param: object; type: refptr_diff
92 // Verify param: value; type: refptr_diff
96 // Verify param: exception; type: string_byref
101 // Translate param: exception; type: string_byref
102 CefString exceptionStr(exception);
105 bool _retval = CefV8AccessorCppToC::Get(self)->Set(
107 CefV8ValueCToCpp::Wrap(object),
108 CefV8ValueCToCpp::Wrap(value),
118 // CONSTRUCTOR - Do not edit by hand.
120 CefV8AccessorCppToC::CefV8AccessorCppToC() {
121 GetStruct()->get = v8accessor_get;
122 GetStruct()->set = v8accessor_set;
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;
133 template<> base::AtomicRefCount CefCppToCRefCounted<CefV8AccessorCppToC,
134 CefV8Accessor, cef_v8accessor_t>::DebugObjCt = 0;
137 template<> CefWrapperType CefCppToCRefCounted<CefV8AccessorCppToC,
138 CefV8Accessor, cef_v8accessor_t>::kWrapperType = WT_V8ACCESSOR;