Esempio n. 1
0
        /// <summary>
        /// Notifies the client of the upload progress.
        /// </summary>
        private void on_progress(cef_web_urlrequest_client_t *self, cef_web_urlrequest_t *requester, ulong bytesSent, ulong totalBytesToBeSent)
        {
            ThrowIfObjectDisposed();

            var m_requester = CefWebUrlRequest.From(requester);

            this.OnProgress(m_requester, bytesSent, totalBytesToBeSent);
        }
Esempio n. 2
0
        /// <summary>
        /// Notifies the client that the request state has changed. State change
        /// notifications will always be sent before the below notification
        /// methods are called.
        /// </summary>
        private void on_state_change(cef_web_urlrequest_client_t *self, cef_web_urlrequest_t *requester, cef_weburlrequest_state_t state)
        {
            ThrowIfObjectDisposed();

            var m_requester = CefWebUrlRequest.From(requester);

            this.OnStateChange(m_requester, (CefWebUrlRequestState)state);
        }
Esempio n. 3
0
        /// <summary>
        /// Notifies the client that the request ended with an error.
        /// </summary>
        private void on_error(cef_web_urlrequest_client_t *self, cef_web_urlrequest_t *requester, cef_handler_errorcode_t errorCode)
        {
            ThrowIfObjectDisposed();

            var m_requester = CefWebUrlRequest.From(requester);

            this.OnError(m_requester, (CefHandlerErrorCode)errorCode);
        }
Esempio n. 4
0
        /// <summary>
        /// Notifies the client of the response data.
        /// </summary>
        private void on_headers_received(cef_web_urlrequest_client_t *self, cef_web_urlrequest_t *requester, cef_response_t *response)
        {
            ThrowIfObjectDisposed();

            var m_requester = CefWebUrlRequest.From(requester);
            var m_response  = CefResponse.From(response);

            this.OnHeadersReceived(m_requester, m_response);
        }
Esempio n. 5
0
 /// <summary>
 /// Create a new CefWebUrlRequest object.
 /// </summary>
 public static CefWebUrlRequest Create(CefRequest request, CefWebUrlRequestClient client)
 {
     return(CefWebUrlRequest.From(
                NativeMethods.cef_web_urlrequest_create(
                    request.GetNativePointerAndAddRef(),
                    client.GetNativePointerAndAddRef()
                    )
                ));
 }
Esempio n. 6
0
        /// <summary>
        /// Notifies the client that the request has been redirected and
        /// provides a chance to change the request parameters.
        /// </summary>
        private void on_redirect(cef_web_urlrequest_client_t *self, cef_web_urlrequest_t *requester, cef_request_t *request, cef_response_t *response)
        {
            ThrowIfObjectDisposed();

            var m_requester = CefWebUrlRequest.From(requester);
            var m_request   = CefRequest.From(request);
            var m_response  = CefResponse.From(response);

            this.OnRedirect(m_requester, m_request, m_response);
        }
Esempio n. 7
0
        /// <summary>
        /// Notifies the client that content has been received.
        /// </summary>
        private void on_data(cef_web_urlrequest_client_t *self, cef_web_urlrequest_t *requester, /*const*/ void *data, int dataLength)
        {
            ThrowIfObjectDisposed();

            var m_requester = CefWebUrlRequest.From(requester);

            using (var m_stream = new UnmanagedMemoryStream((byte *)data, dataLength, dataLength, FileAccess.Read))
            {
                this.OnData(m_requester, m_stream, dataLength);
            }
        }