Example #1
0
        /// <summary>
        /// Create a new CfrStreamReader object from data.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_stream_capi.h">cef/include/capi/cef_stream_capi.h</see>.
        /// </remarks>
        public static CfrStreamReader CreateForData(RemotePtr data, ulong size)
        {
            var call = new CfxStreamReaderCreateForDataRemoteCall();

            call.data = data.ptr;
            call.size = size;
            call.RequestExecution();
            return(CfrStreamReader.Wrap(new RemotePtr(call.__retval)));
        }
        /// <summary>
        /// Create a new CfrStreamReader object from data.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_stream_capi.h">cef/include/capi/cef_stream_capi.h</see>.
        /// </remarks>
        public static CfrStreamReader CreateForData(RemotePtr data, ulong size)
        {
            var connection = CfxRemoteCallContext.CurrentContext.connection;
            var call       = new CfxStreamReaderCreateForDataRemoteCall();

            if (data.connection != connection)
            {
                throw new ArgumentException("Render process connection mismatch.", "data");
            }
            call.data = data.ptr;
            call.size = size;
            call.RequestExecution(connection);
            return(CfrStreamReader.Wrap(new RemotePtr(connection, call.__retval)));
        }