diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index f704202228e..88d533a323e 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -618,7 +618,9 @@ WebContents::WebContents(v8::Isolate* isolate, devtools_file_system_indexer_(new DevToolsFileSystemIndexer), file_task_runner_( base::ThreadPool::CreateSequencedTaskRunner({base::MayBlock()})), +#if BUILDFLAG(ENABLE_PRINTING) print_task_runner_(CreatePrinterHandlerTaskRunner()), +#endif weak_factory_(this) { #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) // WebContents created by extension host will have valid ViewType set. @@ -652,7 +654,9 @@ WebContents::WebContents(v8::Isolate* isolate, devtools_file_system_indexer_(new DevToolsFileSystemIndexer), file_task_runner_( base::ThreadPool::CreateSequencedTaskRunner({base::MayBlock()})), +#if BUILDFLAG(ENABLE_PRINTING) print_task_runner_(CreatePrinterHandlerTaskRunner()), +#endif weak_factory_(this) { DCHECK(type != Type::kRemote) << "Can't take ownership of a remote WebContents"; @@ -668,7 +672,9 @@ WebContents::WebContents(v8::Isolate* isolate, devtools_file_system_indexer_(new DevToolsFileSystemIndexer), file_task_runner_( base::ThreadPool::CreateSequencedTaskRunner({base::MayBlock()})), +#if BUILDFLAG(ENABLE_PRINTING) print_task_runner_(CreatePrinterHandlerTaskRunner()), +#endif weak_factory_(this) { // Read options. options.Get("backgroundThrottling", &background_throttling_); diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index 9f022bf08a6..7a2bb4f4839 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -777,7 +777,10 @@ class WebContents : public gin::Wrappable, DevToolsIndexingJobsMap devtools_indexing_jobs_; scoped_refptr file_task_runner_; + +#if BUILDFLAG(ENABLE_PRINTING) scoped_refptr print_task_runner_; +#endif // Stores the frame thats currently in fullscreen, nullptr if there is none. content::RenderFrameHost* fullscreen_frame_ = nullptr;