示例#1
0
 internal static CfxResponse Wrap(IntPtr nativePtr)
 {
     if (nativePtr == IntPtr.Zero)
     {
         return(null);
     }
     lock (weakCache) {
         var wrapper = (CfxResponse)weakCache.Get(nativePtr);
         if (wrapper == null)
         {
             wrapper = new CfxResponse(nativePtr);
             weakCache.Add(wrapper);
         }
         else
         {
             CfxApi.cfx_release(nativePtr);
         }
         return(wrapper);
     }
 }
示例#2
0
 /// <summary>
 /// Create a new CfxResponse object.
 /// </summary>
 /// <remarks>
 /// See also the original CEF documentation in
 /// <see href="https://bitbucket.org/chromiumfx/chromiumfx/src/tip/cef/include/capi/cef_response_capi.h">cef/include/capi/cef_response_capi.h</see>.
 /// </remarks>
 public static CfxResponse Create()
 {
     return(CfxResponse.Wrap(CfxApi.Response.cfx_response_create()));
 }
示例#3
0
 internal static CfxResponse Wrap(IntPtr nativePtr)
 {
     if(nativePtr == IntPtr.Zero) return null;
     lock(weakCache) {
         var wrapper = (CfxResponse)weakCache.Get(nativePtr);
         if(wrapper == null) {
             wrapper = new CfxResponse(nativePtr);
             weakCache.Add(wrapper);
         } else {
             CfxApi.cfx_release(nativePtr);
         }
         return wrapper;
     }
 }