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);
        }
        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);
            }
        }
 /// <summary>
 /// Read response data. If data is available immediately copy up to
 /// |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of
 /// bytes copied, and return true. To read the data at a later time set
 /// |bytes_read| to 0, return true and call CefCallback::Continue() when the
 /// data is available. To indicate response completion return false.
 /// </summary>
 protected abstract bool ReadResponse(Stream response, int bytesToRead, out int bytesRead, CefCallback callback);
 /// <summary>
 /// Begin processing the request. To handle the request return true and call
 /// CefCallback::Continue() once the response header information is available
 /// (CefCallback::Continue() can also be called from inside this method if
 /// header information is available immediately). To cancel the request return
 /// false.
 /// </summary>
 protected abstract bool ProcessRequest(CefRequest request, CefCallback callback);