コード例 #1
0
        /// <summary>
        /// Returns the global resource bundle instance.
        /// </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 static CfrResourceBundle GetGlobal()
        {
            var call = new CfxResourceBundleGetGlobalRemoteCall();

            call.RequestExecution();
            return(CfrResourceBundle.Wrap(new RemotePtr(call.__retval)));
        }
コード例 #2
0
        /// <summary>
        /// Returns the global resource bundle instance.
        /// </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 static CfrResourceBundle GetGlobal()
        {
            var connection = CfxRemoteCallContext.CurrentContext.connection;
            var call       = new CfxResourceBundleGetGlobalRemoteCall();

            call.RequestExecution(connection);
            return(CfrResourceBundle.Wrap(new RemotePtr(connection, call.__retval)));
        }
コード例 #3
0
        internal static CfrResourceBundle Wrap(RemotePtr remotePtr)
        {
            if (remotePtr == RemotePtr.Zero)
            {
                return(null);
            }
            var weakCache = CfxRemoteCallContext.CurrentContext.connection.weakCache;

            lock (weakCache) {
                var cfrObj = (CfrResourceBundle)weakCache.Get(remotePtr.ptr);
                if (cfrObj == null)
                {
                    cfrObj = new CfrResourceBundle(remotePtr);
                    weakCache.Add(remotePtr.ptr, cfrObj);
                }
                return(cfrObj);
            }
        }