From fb47716885d6c68f32296e99f573e4c979b89026 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Sun, 24 Nov 2024 13:03:09 -0600 Subject: [PATCH] fix: remove unused local variables (#44821) * chore: remove unused local non-trivial variable relaunch_executable became unused in June 2016 in 0d066de5 Co-authored-by: Charles Kerr * chore: only declare program_name local variable if used We declared it everywhere but only used it on Windows Co-authored-by: Charles Kerr * chore: remove unused local non-trivial variable path from UnregisterXWindow it became unused in 2020 by 72a08926 Co-authored-by: Charles Kerr --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr --- shell/browser/api/electron_api_app.cc | 3 +-- shell/browser/relauncher.cc | 1 - shell/browser/ui/views/global_menu_bar_registrar_x11.cc | 1 - 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/shell/browser/api/electron_api_app.cc b/shell/browser/api/electron_api_app.cc index 09c5d1bbffb..e972f9f0346 100644 --- a/shell/browser/api/electron_api_app.cc +++ b/shell/browser/api/electron_api_app.cc @@ -1009,8 +1009,6 @@ bool App::RequestSingleInstanceLock(gin::Arguments* args) { if (HasSingleInstanceLock()) return true; - std::string program_name = electron::Browser::Get()->GetName(); - base::FilePath user_dir; base::PathService::Get(chrome::DIR_USER_DATA, &user_dir); // The user_dir may not have been created yet. @@ -1021,6 +1019,7 @@ bool App::RequestSingleInstanceLock(gin::Arguments* args) { blink::CloneableMessage additional_data_message; args->GetNext(&additional_data_message); #if BUILDFLAG(IS_WIN) + const std::string program_name = electron::Browser::Get()->GetName(); bool app_is_sandboxed = IsSandboxEnabled(base::CommandLine::ForCurrentProcess()); process_singleton_ = std::make_unique( diff --git a/shell/browser/relauncher.cc b/shell/browser/relauncher.cc index ed22f0d1700..cdd1206cd92 100644 --- a/shell/browser/relauncher.cc +++ b/shell/browser/relauncher.cc @@ -157,7 +157,6 @@ int RelauncherMain(const content::MainFunctionParams& main_parameters) { // Figure out what to execute, what arguments to pass it, and whether to // start it in the background. bool in_relauncher_args = false; - StringType relaunch_executable; StringVector relauncher_args; StringVector launch_argv; for (size_t argv_index = 2; argv_index < argv.size(); ++argv_index) { diff --git a/shell/browser/ui/views/global_menu_bar_registrar_x11.cc b/shell/browser/ui/views/global_menu_bar_registrar_x11.cc index df3428b34b0..31ac3a4959c 100644 --- a/shell/browser/ui/views/global_menu_bar_registrar_x11.cc +++ b/shell/browser/ui/views/global_menu_bar_registrar_x11.cc @@ -80,7 +80,6 @@ void GlobalMenuBarRegistrarX11::RegisterXWindow(x11::Window window) { void GlobalMenuBarRegistrarX11::UnregisterXWindow(x11::Window window) { DCHECK(registrar_proxy_); - std::string path = electron::GlobalMenuBarX11::GetPathForWindow(window); ANNOTATE_SCOPED_MEMORY_LEAK; // http://crbug.com/314087 // TODO(erg): The mozilla implementation goes to a lot of callback trouble