internal static cef_user_data_t* Alloc() { var ptr = (cef_user_data_t*)Marshal.AllocHGlobal(_sizeof); *ptr = new cef_user_data_t(); ptr->_base._size = (UIntPtr)_sizeof; return ptr; }
internal static cef_user_data_t *Alloc() { var ptr = (cef_user_data_t *)Marshal.AllocHGlobal(_sizeof); *ptr = new cef_user_data_t(); ptr->_base._size = (UIntPtr)_sizeof; return(ptr); }
internal static CefUserData FromNativeOrNull(cef_user_data_t* ptr) { CefUserData value = null; bool found; lock (_roots) { found = _roots.TryGetValue((IntPtr)ptr, out value); } return found ? value : null; }
private int release(cef_user_data_t* self) { lock (SyncRoot) { var result = --_refct; if (result == 0) { lock (_roots) { _roots.Remove((IntPtr)_self); } } return result; } }
private int add_ref(cef_user_data_t* self) { lock (SyncRoot) { var result = ++_refct; if (result == 1) { lock (_roots) { _roots.Add((IntPtr)_self, this); } } return result; } }
internal static void Free(cef_user_data_t* ptr) { Marshal.FreeHGlobal((IntPtr)ptr); }
private int get_refct(cef_user_data_t* self) { return _refct; }
internal static CefUserData FromNative(cef_user_data_t* ptr) { var value = FromNativeOrNull(ptr); if (value == null) throw ExceptionBuilder.ObjectNotFound(); return value; }
private void CheckSelf(cef_user_data_t* self) { if (_self != self) throw ExceptionBuilder.InvalidSelfReference(); }