fix: switch to mojo proxy resolver (3-1-x) (#15813)

This commit is contained in:
Robo 2018-11-27 05:08:33 +05:30 committed by Michelle Tilley
parent d5a6bb665b
commit 4abf55801f
65 changed files with 1838 additions and 1797 deletions

View file

@ -166,8 +166,8 @@ void CommonWebContentsDelegate::InitWithWebContents(
!web_preferences || web_preferences->IsEnabled(options::kOffscreen);
// Create InspectableWebContents.
web_contents_.reset(
brightray::InspectableWebContents::Create(web_contents, is_guest));
web_contents_.reset(brightray::InspectableWebContents::Create(
web_contents, browser_context->prefs(), is_guest));
web_contents_->SetDelegate(this);
}
@ -194,8 +194,17 @@ void CommonWebContentsDelegate::SetOwnerWindow(
void CommonWebContentsDelegate::ResetManagedWebContents(bool async) {
if (async) {
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE,
web_contents_.release());
// Browser context should be destroyed only after the WebContents,
// this is guaranteed in the sync mode by the order of declaration,
// in the async version we maintain a reference until the WebContents
// is destroyed.
base::ThreadTaskRunnerHandle::Get()->PostNonNestableTask(
FROM_HERE,
base::BindOnce([](scoped_refptr<AtomBrowserContext> browser_context,
std::unique_ptr<brightray::InspectableWebContents>
web_contents) { web_contents.reset(); },
base::RetainedRef(browser_context_),
std::move(web_contents_)));
} else {
web_contents_.reset();
}