Skip to content

Commit

Permalink
build: fix build with enable_printing=false (#27456)
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak authored and Milan Burda committed Jan 27, 2021
1 parent 70526f8 commit 739eec7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions shell/browser/api/electron_api_web_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,9 @@ WebContents::WebContents(v8::Isolate* isolate,
: content::WebContentsObserver(web_contents),
type_(Type::REMOTE),
id_(GetAllWebContents().Add(this)),
#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.
Expand Down Expand Up @@ -512,7 +514,9 @@ WebContents::WebContents(v8::Isolate* isolate,
: content::WebContentsObserver(web_contents.get()),
type_(type),
id_(GetAllWebContents().Add(this)),
#if BUILDFLAG(ENABLE_PRINTING)
print_task_runner_(CreatePrinterHandlerTaskRunner()),
#endif
weak_factory_(this) {
DCHECK(type != Type::REMOTE)
<< "Can't take ownership of a remote WebContents";
Expand All @@ -525,7 +529,9 @@ WebContents::WebContents(v8::Isolate* isolate,
WebContents::WebContents(v8::Isolate* isolate,
const gin_helper::Dictionary& options)
: id_(GetAllWebContents().Add(this)),
#if BUILDFLAG(ENABLE_PRINTING)
print_task_runner_(CreatePrinterHandlerTaskRunner()),
#endif
weak_factory_(this) {
// Read options.
options.Get("backgroundThrottling", &background_throttling_);
Expand Down
2 changes: 2 additions & 0 deletions shell/browser/api/electron_api_web_contents.h
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,9 @@ class WebContents : public gin::Wrappable<WebContents>,

bool initially_shown_ = true;

#if BUILDFLAG(ENABLE_PRINTING)
scoped_refptr<base::TaskRunner> print_task_runner_;
#endif

service_manager::BinderRegistryWithArgs<content::RenderFrameHost*> registry_;
mojo::ReceiverSet<mojom::ElectronBrowser, content::RenderFrameHost*>
Expand Down

0 comments on commit 739eec7

Please sign in to comment.