private void on_download_progress(cef_urlrequest_client_t *self, cef_urlrequest_t *request, long current, long 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); }
/// <summary> /// Create a new URL request that will be treated as originating from this /// frame and the associated browser. This request may be intercepted by the /// client via CefResourceRequestHandler or CefSchemeHandlerFactory. Use /// CefURLRequest::Create instead if you do not want the request to have this /// association, in which case it may be handled differently (see documentation /// on that method). Requests may originate from both the browser process and /// the render process. /// For requests originating from the browser process: /// - POST data may only contain a single element of type PDE_TYPE_FILE or /// PDE_TYPE_BYTES. /// For requests originating from the render process: /// - POST data may only contain a single element of type PDE_TYPE_BYTES. /// - If the response contains Content-Disposition or Mime-Type header values /// that would not normally be rendered then the response may receive /// special handling inside the browser (for example, via the file download /// code path instead of the URL request code path). /// The |request| object will be marked as read-only after calling this method. /// </summary> public CefUrlRequest CreateUrlRequest(CefRequest request, CefUrlRequestClient client = null) { var n_request = request.ToNative(); var n_client = client != null?client.ToNative() : null; var n_result = cef_frame_t.create_urlrequest(_self, n_request, n_client); return(CefUrlRequest.FromNativeOrNull(n_result)); }
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); } }
/// <summary> /// Create a new URL request. Only GET, POST, HEAD, DELETE and PUT request /// methods are supported. The |request| object will be marked as read-only /// after calling this method. /// </summary> public static CefUrlRequest Create(CefRequest request, CefUrlRequestClient client) { if (request == null) { throw new ArgumentNullException("request"); } var n_request = request.ToNative(); var n_client = client.ToNative(); return(CefUrlRequest.FromNative( cef_urlrequest_t.create(n_request, n_client) )); }
/// <summary> /// Called when some part of the response is read. |data| contains the current /// bytes received since the last call. This method will not be called if the /// UR_FLAG_NO_DOWNLOAD_DATA flag is set on the request. /// </summary> protected abstract void OnDownloadData(CefUrlRequest request, Stream data);
/// <summary> /// Notifies the client of download progress. |current| denotes the number of /// bytes received up to the call and |total| is the expected total size of the /// response (or -1 if not determined). /// </summary> protected abstract void OnDownloadProgress(CefUrlRequest request, long current, long total);
/// <summary> /// Notifies the client that the request has completed. Use the /// CefURLRequest::GetRequestStatus method to determine if the request was /// successful or not. /// </summary> protected abstract void OnRequestComplete(CefUrlRequest request);
/// <summary> /// Notifies the client of upload progress. |current| denotes the number of /// bytes sent so far and |total| is the total size of uploading data (or -1 if /// chunked upload is enabled). This method will only be called if the /// UR_FLAG_REPORT_UPLOAD_PROGRESS flag is set on the request. /// </summary> protected abstract void OnUploadProgress(CefUrlRequest request, ulong current, ulong total);
/// <summary> /// Notifies the client that the request has completed. Use the /// CefURLRequest::GetRequestStatus method to determine if the request was /// successful or not. /// </summary> protected abstract void OnRequestComplete(CefUrlRequest request);
/// <summary> /// Called when some part of the response is read. |data| contains the current /// bytes received since the last call. This method will not be called if the /// UR_FLAG_NO_DOWNLOAD_DATA flag is set on the request. /// </summary> protected abstract void OnDownloadData(CefUrlRequest request, Stream data);