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

            *ptr = new cef_urlrequest_client_t();
            ptr->_base._size = (UIntPtr)_sizeof;
            return(ptr);
        }
        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);
        }
Beispiel #5
0
 internal static CefUrlRequestClient FromNativeOrNull(cef_urlrequest_client_t* ptr)
 {
     CefUrlRequestClient value = null;
     bool found;
     lock (_roots)
     {
         found = _roots.TryGetValue((IntPtr)ptr, out value);
     }
     return found ? value : null;
 }
Beispiel #6
0
 private void add_ref(cef_urlrequest_client_t* self)
 {
     lock (SyncRoot)
     {
         var result = ++_refct;
         if (result == 1)
         {
             lock (_roots) { _roots.Add((IntPtr)_self, this); }
         }
     }
 }
Beispiel #7
0
        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);
            }
        }
Beispiel #8
0
        private int get_auth_credentials(cef_urlrequest_client_t* self, int isProxy, cef_string_t* host, int port, cef_string_t* realm, cef_string_t* scheme, cef_auth_callback_t* callback)
        {
            CheckSelf(self);

            var m_isProxy = isProxy != 0;
            var m_host = cef_string_t.ToString(host);
            var m_realm = cef_string_t.ToString(realm);
            var m_scheme = cef_string_t.ToString(scheme);
            var m_callback = CefAuthCallback.FromNative(callback);

            var m_result = GetAuthCredentials(m_isProxy, m_host, port, m_realm, m_scheme, m_callback);

            return m_result ? 1 : 0;
        }
Beispiel #9
0
 private int release(cef_urlrequest_client_t* self)
 {
     lock (SyncRoot)
     {
         var result = --_refct;
         if (result == 0)
         {
             lock (_roots) { _roots.Remove((IntPtr)_self); }
             return 1;
         }
         return 0;
     }
 }
Beispiel #10
0
 internal static CefUrlRequestClient FromNative(cef_urlrequest_client_t* ptr)
 {
     var value = FromNativeOrNull(ptr);
     if (value == null) throw ExceptionBuilder.ObjectNotFound();
     return value;
 }
Beispiel #11
0
 private void CheckSelf(cef_urlrequest_client_t* self)
 {
     if (_self != self) throw ExceptionBuilder.InvalidSelfReference();
 }
Beispiel #12
0
 private int has_one_ref(cef_urlrequest_client_t* self)
 {
     lock (SyncRoot) { return _refct == 1 ? 1 : 0; }
 }
 internal static void Free(cef_urlrequest_client_t* ptr)
 {
     Marshal.FreeHGlobal((IntPtr)ptr);
 }
 private int get_refct(cef_urlrequest_client_t* self)
 {
     return _refct;
 }
Beispiel #15
0
 public static extern cef_urlrequest_t* create(cef_request_t* request, cef_urlrequest_client_t* client);