private void on_download_updated(cef_download_handler_t* self, cef_browser_t* browser, cef_download_item_t* download_item, cef_download_item_callback_t* callback)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_download_item = CefDownloadItem.FromNative(download_item);
            var m_callback = CefDownloadItemCallback.FromNative(callback);

            OnDownloadUpdated(m_browser, m_download_item, m_callback);

            m_download_item.Dispose();
        }
        private void on_before_download(cef_download_handler_t* self, cef_browser_t* browser, cef_download_item_t* download_item, cef_string_t* suggested_name, cef_before_download_callback_t* callback)
        {
            CheckSelf(self);

            var m_browser = CefBrowser.FromNative(browser);
            var m_download_item = CefDownloadItem.FromNative(download_item);
            var m_suggested_name = cef_string_t.ToString(suggested_name);
            var m_callback = CefBeforeDownloadCallback.FromNative(callback);

            OnBeforeDownload(m_browser, m_download_item, m_suggested_name, m_callback);

            m_download_item.Dispose();
        }
 public static cef_string_userfree* get_full_path(cef_download_item_t* self)
 {
     get_full_path_delegate d;
     var p = self->_get_full_path;
     if (p == _pd) { d = _dd; }
     else
     {
         d = (get_full_path_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_full_path_delegate));
         if (_pd == IntPtr.Zero) { _dd = d; _pd = p; }
     }
     return d(self);
 }
 public static cef_time_t get_end_time(cef_download_item_t* self)
 {
     get_end_time_delegate d;
     var p = self->_get_end_time;
     if (p == _pc) { d = _dc; }
     else
     {
         d = (get_end_time_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_end_time_delegate));
         if (_pc == IntPtr.Zero) { _dc = d; _pc = p; }
     }
     return d(self);
 }
 public static long get_received_bytes(cef_download_item_t* self)
 {
     get_received_bytes_delegate d;
     var p = self->_get_received_bytes;
     if (p == _pa) { d = _da; }
     else
     {
         d = (get_received_bytes_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_received_bytes_delegate));
         if (_pa == IntPtr.Zero) { _da = d; _pa = p; }
     }
     return d(self);
 }
 public static int get_percent_complete(cef_download_item_t* self)
 {
     get_percent_complete_delegate d;
     var p = self->_get_percent_complete;
     if (p == _p8) { d = _d8; }
     else
     {
         d = (get_percent_complete_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_percent_complete_delegate));
         if (_p8 == IntPtr.Zero) { _d8 = d; _p8 = p; }
     }
     return d(self);
 }
 public static long get_current_speed(cef_download_item_t* self)
 {
     get_current_speed_delegate d;
     var p = self->_get_current_speed;
     if (p == _p7) { d = _d7; }
     else
     {
         d = (get_current_speed_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_current_speed_delegate));
         if (_p7 == IntPtr.Zero) { _d7 = d; _p7 = p; }
     }
     return d(self);
 }
 internal static CefDownloadItem FromNativeOrNull(cef_download_item_t* ptr)
 {
     if (ptr == null) return null;
     return new CefDownloadItem(ptr);
 }
 public static cef_string_userfree* get_content_disposition(cef_download_item_t* self)
 {
     get_content_disposition_delegate d;
     var p = self->_get_content_disposition;
     if (p == _p11) { d = _d11; }
     else
     {
         d = (get_content_disposition_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_content_disposition_delegate));
         if (_p11 == IntPtr.Zero) { _d11 = d; _p11 = p; }
     }
     return d(self);
 }
 public static int is_in_progress(cef_download_item_t* self)
 {
     is_in_progress_delegate d;
     var p = self->_is_in_progress;
     if (p == _p4) { d = _d4; }
     else
     {
         d = (is_in_progress_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(is_in_progress_delegate));
         if (_p4 == IntPtr.Zero) { _d4 = d; _p4 = p; }
     }
     return d(self);
 }
 public static int get_refct(cef_download_item_t* self)
 {
     get_refct_delegate d;
     var p = self->_base._get_refct;
     if (p == _p2) { d = _d2; }
     else
     {
         d = (get_refct_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_refct_delegate));
         if (_p2 == IntPtr.Zero) { _d2 = d; _p2 = p; }
     }
     return d(self);
 }
 public static int release(cef_download_item_t* self)
 {
     release_delegate d;
     var p = self->_base._release;
     if (p == _p1) { d = _d1; }
     else
     {
         d = (release_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(release_delegate));
         if (_p1 == IntPtr.Zero) { _d1 = d; _p1 = p; }
     }
     return d(self);
 }
 public static int add_ref(cef_download_item_t* self)
 {
     add_ref_delegate d;
     var p = self->_base._add_ref;
     if (p == _p0) { d = _d0; }
     else
     {
         d = (add_ref_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(add_ref_delegate));
         if (_p0 == IntPtr.Zero) { _d0 = d; _p0 = p; }
     }
     return d(self);
 }
 private CefDownloadItem(cef_download_item_t* ptr)
 {
     if (ptr == null) throw new ArgumentNullException("ptr");
     _self = ptr;
 }
 public static uint get_id(cef_download_item_t* self)
 {
     get_id_delegate d;
     var p = self->_get_id;
     if (p == _pe) { d = _de; }
     else
     {
         d = (get_id_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_id_delegate));
         if (_pe == IntPtr.Zero) { _de = d; _pe = p; }
     }
     return d(self);
 }
 public static int is_complete(cef_download_item_t* self)
 {
     is_complete_delegate d;
     var p = self->_is_complete;
     if (p == _p5) { d = _d5; }
     else
     {
         d = (is_complete_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(is_complete_delegate));
         if (_p5 == IntPtr.Zero) { _d5 = d; _p5 = p; }
     }
     return d(self);
 }
 public static cef_string_userfree* get_suggested_file_name(cef_download_item_t* self)
 {
     get_suggested_file_name_delegate d;
     var p = self->_get_suggested_file_name;
     if (p == _p10) { d = _d10; }
     else
     {
         d = (get_suggested_file_name_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_suggested_file_name_delegate));
         if (_p10 == IntPtr.Zero) { _d10 = d; _p10 = p; }
     }
     return d(self);
 }
 public static int is_canceled(cef_download_item_t* self)
 {
     is_canceled_delegate d;
     var p = self->_is_canceled;
     if (p == _p6) { d = _d6; }
     else
     {
         d = (is_canceled_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(is_canceled_delegate));
         if (_p6 == IntPtr.Zero) { _d6 = d; _p6 = p; }
     }
     return d(self);
 }
 public static cef_string_userfree* get_mime_type(cef_download_item_t* self)
 {
     get_mime_type_delegate d;
     var p = self->_get_mime_type;
     if (p == _p12) { d = _d12; }
     else
     {
         d = (get_mime_type_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_mime_type_delegate));
         if (_p12 == IntPtr.Zero) { _d12 = d; _p12 = p; }
     }
     return d(self);
 }
 internal static CefDownloadItem FromNative(cef_download_item_t* ptr)
 {
     return new CefDownloadItem(ptr);
 }