Use BuildPrototype to build prototype
This saves the step of manually keeping the global template object, which is easy to forget then leak.
This commit is contained in:
parent
6795bd1d96
commit
a15f9fab5b
10 changed files with 148 additions and 126 deletions
|
@ -135,9 +135,10 @@ void DownloadItem::Cancel() {
|
|||
download_item_->Cancel(true);
|
||||
}
|
||||
|
||||
mate::ObjectTemplateBuilder DownloadItem::GetObjectTemplateBuilder(
|
||||
v8::Isolate* isolate) {
|
||||
return mate::ObjectTemplateBuilder(isolate)
|
||||
// static
|
||||
void DownloadItem::BuildPrototype(v8::Isolate* isolate,
|
||||
v8::Local<v8::ObjectTemplate> prototype) {
|
||||
mate::ObjectTemplateBuilder(isolate, prototype)
|
||||
.MakeDestroyable()
|
||||
.SetMethod("pause", &DownloadItem::Pause)
|
||||
.SetMethod("resume", &DownloadItem::Resume)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue