public ScreenshotCore(ICefConfig cefConfig, ILoggingService loggingService) { this.cefConfig = cefConfig; this.loggingService = loggingService; this.lastPaintTimeStamp = DateTime.UtcNow; this.isDisposed = false; this.client = new ScreenshotCefClient(this, cefConfig.ScreenshotWidth, cefConfig.ScreenshotHeight, loggingService); this.initializedCompletionSource = new TaskCompletionSource <bool>(); this.screenshotQueue = new BlockingCollection <ScreenshotRequestContext>(); this.buffer = new byte[cefConfig.ScreenshotHeight * cefConfig.ScreenshotWidth * 4]; bufferGcHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned); this.screenshotWorkerCancellationSource = new CancellationTokenSource(); Task.Factory.StartNew(() => ScreenshotWorker(this.screenshotWorkerCancellationSource.Token), TaskCreationOptions.LongRunning); }
public ScreenshotCore(ICefConfig cefConfig, ILoggingService loggingService) { this.cefConfig = cefConfig; this.loggingService = loggingService; this.lastPaintTimeStamp = DateTime.UtcNow; this.isDisposed = false; this.client = new ScreenshotCefClient(this, cefConfig.ScreenshotWidth, cefConfig.ScreenshotHeight, loggingService); this.initializedCompletionSource = new TaskCompletionSource<bool>(); this.screenshotQueue = new BlockingCollection<ScreenshotRequestContext>(); this.buffer = new byte[cefConfig.ScreenshotHeight * cefConfig.ScreenshotWidth * 4]; bufferGcHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned); this.screenshotWorkerCancellationSource = new CancellationTokenSource(); Task.Factory.StartNew(() => ScreenshotWorker(this.screenshotWorkerCancellationSource.Token), TaskCreationOptions.LongRunning); }
public PageTrackerCefApp(ICefConfig cefConfig, ILoggingService loggingService) { this.loggingService = loggingService; this.isInitialized = false; this.isDisposed = false; this.browser = new Lazy <ScreenshotCore>( () => { var cefWindowInfo = CefWindowInfo.Create(); cefWindowInfo.SetAsWindowless(IntPtr.Zero, true); var webBrowser = new ScreenshotCore(cefConfig, loggingService); webBrowser.Create(cefWindowInfo).Wait(); return(webBrowser); }, false); }
public PageTrackerCefApp(ICefConfig cefConfig, ILoggingService loggingService) { this.loggingService = loggingService; this.isInitialized = false; this.isDisposed = false; this.browser = new Lazy<ScreenshotCore>( () => { var cefWindowInfo = CefWindowInfo.Create(); cefWindowInfo.SetAsWindowless(IntPtr.Zero, true); var webBrowser = new ScreenshotCore(cefConfig, loggingService); webBrowser.Create(cefWindowInfo).Wait(); return webBrowser; }, false); }
public SubProcessService(ICefConfig cefConfig, ILoggingService loggingService) { this.cef = new PageTrackerCefApp(cefConfig, loggingService); }
public PageTrackerService(ICefConfig cefConfig, ILoggingService loggingService) { this.loggingService = loggingService; this.cef = new PageTrackerCefApp(cefConfig, loggingService); this.cef.Initialize(false); }