Loading toolkit/components/remote/nsRemoteService.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -53,7 +53,8 @@ nsStartupLock::~nsStartupLock() { NS_IMPL_ISUPPORTS(nsRemoteService, nsIObserver, nsIRemoteService) nsRemoteService::nsRemoteService() : mProgram("mozilla") { nsRemoteService::nsRemoteService(bool aRemotingEnabled) : mRemotingEnabled(aRemotingEnabled), mProgram("mozilla") { ToLowerCase(mProgram); } Loading Loading @@ -194,6 +195,10 @@ nsresult nsRemoteService::SendCommandLine(const nsACString& aProfile, return NS_ERROR_FAILURE; } if (!mRemotingEnabled) { return NS_ERROR_NOT_AVAILABLE; } UniquePtr<nsRemoteClient> client; #ifdef MOZ_WIDGET_GTK # if defined(MOZ_ENABLE_DBUS) Loading Loading @@ -249,7 +254,7 @@ nsresult nsRemoteService::StartClient() { } void nsRemoteService::StartupServer() { if (mRemoteServer) { if (mRemoteServer || !mRemotingEnabled) { return; } Loading toolkit/components/remote/nsRemoteService.h +2 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ class nsRemoteService final : public nsIObserver, public nsIRemoteService { NS_DECL_NSIOBSERVER NS_DECL_NSIREMOTESERVICE nsRemoteService(); nsRemoteService(bool aRemotingEnabled); void SetProgram(const char* aProgram); void SetProfile(nsACString& aProfile); #ifdef MOZ_WIDGET_GTK Loading Loading @@ -91,6 +91,7 @@ class nsRemoteService final : public nsIObserver, public nsIRemoteService { nsresult SendCommandLine(const nsACString& aProfile, size_t aArgc, const char** aArgv, bool aRaise); bool mRemotingEnabled; mozilla::UniquePtr<nsRemoteServer> mRemoteServer; nsCString mProgram; nsCString mProfile; Loading toolkit/xre/nsAppRunner.cpp +8 −10 Original line number Diff line number Diff line Loading @@ -315,7 +315,7 @@ static nsIProfileLock* gProfileLock; constinit static RefPtr<nsRemoteService> gRemoteService; constinit static RefPtr<nsStartupLock> gStartupLock; // tor-browser#43107: Disable remoting by default. bool gDisableRemoting = true; bool gEnableRemoting = false; #endif int gRestartArgc; Loading Loading @@ -2096,8 +2096,8 @@ nsresult ScopedXPCOMStartup::SetWindowCreator(nsINativeAppSupport* native) { /* static */ already_AddRefed<nsIRemoteService> GetRemoteService() { AssertIsOnMainThread(); if (!gRemoteService && !gDisableRemoting) { gRemoteService = new nsRemoteService(); if (!gRemoteService) { gRemoteService = new nsRemoteService(gEnableRemoting); } nsCOMPtr<nsIRemoteService> remoteService = gRemoteService.get(); return remoteService.forget(); Loading Loading @@ -4496,7 +4496,7 @@ int XREMain::XRE_mainInit(bool* aExitFlag) { // The user can still enable remoting if they want to, by adding the // allow-remote parameter to the command line. if (CheckArg("allow-remote") == ARG_FOUND) { gDisableRemoting = false; gEnableRemoting = true; } #else // These arguments do nothing in platforms with no remoting support but we Loading Loading @@ -4891,7 +4891,7 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) { #ifdef MOZ_HAS_REMOTE if (gfxPlatform::IsHeadless()) { gDisableRemoting = true; gEnableRemoting = false; } #endif Loading Loading @@ -5013,10 +5013,8 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) { } #endif #if defined(MOZ_HAS_REMOTE) if (!gDisableRemoting) { // handle --remote now that xpcom is fired up gRemoteService = new nsRemoteService(); } gRemoteService = new nsRemoteService(gEnableRemoting); if (gRemoteService) { gRemoteService->SetProgram(gAppData->remotingName); gStartupLock = gRemoteService->LockStartup(); Loading Loading @@ -5101,7 +5099,7 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) { if (NS_SUCCEEDED(rv)) { gRemoteService->SetProfile(profilePath); if (!gDisableRemoting) { if (gEnableRemoting) { // Try to remote the entire command line. If this fails, start up // normally. # ifdef MOZ_WIDGET_GTK Loading Loading
toolkit/components/remote/nsRemoteService.cpp +7 −2 Original line number Diff line number Diff line Loading @@ -53,7 +53,8 @@ nsStartupLock::~nsStartupLock() { NS_IMPL_ISUPPORTS(nsRemoteService, nsIObserver, nsIRemoteService) nsRemoteService::nsRemoteService() : mProgram("mozilla") { nsRemoteService::nsRemoteService(bool aRemotingEnabled) : mRemotingEnabled(aRemotingEnabled), mProgram("mozilla") { ToLowerCase(mProgram); } Loading Loading @@ -194,6 +195,10 @@ nsresult nsRemoteService::SendCommandLine(const nsACString& aProfile, return NS_ERROR_FAILURE; } if (!mRemotingEnabled) { return NS_ERROR_NOT_AVAILABLE; } UniquePtr<nsRemoteClient> client; #ifdef MOZ_WIDGET_GTK # if defined(MOZ_ENABLE_DBUS) Loading Loading @@ -249,7 +254,7 @@ nsresult nsRemoteService::StartClient() { } void nsRemoteService::StartupServer() { if (mRemoteServer) { if (mRemoteServer || !mRemotingEnabled) { return; } Loading
toolkit/components/remote/nsRemoteService.h +2 −1 Original line number Diff line number Diff line Loading @@ -39,7 +39,7 @@ class nsRemoteService final : public nsIObserver, public nsIRemoteService { NS_DECL_NSIOBSERVER NS_DECL_NSIREMOTESERVICE nsRemoteService(); nsRemoteService(bool aRemotingEnabled); void SetProgram(const char* aProgram); void SetProfile(nsACString& aProfile); #ifdef MOZ_WIDGET_GTK Loading Loading @@ -91,6 +91,7 @@ class nsRemoteService final : public nsIObserver, public nsIRemoteService { nsresult SendCommandLine(const nsACString& aProfile, size_t aArgc, const char** aArgv, bool aRaise); bool mRemotingEnabled; mozilla::UniquePtr<nsRemoteServer> mRemoteServer; nsCString mProgram; nsCString mProfile; Loading
toolkit/xre/nsAppRunner.cpp +8 −10 Original line number Diff line number Diff line Loading @@ -315,7 +315,7 @@ static nsIProfileLock* gProfileLock; constinit static RefPtr<nsRemoteService> gRemoteService; constinit static RefPtr<nsStartupLock> gStartupLock; // tor-browser#43107: Disable remoting by default. bool gDisableRemoting = true; bool gEnableRemoting = false; #endif int gRestartArgc; Loading Loading @@ -2096,8 +2096,8 @@ nsresult ScopedXPCOMStartup::SetWindowCreator(nsINativeAppSupport* native) { /* static */ already_AddRefed<nsIRemoteService> GetRemoteService() { AssertIsOnMainThread(); if (!gRemoteService && !gDisableRemoting) { gRemoteService = new nsRemoteService(); if (!gRemoteService) { gRemoteService = new nsRemoteService(gEnableRemoting); } nsCOMPtr<nsIRemoteService> remoteService = gRemoteService.get(); return remoteService.forget(); Loading Loading @@ -4496,7 +4496,7 @@ int XREMain::XRE_mainInit(bool* aExitFlag) { // The user can still enable remoting if they want to, by adding the // allow-remote parameter to the command line. if (CheckArg("allow-remote") == ARG_FOUND) { gDisableRemoting = false; gEnableRemoting = true; } #else // These arguments do nothing in platforms with no remoting support but we Loading Loading @@ -4891,7 +4891,7 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) { #ifdef MOZ_HAS_REMOTE if (gfxPlatform::IsHeadless()) { gDisableRemoting = true; gEnableRemoting = false; } #endif Loading Loading @@ -5013,10 +5013,8 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) { } #endif #if defined(MOZ_HAS_REMOTE) if (!gDisableRemoting) { // handle --remote now that xpcom is fired up gRemoteService = new nsRemoteService(); } gRemoteService = new nsRemoteService(gEnableRemoting); if (gRemoteService) { gRemoteService->SetProgram(gAppData->remotingName); gStartupLock = gRemoteService->LockStartup(); Loading Loading @@ -5101,7 +5099,7 @@ int XREMain::XRE_mainStartup(bool* aExitFlag) { if (NS_SUCCEEDED(rv)) { gRemoteService->SetProfile(profilePath); if (!gDisableRemoting) { if (gEnableRemoting) { // Try to remote the entire command line. If this fails, start up // normally. # ifdef MOZ_WIDGET_GTK Loading