WebContents may be managed by multiple owners
This commit is contained in:
parent
300c7a4b04
commit
595b0663b2
2 changed files with 12 additions and 9 deletions
|
@ -59,17 +59,15 @@ WebContentsView::WebContentsView(v8::Isolate* isolate,
|
|||
set_delete_view(false);
|
||||
#endif
|
||||
WebContentsViewRelay::CreateForWebContents(web_contents->web_contents());
|
||||
api_web_contents_->AddObserver(this);
|
||||
Observe(web_contents->web_contents());
|
||||
}
|
||||
|
||||
WebContentsView::~WebContentsView() {
|
||||
if (api_web_contents_) {
|
||||
api_web_contents_->RemoveObserver(this);
|
||||
if (api_web_contents_)
|
||||
api_web_contents_->DestroyWebContents(false /* async */);
|
||||
}
|
||||
}
|
||||
|
||||
void WebContentsView::OnCloseContents() {
|
||||
void WebContentsView::WebContentsDestroyed() {
|
||||
api_web_contents_ = nullptr;
|
||||
web_contents_.Reset();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue