зеркало из https://github.com/electron/electron.git
destroy guest webcontents before embedder
This commit is contained in:
Родитель
16f9754445
Коммит
72adbf7a2f
|
@ -411,14 +411,18 @@ WebContents::~WebContents() {
|
|||
if (type_ == WEB_VIEW)
|
||||
guest_delegate_->Destroy();
|
||||
|
||||
// The WebContentsDestroyed will not be called automatically because we
|
||||
// unsubscribe from webContents before destroying it. So we have to manually
|
||||
// call it here to make sure "destroyed" event is emitted.
|
||||
RenderViewDeleted(web_contents()->GetRenderViewHost());
|
||||
WebContentsDestroyed();
|
||||
DestroyWebContents();
|
||||
}
|
||||
}
|
||||
|
||||
void WebContents::DestroyWebContents() {
|
||||
// This event is only for internal use, which is emitted when WebContents is
|
||||
// being destroyed.
|
||||
Emit("will-destroy");
|
||||
CommonWebContentsDelegate::DestroyWebContents();
|
||||
}
|
||||
|
||||
bool WebContents::DidAddMessageToConsole(content::WebContents* source,
|
||||
int32_t level,
|
||||
const base::string16& message,
|
||||
|
@ -919,10 +923,6 @@ bool WebContents::OnMessageReceived(const IPC::Message& message) {
|
|||
// be destroyed on close, and WebContentsDestroyed would be called for it, so
|
||||
// we need to make sure the api::WebContents is also deleted.
|
||||
void WebContents::WebContentsDestroyed() {
|
||||
// This event is only for internal use, which is emitted when WebContents is
|
||||
// being destroyed.
|
||||
Emit("will-destroy");
|
||||
|
||||
// Cleanup relationships with other parts.
|
||||
RemoveFromWeakMap();
|
||||
|
||||
|
|
|
@ -76,6 +76,9 @@ class WebContents : public mate::TrackableObject<WebContents>,
|
|||
static void BuildPrototype(v8::Isolate* isolate,
|
||||
v8::Local<v8::FunctionTemplate> prototype);
|
||||
|
||||
// Notifies to destroy any guest web contents before destroying self.
|
||||
void DestroyWebContents();
|
||||
|
||||
int64_t GetID() const;
|
||||
int GetProcessID() const;
|
||||
Type GetType() const;
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit d0144ba2c9024d65cdf260abf5c03c742afff3fd
|
||||
Subproject commit 53aa2cfc8a40627d62bf5be757ff9dea444f80bd
|
Загрузка…
Ссылка в новой задаче