build: fix build with enable_printing=false (#27456) (#27505)

This commit is contained in:
Milan Burda
2021-01-27 08:35:38 +01:00
committed by GitHub
parent a5a6f12e1d
commit 13a0757acb
2 changed files with 10 additions and 1 deletions

View File

@@ -452,7 +452,9 @@ WebContents::WebContents(v8::Isolate* isolate,
content::WebContents* web_contents)
: content::WebContentsObserver(web_contents),
type_(Type::REMOTE),
#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.
@@ -487,7 +489,9 @@ WebContents::WebContents(v8::Isolate* isolate,
Type type)
: content::WebContentsObserver(web_contents.get()),
type_(type),
#if BUILDFLAG(ENABLE_PRINTING)
print_task_runner_(CreatePrinterHandlerTaskRunner()),
#endif
weak_factory_(this) {
DCHECK(type != Type::REMOTE)
<< "Can't take ownership of a remote WebContents";
@@ -499,7 +503,10 @@ WebContents::WebContents(v8::Isolate* isolate,
WebContents::WebContents(v8::Isolate* isolate,
const gin_helper::Dictionary& options)
: print_task_runner_(CreatePrinterHandlerTaskRunner()),
:
#if BUILDFLAG(ENABLE_PRINTING)
print_task_runner_(CreatePrinterHandlerTaskRunner()),
#endif
weak_factory_(this) {
// Read options.
options.Get("backgroundThrottling", &background_throttling_);

View File

@@ -656,7 +656,9 @@ class WebContents : public gin_helper::TrackableObject<WebContents>,
// -1 means no speculative RVH has been committed yet.
int currently_committed_process_id_ = -1;
#if BUILDFLAG(ENABLE_PRINTING)
scoped_refptr<base::TaskRunner> print_task_runner_;
#endif
service_manager::BinderRegistryWithArgs<content::RenderFrameHost*> registry_;
mojo::ReceiverSet<mojom::ElectronBrowser, content::RenderFrameHost*>