コード例 #1
0
ファイル: CfrMarshal.cs プロジェクト: xmcy0011/NanUI
            /// <summary>
            /// Call Marshal.FreeHGlobal in the target process.
            /// </summary>
            public static void FreeHGlobal(RemotePtr hglobal)
            {
                var call = new CfrMarshalFreeHGlobalRenderProcessCall();

                call.hglobal = hglobal.ptr;
                call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection);
            }
コード例 #2
0
            /// <summary>
            /// Call Marshal.FreeHGlobal in the target process.
            /// </summary>
            public static void FreeHGlobal(RemotePtr hglobal)
            {
                var call = new CfrMarshalFreeHGlobalRemoteCall();

                call.hglobal = hglobal.ptr;
                call.RequestExecution(hglobal.connection);
            }
コード例 #3
0
 internal static CfrSchemeRegistrar Wrap(RemotePtr remotePtr)
 {
     if (remotePtr == RemotePtr.Zero)
     {
         return(null);
     }
     return(new CfrSchemeRegistrar(remotePtr));
 }
コード例 #4
0
 internal override sealed void OnDispose(RemotePtr remotePtr)
 {
     if (dtor != null)
     {
         dtor.nativePtr = remotePtr.ptr;
         dtor.RequestExecution(remotePtr.connection);
     }
 }
コード例 #5
0
        /// <summary>
        /// Initialize the command line with the specified |argc| and |argv| values.
        /// The first argument must be the name of the program. This function is only
        /// supported on non-Windows platforms.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_command_line_capi.h">cef/include/capi/cef_command_line_capi.h</see>.
        /// </remarks>
        public void InitFromArgv(int argc, RemotePtr argv)
        {
            var call = new CfxCommandLineInitFromArgvRenderProcessCall();

            call.self = CfrObject.Unwrap(this);
            call.argc = argc;
            call.argv = argv.ptr;
            call.RequestExecution(this);
        }
コード例 #6
0
ファイル: CfrBinaryValue.cs プロジェクト: xmcy0011/NanUI
        /// <summary>
        /// Creates a new object that is not owned by any other object. The specified
        /// |data| will be copied.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
        /// </remarks>
        public static CfrBinaryValue Create(RemotePtr data, int dataSize)
        {
            var call = new CfxBinaryValueCreateRenderProcessCall();

            call.data     = data.ptr;
            call.dataSize = dataSize;
            call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection);
            return(CfrBinaryValue.Wrap(call.__retval));
        }
コード例 #7
0
            /// <summary>
            /// Call Marshal.PtrToStringUni in the target process.
            /// </summary>
            public static string PtrToStringUni(RemotePtr str, int length)
            {
                var call = new CfrMarshalPtrToStringUniRemoteCall();

                call.str    = str.ptr;
                call.length = length;
                call.RequestExecution(str.connection);
                return(call.__retval);
            }
コード例 #8
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)));
        }
コード例 #9
0
        /// <summary>
        /// Sets the user data for this object and returns true (1) on success. Returns
        /// false (0) if this function is called incorrectly. This function can only be
        /// called on user created objects.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_v8_capi.h">cef/include/capi/cef_v8_capi.h</see>.
        /// </remarks>
        public bool SetUserData(RemotePtr userData)
        {
            var call = new CfxV8ValueSetUserDataRenderProcessCall();

            call.@this    = proxyId;
            call.userData = userData.ptr;
            call.RequestExecution(this);
            return(call.__retval);
        }
コード例 #10
0
        /// <summary>
        /// The post data element will represent bytes.  The bytes passed in will be
        /// copied.
        /// </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 void SetToBytes(ulong size, RemotePtr bytes)
        {
            var call = new CfxPostDataElementSetToBytesRemoteCall();

            call.@this = RemotePtr.ptr;
            call.size  = size;
            call.bytes = bytes.ptr;
            call.RequestExecution(RemotePtr.connection);
        }
コード例 #11
0
        /// <summary>
        /// The post data element will represent bytes.  The bytes passed in will be
        /// copied.
        /// </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 void SetToBytes(ulong size, RemotePtr bytes)
        {
            var call = new CfxPostDataElementSetToBytesRenderProcessCall();

            call.@this = proxyId;
            call.size  = size;
            call.bytes = bytes.ptr;
            call.RequestExecution(this);
        }
コード例 #12
0
ファイル: CfrCommandLine.cs プロジェクト: 386845154a/NanUI-1
        /// <summary>
        /// Initialize the command line with the specified |argc| and |argv| values.
        /// The first argument must be the name of the program. This function is only
        /// supported on non-Windows platforms.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_command_line_capi.h">cef/include/capi/cef_command_line_capi.h</see>.
        /// </remarks>
        public void InitFromArgv(int argc, RemotePtr argv)
        {
            var call = new CfxCommandLineInitFromArgvRemoteCall();

            call.@this = RemotePtr.ptr;
            call.argc  = argc;
            call.argv  = argv.ptr;
            call.RequestExecution(RemotePtr.connection);
        }
コード例 #13
0
        /// <summary>
        /// Initialize the command line with the specified |argc| and |argv| values.
        /// The first argument must be the name of the program. This function is only
        /// supported on non-Windows platforms.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_command_line_capi.h">cef/include/capi/cef_command_line_capi.h</see>.
        /// </remarks>
        public void InitFromArgv(int argc, RemotePtr argv)
        {
            var call = new CfxCommandLineInitFromArgvRenderProcessCall();

            call.@this = proxyId;
            call.argc  = argc;
            call.argv  = argv.ptr;
            call.RequestExecution(this);
        }
コード例 #14
0
        /// <summary>
        /// Creates a new object that is not owned by any other object. The specified
        /// |data| will be copied.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
        /// </remarks>
        public static CfrBinaryValue Create(RemotePtr data, ulong dataSize)
        {
            var call = new CfxBinaryValueCreateRemoteCall();

            call.data     = data.ptr;
            call.dataSize = dataSize;
            call.RequestExecution();
            return(CfrBinaryValue.Wrap(new RemotePtr(call.__retval)));
        }
コード例 #15
0
ファイル: CfrPostDataElement.cs プロジェクト: xmcy0011/NanUI
        /// <summary>
        /// The post data element will represent bytes.  The bytes passed in will be
        /// copied.
        /// </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 void SetToBytes(int size, RemotePtr bytes)
        {
            var call = new CfxPostDataElementSetToBytesRenderProcessCall();

            call.self  = CfrObject.Unwrap(this);
            call.size  = size;
            call.bytes = bytes.ptr;
            call.RequestExecution(this);
        }
コード例 #16
0
ファイル: CfrV8Value.cs プロジェクト: 386845154a/NanUI-1
        /// <summary>
        /// Sets the user data for this object and returns true (1) on success. Returns
        /// false (0) if this function is called incorrectly. This function can only be
        /// called on user created objects.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_v8_capi.h">cef/include/capi/cef_v8_capi.h</see>.
        /// </remarks>
        public bool SetUserData(RemotePtr userData)
        {
            var call = new CfxV8ValueSetUserDataRemoteCall();

            call.@this    = RemotePtr.ptr;
            call.userData = userData.ptr;
            call.RequestExecution(RemotePtr.connection);
            return(call.__retval);
        }
コード例 #17
0
ファイル: CfrV8Value.cs プロジェクト: MeetOct/ChromiumFX
        /// <summary>
        /// Sets the user data for this object and returns true (1) on success. Returns
        /// false (0) if this function is called incorrectly. This function can only be
        /// called on user created objects.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_v8_capi.h">cef/include/capi/cef_v8_capi.h</see>.
        /// </remarks>
        public bool SetUserData(RemotePtr userData)
        {
            var call = new CfxV8ValueSetUserDataRenderProcessCall();

            call.self     = CfrObject.Unwrap(this);
            call.userData = userData.ptr;
            call.RequestExecution(this);
            return(call.__retval);
        }
コード例 #18
0
            /// <summary>
            /// Call Marshal.Copy in the target process.
            /// </summary>
            public static void Copy(byte[] source, int startIndex, RemotePtr destination, int length)
            {
                var call = new CfrMarshalCopyToNativeRemoteCall();

                call.source      = source;
                call.startIndex  = startIndex;
                call.destination = destination.ptr;
                call.length      = length;
                call.RequestExecution(destination.connection);
            }
コード例 #19
0
        /// <summary>
        /// Read up to |size| bytes into |bytes| and return the number of bytes
        /// actually read.
        /// </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 ulong GetBytes(ulong size, RemotePtr bytes)
        {
            var call = new CfxPostDataElementGetBytesRemoteCall();

            call.@this = RemotePtr.ptr;
            call.size  = size;
            call.bytes = bytes.ptr;
            call.RequestExecution(RemotePtr.connection);
            return(call.__retval);
        }
コード例 #20
0
ファイル: CfrMarshal.cs プロジェクト: xmcy0011/NanUI
            /// <summary>
            /// Call Marshal.Copy in the target process.
            /// </summary>
            public static void Copy(RemotePtr source, byte[] destination, int startIndex, int length)
            {
                var call = new CfrMarshalCopyToManagedRenderProcessCall();

                call.source      = source.ptr;
                call.destination = destination;
                call.startIndex  = startIndex;
                call.length      = length;
                call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection);
            }
コード例 #21
0
            /// <summary>
            /// Call Marshal.Copy in the target process.
            /// </summary>
            public static void Copy(RemotePtr source, byte[] destination, int startIndex, int length)
            {
                var call = new CfrMarshalCopyToManagedRemoteCall();

                call.source     = source.ptr;
                call.startIndex = startIndex;
                call.length     = length;
                call.RequestExecution(source.connection);
                Array.Copy(call.destination, startIndex, destination, startIndex, length);
            }
コード例 #22
0
ファイル: CfrPostDataElement.cs プロジェクト: xmcy0011/NanUI
        /// <summary>
        /// Read up to |size| bytes into |bytes| and return the number of bytes
        /// actually read.
        /// </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 int GetBytes(int size, RemotePtr bytes)
        {
            var call = new CfxPostDataElementGetBytesRenderProcessCall();

            call.self  = CfrObject.Unwrap(this);
            call.size  = size;
            call.bytes = bytes.ptr;
            call.RequestExecution(this);
            return(call.__retval);
        }
コード例 #23
0
ファイル: CfrZipReader.cs プロジェクト: 386845154a/NanUI-1
        /// <summary>
        /// Read uncompressed file contents into the specified buffer. Returns &lt; 0 if
        /// an error occurred, 0 if at the end of file, or the number of bytes read.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_zip_reader_capi.h">cef/include/capi/cef_zip_reader_capi.h</see>.
        /// </remarks>
        public int ReadFile(RemotePtr buffer, ulong bufferSize)
        {
            var call = new CfxZipReaderReadFileRemoteCall();

            call.@this      = RemotePtr.ptr;
            call.buffer     = buffer.ptr;
            call.bufferSize = bufferSize;
            call.RequestExecution(RemotePtr.connection);
            return(call.__retval);
        }
コード例 #24
0
ファイル: CfrTime.cs プロジェクト: wendywang1993/ChromiumFX
        internal static CfrTime Wrap(RemotePtr remotePtr)
        {
            if (remotePtr == RemotePtr.Zero)
            {
                return(null);
            }
            var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache;

            return((CfrTime)weakCache.GetOrAdd(remotePtr.ptr, () => new CfrTime(remotePtr)));
        }
コード例 #25
0
        /// <summary>
        /// Read up to |size| bytes into |bytes| and return the number of bytes
        /// actually read.
        /// </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 ulong GetBytes(ulong size, RemotePtr bytes)
        {
            var call = new CfxPostDataElementGetBytesRenderProcessCall();

            call.@this = proxyId;
            call.size  = size;
            call.bytes = bytes.ptr;
            call.RequestExecution(this);
            return(call.__retval);
        }
コード例 #26
0
 public void Dispose()
 {
     if (m_remotePtr != RemotePtr.Zero)
     {
         m_remotePtr.connection.weakCache.Remove(m_remotePtr.ptr);
         OnDispose(m_remotePtr);
         m_remotePtr = RemotePtr.Zero;
         GC.SuppressFinalize(this);
     }
 }
コード例 #27
0
        /// <summary>
        /// Retrieves the contents of the specified scale independent |resourceId|. If
        /// the value is found then |data| and |dataSize| will be populated and this
        /// function will return true (1). If the value is not found then this function
        /// will return false (0). The returned |data| pointer will remain resident in
        /// memory and should not be freed. Include cef_pack_resources.h for a listing
        /// of valid resource ID values.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_resource_bundle_capi.h">cef/include/capi/cef_resource_bundle_capi.h</see>.
        /// </remarks>
        public bool GetDataResource(int resourceId, RemotePtr data, ulong dataSize)
        {
            var call = new CfxResourceBundleGetDataResourceRemoteCall();

            call.@this      = RemotePtr.ptr;
            call.resourceId = resourceId;
            call.RequestExecution(RemotePtr.connection);
            data     = new RemotePtr(connection, call.data);
            dataSize = call.dataSize;
            return(call.__retval);
        }
コード例 #28
0
        /// <summary>
        /// Read up to |bufferSize| number of bytes into |buffer|. Reading begins at
        /// the specified byte |dataOffset|. Returns the number of bytes read.
        /// </summary>
        /// <remarks>
        /// See also the original CEF documentation in
        /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
        /// </remarks>
        public ulong GetData(RemotePtr buffer, ulong bufferSize, ulong dataOffset)
        {
            var call = new CfxBinaryValueGetDataRemoteCall();

            call.@this      = RemotePtr.ptr;
            call.buffer     = buffer.ptr;
            call.bufferSize = bufferSize;
            call.dataOffset = dataOffset;
            call.RequestExecution(RemotePtr.connection);
            return(call.__retval);
        }
コード例 #29
0
        /// <summary>
        /// Read raw binary 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 ulong Read(RemotePtr ptr, ulong size, ulong n)
        {
            var call = new CfxStreamReaderReadRemoteCall();

            call.@this = RemotePtr.ptr;
            call.ptr   = ptr.ptr;
            call.size  = size;
            call.n     = n;
            call.RequestExecution(RemotePtr.connection);
            return(call.__retval);
        }
コード例 #30
0
        internal override void OnDispose(RemotePtr remotePtr)
        {
            var call = new CfxApiReleaseRemoteCall();

            call.nativePtr = remotePtr.ptr;
            try {
                call.RequestExecution(remotePtr.connection);
            } catch {
                // if the remote process is gone do nothing
            }
        }
コード例 #31
0
ファイル: CfrPostDataElement.cs プロジェクト: xmcy0011/NanUI
 /// <summary>
 /// Read up to |size| bytes into |bytes| and return the number of bytes
 /// actually read.
 /// </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 int GetBytes(int size, RemotePtr bytes)
 {
     var call = new CfxPostDataElementGetBytesRenderProcessCall();
     call.self = CfrObject.Unwrap(this);
     call.size = size;
     call.bytes = bytes.ptr;
     call.RequestExecution(this);
     return call.__retval;
 }
コード例 #32
0
ファイル: CfrBinaryValue.cs プロジェクト: xmcy0011/NanUI
 /// <summary>
 /// Read up to |bufferSize| number of bytes into |buffer|. Reading begins at
 /// the specified byte |dataOffset|. Returns the number of bytes read.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
 /// </remarks>
 public int GetData(RemotePtr buffer, int bufferSize, int dataOffset)
 {
     var call = new CfxBinaryValueGetDataRenderProcessCall();
     call.self = CfrObject.Unwrap(this);
     call.buffer = buffer.ptr;
     call.bufferSize = bufferSize;
     call.dataOffset = dataOffset;
     call.RequestExecution(this);
     return call.__retval;
 }
コード例 #33
0
ファイル: CfrBinaryValue.cs プロジェクト: xmcy0011/NanUI
 /// <summary>
 /// Creates a new object that is not owned by any other object. The specified
 /// |data| will be copied.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_values_capi.h">cef/include/capi/cef_values_capi.h</see>.
 /// </remarks>
 public static CfrBinaryValue Create(RemotePtr data, int dataSize)
 {
     var call = new CfxBinaryValueCreateRenderProcessCall();
     call.data = data.ptr;
     call.dataSize = dataSize;
     call.RequestExecution(CfxRemoteCallContext.CurrentContext.connection);
     return CfrBinaryValue.Wrap(call.__retval);
 }
コード例 #34
0
ファイル: CfrPostDataElement.cs プロジェクト: xmcy0011/NanUI
 /// <summary>
 /// The post data element will represent bytes.  The bytes passed in will be
 /// copied.
 /// </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 void SetToBytes(int size, RemotePtr bytes)
 {
     var call = new CfxPostDataElementSetToBytesRenderProcessCall();
     call.self = CfrObject.Unwrap(this);
     call.size = size;
     call.bytes = bytes.ptr;
     call.RequestExecution(this);
 }