Exemplo n.º 1
0
        /// <summary>
        ///     TTD API -- may change in future versions:
        ///     Creates a new runtime in Debug Mode.
        /// </summary>
        /// <param name="attributes">The attributes of the runtime to be created.</param>
        /// <param name="infoUri">The uri where the recorded Time-Travel data should be loaded from.</param>
        /// <param name="enableDebugging">A flag to enable additional debugging operation support during replay.</param>
        /// <param name="openResourceStream">The <c>TTDOpenResourceStreamCallback</c> function for generating a JsTTDStreamHandle to read/write serialized data.</param>
        /// <param name="readBytesFromStream">The <c>JsTTDReadBytesFromStreamCallback</c> function for reading bytes from a JsTTDStreamHandle.</param>
        /// <param name="flushAndCloseStream">The <c>JsTTDFlushAndCloseStreamCallback</c> function for flushing and closing a JsTTDStreamHandle as needed.</param>
        /// <param name="threadService">The thread service for the runtime. Can be null.</param>
        /// <remarks>
        ///     <para>See <c>JsCreateRuntime</c> for additional information.</para>
        /// </remarks>
        /// <returns>
        ///     The runtime created.
        /// </returns>
        public static JavaScriptRuntime TTDCreateReplayRuntime(
            JavaScriptRuntimeAttributes attributes,
            string infoUri,
            UIntPtr infoUriCount,
            bool enableDebugging,
            TTDOpenResourceStreamCallback openResourceStream,
            JavaScriptTTDReadBytesFromStreamCallback readBytesFromStream,
            JavaScriptTTDFlushAndCloseStreamCallback flushAndCloseStream,
            JavaScriptThreadServiceCallback threadService
            )
        {
            JavaScriptRuntime runtime;

            Native.ThrowIfError(
                Native.JsTTDCreateReplayRuntime(
                    attributes,
                    infoUri,
                    infoUriCount,
                    enableDebugging,
                    openResourceStream,
                    readBytesFromStream,
                    flushAndCloseStream,
                    threadService,
                    out runtime
                    )
                );
            return(runtime);
        }
Exemplo n.º 2
0
        // Time Travel Debugging

        /// <summary>
        ///     TTD API -- may change in future versions:
        ///     Creates a new runtime in Record Mode.
        /// </summary>
        /// <param name="attributes">The attributes of the runtime to be created.</param>
        /// <param name="enableDebugging">A flag to enable debugging during record.</param>
        /// <param name="snapInterval">The interval to wait between snapshots (measured in millis).</param>
        /// <param name="snapHistoryLength">The amount of history to maintain before discarding -- measured in number of snapshots and controls how far back in time a trace can be reversed.</param>
        /// <param name="openResourceStream">The <c>TTDOpenResourceStreamCallback</c> function for generating a JsTTDStreamHandle to read/write serialized data.</param>
        /// <param name="writeBytesToStream">The <c>JsTTDWriteBytesToStreamCallback</c> function for writing bytes to a JsTTDStreamHandle.</param>
        /// <param name="flushAndCloseStream">The <c>JsTTDFlushAndCloseStreamCallback</c> function for flushing and closing a JsTTDStreamHandle as needed.</param>
        /// <param name="threadService">The thread service for the runtime. Can be null.</param>
        /// <remarks>
        ///     <para>See <c>JsCreateRuntime</c> for additional information.</para>
        /// </remarks>
        /// <returns>
        ///     The runtime created.
        /// </returns>
        public static JavaScriptRuntime TTDCreateRecordRuntime(
            JavaScriptRuntimeAttributes attributes,
            bool enableDebugging,
            UIntPtr snapInterval,
            UIntPtr snapHistoryLength,
            TTDOpenResourceStreamCallback openResourceStream,
            JavaScriptTTDWriteBytesToStreamCallback writeBytesToStream,
            JavaScriptTTDFlushAndCloseStreamCallback flushAndCloseStream,
            JavaScriptThreadServiceCallback threadService
            )
        {
            JavaScriptRuntime runtime;

            Native.ThrowIfError(
                Native.JsTTDCreateRecordRuntime(
                    attributes,
                    enableDebugging,
                    snapInterval,
                    snapHistoryLength,
                    openResourceStream,
                    writeBytesToStream,
                    flushAndCloseStream,
                    threadService,
                    out runtime
                    )
                );
            return(runtime);
        }