コード例 #1
0
ファイル: CefFrame.cs プロジェクト: tokyokamera/Chromely
        /// <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));
        }
コード例 #2
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);
        }
コード例 #3
0
ファイル: CefUrlRequest.cs プロジェクト: rajsite/lvcef
        /// <summary>
        /// Create a new URL request. Only GET, POST, HEAD, DELETE and PUT request
        /// methods are supported. Multiple post data elements are not supported and
        /// elements of type PDE_TYPE_FILE are only supported for requests originating
        /// from the browser process. Requests originating from the render process will
        /// receive the same handling as requests originating from Web content -- 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 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)
                );
        }
コード例 #4
0
        /// <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)
                       ));
        }
コード例 #5
0
ファイル: CefUrlRequest.cs プロジェクト: ruo2012/Chromely
 /// <summary>
 /// Returns the client.
 /// </summary>
 public CefUrlRequestClient GetClient()
 {
     return(CefUrlRequestClient.FromNative(
                cef_urlrequest_t.get_client(_self)
                ));
 }