Add isDestroyed method for classes with destroy method
This commit is contained in:
parent
ed1f9989b0
commit
9a20b33d97
5 changed files with 4 additions and 13 deletions
|
@ -604,10 +604,6 @@ void WebContents::Destroy() {
|
|||
}
|
||||
}
|
||||
|
||||
bool WebContents::IsAlive() const {
|
||||
return web_contents() != NULL;
|
||||
}
|
||||
|
||||
int WebContents::GetID() const {
|
||||
return web_contents()->GetRenderProcessHost()->GetID();
|
||||
}
|
||||
|
@ -996,7 +992,7 @@ mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder(
|
|||
if (template_.IsEmpty())
|
||||
template_.Reset(isolate, mate::ObjectTemplateBuilder(isolate)
|
||||
.SetMethod("destroy", &WebContents::Destroy, true)
|
||||
.SetMethod("isAlive", &WebContents::IsAlive, true)
|
||||
.SetMethod("isDestroyed", &WebContents::IsDestroyed, true)
|
||||
.SetMethod("getId", &WebContents::GetID)
|
||||
.SetMethod("equal", &WebContents::Equal)
|
||||
.SetMethod("_loadURL", &WebContents::LoadURL)
|
||||
|
@ -1066,7 +1062,7 @@ mate::ObjectTemplateBuilder WebContents::GetObjectTemplateBuilder(
|
|||
}
|
||||
|
||||
bool WebContents::IsDestroyed() const {
|
||||
return !IsAlive();
|
||||
return !web_contents();
|
||||
}
|
||||
|
||||
AtomBrowserContext* WebContents::GetBrowserContext() const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue