From 2b31d8459dc4343b78efd082292f6b48e089a111 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Thu, 27 Jun 2024 10:23:18 +0200 Subject: [PATCH] fix: param passed to `showSaveDialogSync` on Linux (#42652) fix: pass correct param to sync functions on Linux --- shell/browser/ui/file_dialog_linux.cc | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/shell/browser/ui/file_dialog_linux.cc b/shell/browser/ui/file_dialog_linux.cc index 59ca22520ff5..7ba59eacbbb3 100644 --- a/shell/browser/ui/file_dialog_linux.cc +++ b/shell/browser/ui/file_dialog_linux.cc @@ -208,9 +208,6 @@ class FileChooserDialog : public ui::SelectFileDialog::Listener { bool ShowOpenDialogSync(const DialogSettings& settings, std::vector* paths) { - v8::Isolate* isolate = electron::JavascriptEnvironment::GetIsolate(); - gin_helper::Promise promise(isolate); - base::RunLoop run_loop(base::RunLoop::Type::kNestableTasksAllowed); auto cb = base::BindOnce( [](base::RepeatingClosure cb, std::vector* file_paths, @@ -222,7 +219,6 @@ bool ShowOpenDialogSync(const DialogSettings& settings, FileChooserDialog* dialog = new FileChooserDialog(); dialog->RunOpenDialog(std::move(cb), settings); - run_loop.Run(); return !paths->empty(); } @@ -235,8 +231,6 @@ void ShowOpenDialog(const DialogSettings& settings, bool ShowSaveDialogSync(const DialogSettings& settings, base::FilePath* path) { base::RunLoop run_loop(base::RunLoop::Type::kNestableTasksAllowed); - v8::Isolate* isolate = electron::JavascriptEnvironment::GetIsolate(); - gin_helper::Promise promise(isolate); auto cb = base::BindOnce( [](base::RepeatingClosure cb, base::FilePath* file_path, gin_helper::Dictionary result) { @@ -246,7 +240,7 @@ bool ShowSaveDialogSync(const DialogSettings& settings, base::FilePath* path) { run_loop.QuitClosure(), path); FileChooserDialog* dialog = new FileChooserDialog(); - dialog->RunSaveDialog(std::move(promise), settings); + dialog->RunSaveDialog(std::move(cb), settings); run_loop.Run(); return !path->empty(); }