internal static cef_v8accessor_t* Alloc() { var ptr = (cef_v8accessor_t*)Marshal.AllocHGlobal(_sizeof); *ptr = new cef_v8accessor_t(); ptr->_base._size = (UIntPtr)_sizeof; return ptr; }
private int get(cef_v8accessor_t* self, cef_string_t* name, cef_v8value_t* @object, cef_v8value_t** retval, cef_string_t* exception) { CheckSelf(self); var m_name = cef_string_t.ToString(name); var m_obj = CefV8Value.FromNative(@object); CefV8Value m_returnValue; string mException; var handled = Get(m_name, m_obj, out m_returnValue, out mException); if (handled) { if (mException != null) { cef_string_t.Copy(mException, exception); } else if (m_returnValue != null) { *retval = m_returnValue.ToNative(); } } return handled ? 1 : 0; }
internal static cef_v8accessor_t *Alloc() { var ptr = (cef_v8accessor_t *)Marshal.AllocHGlobal(_sizeof); *ptr = new cef_v8accessor_t(); ptr->_base._size = (UIntPtr)_sizeof; return(ptr); }
private void add_ref(cef_v8accessor_t* self) { lock (SyncRoot) { var result = ++_refct; if (result == 1) { lock (_roots) { _roots.Add((IntPtr)_self, this); } } } }
private int release(cef_v8accessor_t* self) { lock (SyncRoot) { var result = --_refct; if (result == 0) { lock (_roots) { _roots.Remove((IntPtr)_self); } return 1; } return 0; } }
private int set(cef_v8accessor_t* self, cef_string_t* name, cef_v8value_t* @object, cef_v8value_t* value, cef_string_t* exception) { CheckSelf(self); var m_name = cef_string_t.ToString(name); var m_obj = CefV8Value.FromNative(@object); var m_value = CefV8Value.FromNative(value); string mException; var handled = this.Set(m_name, m_obj, m_value, out mException); if (handled) { if (mException != null) { cef_string_t.Copy(mException, exception); } } return handled ? 1 : 0; }
internal static void Free(cef_v8accessor_t* ptr) { Marshal.FreeHGlobal((IntPtr)ptr); }
private void CheckSelf(cef_v8accessor_t* self) { if (_self != self) throw ExceptionBuilder.InvalidSelfReference(); }
private int has_one_ref(cef_v8accessor_t* self) { lock (SyncRoot) { return _refct == 1 ? 1 : 0; } }
public static extern cef_v8value_t* create_object(cef_v8accessor_t* accessor);
private int get_refct(cef_v8accessor_t* self) { return _refct; }