private void on_download_progress(cef_urlrequest_client_t* self, cef_urlrequest_t* request, ulong current, ulong total)
        {
            CheckSelf(self);

            var m_request = CefUrlRequest.FromNative(request);

            OnDownloadProgress(m_request, current, total);
        }
        private void on_request_complete(cef_urlrequest_client_t* self, cef_urlrequest_t* request)
        {
            CheckSelf(self);

            var m_request = CefUrlRequest.FromNative(request);

            OnRequestComplete(m_request);
        }
        private void on_download_data(cef_urlrequest_client_t* self, cef_urlrequest_t* request, void* data, UIntPtr data_length)
        {
            CheckSelf(self);

            var m_request = CefUrlRequest.FromNative(request);

            using (var stream = new UnmanagedMemoryStream((byte*)data, (long)data_length))
            {
                OnDownloadData(m_request, stream);
            }
        }
 public static int add_ref(cef_urlrequest_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);
 }
 public static void cancel(cef_urlrequest_t* self)
 {
     cancel_delegate d;
     var p = self->_cancel;
     if (p == _p8) { d = _d8; }
     else
     {
         d = (cancel_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(cancel_delegate));
         if (_p8 == IntPtr.Zero) { _d8 = d; _p8 = p; }
     }
     d(self);
 }
 public static cef_response_t* get_response(cef_urlrequest_t* self)
 {
     get_response_delegate d;
     var p = self->_get_response;
     if (p == _p7) { d = _d7; }
     else
     {
         d = (get_response_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_response_delegate));
         if (_p7 == IntPtr.Zero) { _d7 = d; _p7 = p; }
     }
     return d(self);
 }
 public static CefErrorCode get_request_error(cef_urlrequest_t* self)
 {
     get_request_error_delegate d;
     var p = self->_get_request_error;
     if (p == _p6) { d = _d6; }
     else
     {
         d = (get_request_error_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_request_error_delegate));
         if (_p6 == IntPtr.Zero) { _d6 = d; _p6 = p; }
     }
     return d(self);
 }
 public static CefUrlRequestStatus get_request_status(cef_urlrequest_t* self)
 {
     get_request_status_delegate d;
     var p = self->_get_request_status;
     if (p == _p5) { d = _d5; }
     else
     {
         d = (get_request_status_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_request_status_delegate));
         if (_p5 == IntPtr.Zero) { _d5 = d; _p5 = p; }
     }
     return d(self);
 }
 public static cef_urlrequest_client_t* get_client(cef_urlrequest_t* self)
 {
     get_client_delegate d;
     var p = self->_get_client;
     if (p == _p4) { d = _d4; }
     else
     {
         d = (get_client_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(get_client_delegate));
         if (_p4 == IntPtr.Zero) { _d4 = d; _p4 = p; }
     }
     return d(self);
 }
 public static int get_refct(cef_urlrequest_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_urlrequest_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);
 }
 private CefUrlRequest(cef_urlrequest_t* ptr)
 {
     if (ptr == null) throw new ArgumentNullException("ptr");
     _self = ptr;
 }
 internal static CefUrlRequest FromNativeOrNull(cef_urlrequest_t* ptr)
 {
     if (ptr == null) return null;
     return new CefUrlRequest(ptr);
 }
 internal static CefUrlRequest FromNative(cef_urlrequest_t* ptr)
 {
     return new CefUrlRequest(ptr);
 }