Exemplo n.º 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)));
        }
Exemplo n.º 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)));
        }
Exemplo n.º 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);
            }
        }