diff --git a/shell/browser/web_dialog_helper.cc b/shell/browser/web_dialog_helper.cc index 0d3c84cc0ae1..90db26e6f40a 100644 --- a/shell/browser/web_dialog_helper.cc +++ b/shell/browser/web_dialog_helper.cc @@ -64,16 +64,12 @@ class FileSelectHelper : public base::RefCounted, void ShowSaveDialog(const file_dialog::DialogSettings& settings) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); - v8::Local context = isolate->GetCurrentContext(); electron::util::Promise promise(isolate); - v8::Local handle = promise.GetHandle(); + + auto callback = base::BindOnce(&FileSelectHelper::OnSaveDialogDone, this); + ignore_result(promise.Then(std::move(callback))); file_dialog::ShowSaveDialog(settings, std::move(promise)); - ignore_result(handle->Then( - context, - v8::Local::Cast(mate::ConvertToV8( - isolate, - base::BindOnce(&FileSelectHelper::OnSaveDialogDone, this))))); } private: