Skip to content

Commit

Permalink
fix: remove unused local variables (electron#44815)
Browse files Browse the repository at this point in the history
* chore: remove unused local non-trivial variable relaunch_executable

became unused in June 2016 in 0d066de

* chore: only declare program_name local variable if used

We declared it everywhere but only used it on Windows

* chore: remove unused local non-trivial variable path from UnregisterXWindow

it became unused in 2020 by 72a0892
  • Loading branch information
ckerr authored Nov 23, 2024
1 parent 4a35133 commit 24df5f9
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
3 changes: 1 addition & 2 deletions shell/browser/api/electron_api_app.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1011,8 +1011,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.
Expand All @@ -1023,6 +1021,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<ProcessSingleton>(
Expand Down
1 change: 0 additions & 1 deletion shell/browser/relauncher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion shell/browser/ui/views/global_menu_bar_registrar_x11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 24df5f9

Please sign in to comment.