internal static cef_resource_bundle_handler_t* Alloc()
 {
     var ptr = (cef_resource_bundle_handler_t*)Marshal.AllocHGlobal(_sizeof);
     *ptr = new cef_resource_bundle_handler_t();
     ptr->_base._size = (UIntPtr)_sizeof;
     return ptr;
 }
        internal static cef_resource_bundle_handler_t *Alloc()
        {
            var ptr = (cef_resource_bundle_handler_t *)Marshal.AllocHGlobal(_sizeof);

            *ptr = new cef_resource_bundle_handler_t();
            ptr->_base._size = (UIntPtr)_sizeof;
            return(ptr);
        }
 private int release(cef_resource_bundle_handler_t* self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
         }
         return result;
     }
 }
 private int add_ref(cef_resource_bundle_handler_t* self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
         return result;
     }
 }
        private int get_localized_string(cef_resource_bundle_handler_t* self, int message_id, cef_string_t* @string)
        {
            CheckSelf(self);

            var value = GetLocalizedString(message_id);

            if (value != null)
            {
                cef_string_t.Copy(value, @string);
                return 1;
            }
            else return 0;
        }
 private void CheckSelf(cef_resource_bundle_handler_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }
 private int get_refct(cef_resource_bundle_handler_t* self)
 {
     return _refct;
 }
 internal static void Free(cef_resource_bundle_handler_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
 private int get_data_resource(cef_resource_bundle_handler_t* self, int resource_id, void** data, UIntPtr* data_size)
 {
     CheckSelf(self);
     return 0; // TODO: CefResourceBundleHandler.GetDataResource
 }