refactor: make util::Promise type safe when chaining in native (#19809)
* refactor: make util::Promise type safe when chaining in native * fixup! refactor: make util::Promise type safe when chaining in native * chore: remove spare brackets
This commit is contained in:
parent
f7e3e1f97a
commit
6a3922d330
39 changed files with 275 additions and 343 deletions
|
@ -54,7 +54,7 @@ class FileSelectHelper : public base::RefCounted<FileSelectHelper>,
|
|||
|
||||
void ShowOpenDialog(const file_dialog::DialogSettings& settings) {
|
||||
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
||||
electron::util::Promise promise(isolate);
|
||||
electron::util::Promise<mate::Dictionary> promise(isolate);
|
||||
|
||||
auto callback = base::BindOnce(&FileSelectHelper::OnOpenDialogDone, this);
|
||||
ignore_result(promise.Then(std::move(callback)));
|
||||
|
@ -65,7 +65,7 @@ class FileSelectHelper : public base::RefCounted<FileSelectHelper>,
|
|||
void ShowSaveDialog(const file_dialog::DialogSettings& settings) {
|
||||
v8::Isolate* isolate = v8::Isolate::GetCurrent();
|
||||
v8::Local<v8::Context> context = isolate->GetCurrentContext();
|
||||
electron::util::Promise promise(isolate);
|
||||
electron::util::Promise<mate::Dictionary> promise(isolate);
|
||||
v8::Local<v8::Promise> handle = promise.GetHandle();
|
||||
|
||||
file_dialog::ShowSaveDialog(settings, std::move(promise));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue