/// <summary>
        /// Create a new CfrRequest object.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_capi.h">cef/include/capi/cef_request_capi.h</see>.
        /// </remarks>
        public static CfrRequest Create()
        {
            var call = new CfxRequestCreateRenderProcessCall();

            call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection);
            return(CfrRequest.Wrap(call.__retval));
        }
Esempio n. 2
0
        /// <summary>
        /// Create a new CfrRequest object.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_capi.h">cef/include/capi/cef_request_capi.h</see>.
        /// </remarks>
        public static CfrRequest Create()
        {
            var call = new CfxRequestCreateRemoteCall();

            call.RequestExecution();
            return(CfrRequest.Wrap(new RemotePtr(call.__retval)));
        }
Esempio n. 3
0
        /// <summary>
        /// Create a new CfrRequest object.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_request_capi.h">cef/include/capi/cef_request_capi.h</see>.
        /// </remarks>
        public static CfrRequest Create()
        {
            var connection = CfxRemoteCallContext.CurrentContext.connection;
            var call       = new CfxRequestCreateRemoteCall();

            call.RequestExecution(connection);
            return(CfrRequest.Wrap(new RemotePtr(connection, call.__retval)));
        }
Esempio n. 4
0
        /// <summary>
        /// Load the request represented by the |request| object.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_frame_capi.h">cef/include/capi/cef_frame_capi.h</see>.
        /// </remarks>
        public void LoadRequest(CfrRequest request)
        {
            var call = new CfxFrameLoadRequestRenderProcessCall();

            call.self    = CfrObject.Unwrap(this);
            call.request = CfrObject.Unwrap(request);
            call.RequestExecution(this);
        }
Esempio n. 5
0
        /// <summary>
        /// Load the request represented by the |request| object.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_frame_capi.h">cef/include/capi/cef_frame_capi.h</see>.
        /// </remarks>
        public void LoadRequest(CfrRequest request)
        {
            var call = new CfxFrameLoadRequestRemoteCall();

            call.@this   = RemotePtr.ptr;
            call.request = CfrObject.Unwrap(request).ptr;
            call.RequestExecution(RemotePtr.connection);
        }
Esempio n. 6
0
        /// <summary>
        /// Load the request represented by the |request| object.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_frame_capi.h">cef/include/capi/cef_frame_capi.h</see>.
        /// </remarks>
        public void LoadRequest(CfrRequest request)
        {
            var connection = RemotePtr.connection;
            var call       = new CfxFrameLoadRequestRemoteCall();

            call.@this = RemotePtr.ptr;
            if (!CfrObject.CheckConnection(request, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "request");
            }
            call.request = CfrObject.Unwrap(request).ptr;
            call.RequestExecution(connection);
        }
        internal static CfrRequest Wrap(IntPtr proxyId)
        {
            if (proxyId == IntPtr.Zero)
            {
                return(null);
            }
            var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache;

            lock (weakCache) {
                var cfrObj = (CfrRequest)weakCache.Get(proxyId);
                if (cfrObj == null)
                {
                    cfrObj = new CfrRequest(proxyId);
                    weakCache.Add(proxyId, cfrObj);
                }
                return(cfrObj);
            }
        }
Esempio n. 8
0
        internal static CfrRequest Wrap(RemotePtr remotePtr)
        {
            if (remotePtr == RemotePtr.Zero)
            {
                return(null);
            }
            var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache;

            lock (weakCache) {
                var cfrObj = (CfrRequest)weakCache.Get(remotePtr.ptr);
                if (cfrObj == null)
                {
                    cfrObj = new CfrRequest(remotePtr);
                    weakCache.Add(remotePtr.ptr, cfrObj);
                }
                return(cfrObj);
            }
        }
Esempio n. 9
0
        /// <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 CfrResourceRequestHandler or CfrSchemeHandlerFactory.
        /// Use CfrUrlRequest.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 function). 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
        /// function.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_frame_capi.h">cef/include/capi/cef_frame_capi.h</see>.
        /// </remarks>
        public CfrUrlRequest CreateUrlRequest(CfrRequest request, CfrUrlRequestClient client)
        {
            var connection = RemotePtr.connection;
            var call       = new CfxFrameCreateUrlRequestRemoteCall();

            call.@this = RemotePtr.ptr;
            if (!CfrObject.CheckConnection(request, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "request");
            }
            call.request = CfrObject.Unwrap(request).ptr;
            if (!CfrObject.CheckConnection(client, connection))
            {
                throw new ArgumentException("Render process connection mismatch.", "client");
            }
            call.client = CfrObject.Unwrap(client).ptr;
            call.RequestExecution(connection);
            return(CfrUrlRequest.Wrap(new RemotePtr(connection, call.__retval)));
        }