private int process_request(cef_resource_handler_t* self, cef_request_t* request, cef_callback_t* callback)
        {
            CheckSelf(self);

            var m_request = CefRequest.FromNative(request);
            var m_callback = CefCallback.FromNative(callback);

            var result = ProcessRequest(m_request, m_callback);
            return result ? 1 : 0;
        }
예제 #2
0
 public static int release(cef_callback_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);
 }
예제 #3
0
 public static int add_ref(cef_callback_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 int read_response(cef_resource_handler_t* self, void* data_out, int bytes_to_read, int* bytes_read, cef_callback_t* callback)
        {
            CheckSelf(self);

            var m_callback = CefCallback.FromNative(callback);

            using (var m_stream = new UnmanagedMemoryStream((byte*)data_out, bytes_to_read, bytes_to_read, FileAccess.Write))
            {
                int m_bytesRead;
                var result = ReadResponse(m_stream, bytes_to_read, out m_bytesRead, m_callback);
                *bytes_read = m_bytesRead;
                return result ? 1 : 0;
            }
        }
예제 #5
0
 public static int get_refct(cef_callback_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);
 }
예제 #6
0
 public static void cancel(cef_callback_t* self)
 {
     cancel_delegate d;
     var p = self->_cancel;
     if (p == _p4) { d = _d4; }
     else
     {
         d = (cancel_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(cancel_delegate));
         if (_p4 == IntPtr.Zero) { _d4 = d; _p4 = p; }
     }
     d(self);
 }
예제 #7
0
 public static void cont(cef_callback_t* self)
 {
     cont_delegate d;
     var p = self->_cont;
     if (p == _p3) { d = _d3; }
     else
     {
         d = (cont_delegate)Marshal.GetDelegateForFunctionPointer(p, typeof(cont_delegate));
         if (_p3 == IntPtr.Zero) { _d3 = d; _p3 = p; }
     }
     d(self);
 }
예제 #8
0
 private CefCallback(cef_callback_t* ptr)
 {
     if (ptr == null) throw new ArgumentNullException("ptr");
     _self = ptr;
 }
예제 #9
0
 internal static CefCallback FromNativeOrNull(cef_callback_t* ptr)
 {
     if (ptr == null) return null;
     return new CefCallback(ptr);
 }
예제 #10
0
 internal static CefCallback FromNative(cef_callback_t* ptr)
 {
     return new CefCallback(ptr);
 }