perf: use type-utils for desktopCapturer.getSources() result serialization (#23549)

This commit is contained in:
Milan Burda 2020-05-13 19:05:53 +02:00 committed by GitHub
parent 508c7ac4f9
commit 85fae67966
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 22 deletions

View file

@ -49,6 +49,8 @@ struct Converter<electron::api::DesktopCapturer::Source> {
"appIcon",
electron::api::NativeImage::Create(
isolate, gfx::Image(GetWindowIcon(source.media_list_source.id))));
} else {
dict.Set("appIcon", nullptr);
}
return ConvertToV8(isolate, dict);
}
@ -191,8 +193,7 @@ void DesktopCapturer::UpdateSourcesList(DesktopMediaList* list) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();
v8::Locker locker(isolate);
v8::HandleScope scope(isolate);
gin_helper::CallMethod(this, "_onfinished", captured_sources_,
fetch_window_icons_);
gin_helper::CallMethod(this, "_onfinished", captured_sources_);
}
}