public override void OnBrowserCreated(CefBrowserBase cefBrowserWrapper)
        {
            browser = cefBrowserWrapper;

            if (parentProcessId == null)
            {
                return;
            }

            Task.Factory.StartNew(() => javascriptServiceHost = SubProcessServiceHost.Create(parentProcessId.Value, cefBrowserWrapper.BrowserId));
        }
Exemple #2
0
        public override void OnBrowserCreated(CefBrowserBase cefBrowserWrapper)
        {
            browser = cefBrowserWrapper;

            if (ParentProcessId == null)
            {
                return;
            }

            Task.Factory.StartNew(() => javascriptServiceHost = SubProcessServiceHost.Create(ParentProcessId.Value, cefBrowserWrapper.BrowserId));
        }
        public static SubProcessServiceHost Create(int parentProcessId, int browserId)
        {
            var host = new SubProcessServiceHost();
            AddDebugBehavior(host);

            //use absolute address for hosting 
            //http://stackoverflow.com/questions/10362246/two-unique-named-pipes-conflicting-and-invalidcredentialexception
            var serviceName = SubProcessProxySupport.GetServiceName(parentProcessId, browserId);

            KillExistingServiceIfNeeded(serviceName);

            Kernel32.OutputDebugString("Setting up IJavascriptProxy using service name: " + serviceName);
            host.AddServiceEndpoint(
                typeof(ISubProcessProxy),
                new NetNamedPipeBinding(),
                new Uri(serviceName)
            );

            host.Open();
            return host;
        }
        public static SubProcessServiceHost Create(int parentProcessId, int browserId)
        {
            var host = new SubProcessServiceHost();

            AddDebugBehavior(host);

            //use absultadress for hosting
            //http://stackoverflow.com/questions/10362246/two-unique-named-pipes-conflicting-and-invalidcredentialexception
            var serviceName = SubProcessProxySupport.GetServiceName(parentProcessId, browserId);

            KillExistingServiceIfNeeded(serviceName);

            Kernel32.OutputDebugString("Setting up IJavascriptProxy using service name: " + serviceName);
            host.AddServiceEndpoint(
                typeof(ISubProcessProxy),
                new NetNamedPipeBinding(),
                new Uri(serviceName)
                );

            host.Open();
            return(host);
        }