internal static CfxV8StackTrace Wrap(IntPtr nativePtr) { if (nativePtr == IntPtr.Zero) { return(null); } lock (weakCache) { var wrapper = (CfxV8StackTrace)weakCache.Get(nativePtr); if (wrapper == null) { wrapper = new CfxV8StackTrace(nativePtr); weakCache.Add(wrapper); } else { CfxApi.cfx_release(nativePtr); } return(wrapper); } }
/// <summary> /// Returns the stack trace for the currently active context. |frameLimit| is /// the maximum number of frames that will be captured. /// </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 static CfxV8StackTrace GetCurrent(int frameLimit) { return(CfxV8StackTrace.Wrap(CfxApi.V8StackTrace.cfx_v8stack_trace_get_current(frameLimit))); }
internal static CfxV8StackTrace Wrap(IntPtr nativePtr) { if(nativePtr == IntPtr.Zero) return null; lock(weakCache) { var wrapper = (CfxV8StackTrace)weakCache.Get(nativePtr); if(wrapper == null) { wrapper = new CfxV8StackTrace(nativePtr); weakCache.Add(wrapper); } else { CfxApi.cfx_release(nativePtr); } return wrapper; } }