Beispiel #1
0
        public RekoBrowserGlobals(
            PendingPromisesRepository pendingPromises,
            EventListenersRepository eventListeners,
            ServiceContainer services,
            IDecompiler decompiler,
            CefV8Context context
            )
        {
            this.pendingPromises = pendingPromises;
            this.eventListeners  = eventListeners;
            this.services        = services;
            this.decompiler      = decompiler;
            this.context         = context;
            CefPromiseFactory promiseFactory = CreatePromiseFactory();

            this.promiseFactory = promiseFactory;
        }
Beispiel #2
0
        /// <summary>
        /// Creates a "createPromise" function on the JS side.
        /// </summary>
        private CefPromiseFactory CreatePromiseFactory()
        {
            context.Enter();
            context.GetFrame().ExecuteJavaScript(@"
                window.createPromise = function (fn) {
                    return new Promise(fn);
                };
                ", null, 1);

            var global           = context.GetGlobal();
            var promiseFactoryFn = global.GetValue("createPromise");

            var promiseFactory = new CefPromiseFactory(promiseFactoryFn);

            context.Exit();
            return(promiseFactory);
        }
 public AsyncHandlerProxy(Delegate func, CefPromiseFactory promiseFactory)
 {
     this.func           = func;
     this.promiseFactory = promiseFactory;
 }
Beispiel #4
0
 public OpenFileHandler(CefPromiseFactory promiseFactory, PendingPromisesRepository pendingPromises)
 {
     this.promiseFactory  = promiseFactory;
     this.pendingPromises = pendingPromises;
 }