Bug 1518639: Move widget/xremote code to toolkit/components/remote. r=jimm
authorDave Townsend <dtownsend@oxymoronical.com>
Thu, 31 Jan 2019 12:13:34 -0800
changeset 520637 2ac2c7a2a9a61bb33802721ff73163a1403f3c54
parent 520636 d1f158c2928f02fe725038bdda99b13c4366bc6c
child 520638 34d973f8ea5b4acb22e4ad2a0ced65c2583f6397
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs1518639
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1518639: Move widget/xremote code to toolkit/components/remote. r=jimm It makes more sense for the remote client to live alongside the server. Differential Revision: https://phabricator.services.mozilla.com/D19068
toolkit/components/remote/RemoteUtils.cpp
toolkit/components/remote/RemoteUtils.h
toolkit/components/remote/moz.build
toolkit/components/remote/nsDBusRemoteClient.cpp
toolkit/components/remote/nsDBusRemoteClient.h
toolkit/components/remote/nsRemoteClient.h
toolkit/components/remote/nsXRemoteClient.cpp
toolkit/components/remote/nsXRemoteClient.h
toolkit/toolkit.mozbuild
toolkit/xre/moz.build
toolkit/xre/nsAppRunner.cpp
widget/xremoteclient/DBusRemoteClient.cpp
widget/xremoteclient/DBusRemoteClient.h
widget/xremoteclient/RemoteUtils.cpp
widget/xremoteclient/RemoteUtils.h
widget/xremoteclient/XRemoteClient.cpp
widget/xremoteclient/XRemoteClient.h
widget/xremoteclient/moz.build
widget/xremoteclient/nsRemoteClient.h
rename from widget/xremoteclient/RemoteUtils.cpp
rename to toolkit/components/remote/RemoteUtils.cpp
rename from widget/xremoteclient/RemoteUtils.h
rename to toolkit/components/remote/RemoteUtils.h
--- a/toolkit/components/remote/moz.build
+++ b/toolkit/components/remote/moz.build
@@ -10,18 +10,21 @@ with Files('**'):
 SOURCES += [
     'nsRemoteService.cpp',
 ]
 
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     SOURCES += [
         'nsGTKRemoteServer.cpp',
         'nsUnixRemoteServer.cpp',
+        'nsXRemoteClient.cpp',
         'nsXRemoteServer.cpp',
+        'RemoteUtils.cpp',
     ]
     if CONFIG['MOZ_ENABLE_DBUS']:
         SOURCES += [
+            'nsDBusRemoteClient.cpp',
             'nsDBusRemoteServer.cpp',
         ]
         CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
     CXXFLAGS += CONFIG['TK_CFLAGS']
 
 FINAL_LIBRARY = 'xul'
rename from widget/xremoteclient/DBusRemoteClient.cpp
rename to toolkit/components/remote/nsDBusRemoteClient.cpp
--- a/widget/xremoteclient/DBusRemoteClient.cpp
+++ b/toolkit/components/remote/nsDBusRemoteClient.cpp
@@ -1,65 +1,67 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:expandtab:shiftwidth=2:tabstop=8:
  */
 /* vim:set ts=8 sw=2 et cindent: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#include "DBusRemoteClient.h"
+#include "nsDBusRemoteClient.h"
 #include "RemoteUtils.h"
 #include "mozilla/Logging.h"
 #include "mozilla/Base64.h"
 #include "nsPrintfCString.h"
 
 #include <dlfcn.h>
 #include <dbus/dbus-glib-lowlevel.h>
 
 using mozilla::LogLevel;
-static mozilla::LazyLogModule sRemoteLm("DBusRemoteClient");
+static mozilla::LazyLogModule sRemoteLm("nsDBusRemoteClient");
 
-DBusRemoteClient::DBusRemoteClient() {
+nsDBusRemoteClient::nsDBusRemoteClient() {
   mConnection = nullptr;
-  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("DBusRemoteClient::DBusRemoteClient"));
+  MOZ_LOG(sRemoteLm, LogLevel::Debug,
+          ("nsDBusRemoteClient::nsDBusRemoteClient"));
 }
 
-DBusRemoteClient::~DBusRemoteClient() {
-  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("DBusRemoteClient::~DBusRemoteClient"));
+nsDBusRemoteClient::~nsDBusRemoteClient() {
+  MOZ_LOG(sRemoteLm, LogLevel::Debug,
+          ("nsDBusRemoteClient::~nsDBusRemoteClient"));
   Shutdown();
 }
 
-nsresult DBusRemoteClient::Init() {
-  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("DBusRemoteClient::Init"));
+nsresult nsDBusRemoteClient::Init() {
+  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("nsDBusRemoteClient::Init"));
 
   if (mConnection) return NS_OK;
 
   mConnection =
       already_AddRefed<DBusConnection>(dbus_bus_get(DBUS_BUS_SESSION, nullptr));
   if (!mConnection) return NS_ERROR_FAILURE;
 
   dbus_connection_set_exit_on_disconnect(mConnection, false);
   dbus_connection_setup_with_g_main(mConnection, nullptr);
 
   return NS_OK;
 }
 
-void DBusRemoteClient::Shutdown(void) {
-  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("DBusRemoteClient::Shutdown"));
+void nsDBusRemoteClient::Shutdown(void) {
+  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("nsDBusRemoteClient::Shutdown"));
   // This connection is owned by libdbus and we don't need to close it
   mConnection = nullptr;
 }
 
-nsresult DBusRemoteClient::SendCommandLine(
+nsresult nsDBusRemoteClient::SendCommandLine(
     const char *aProgram, const char *aProfile, int32_t argc, char **argv,
     const char *aDesktopStartupID, char **aResponse, bool *aWindowFound) {
   NS_ENSURE_TRUE(aProgram, NS_ERROR_INVALID_ARG);
 
-  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("DBusRemoteClient::SendCommandLine"));
+  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("nsDBusRemoteClient::SendCommandLine"));
 
   int commandLineLength;
   char *commandLine =
       ConstructCommandLine(argc, argv, aDesktopStartupID, &commandLineLength);
   if (!commandLine) return NS_ERROR_FAILURE;
 
   nsresult rv =
       DoSendDBusCommandLine(aProgram, aProfile, commandLine, commandLineLength);
@@ -67,19 +69,19 @@ nsresult DBusRemoteClient::SendCommandLi
   *aWindowFound = NS_SUCCEEDED(rv);
 
   MOZ_LOG(sRemoteLm, LogLevel::Debug,
           ("DoSendDBusCommandLine returning 0x%" PRIx32 "\n",
            static_cast<uint32_t>(rv)));
   return rv;
 }
 
-bool DBusRemoteClient::GetRemoteDestinationName(const char *aProgram,
-                                                const char *aProfile,
-                                                nsCString &aDestinationName) {
+bool nsDBusRemoteClient::GetRemoteDestinationName(const char *aProgram,
+                                                  const char *aProfile,
+                                                  nsCString &aDestinationName) {
   if (!aProfile || aProfile[0] == '\0') {
     // We don't have a profile name - search for active mozilla instances.
     RefPtr<DBusMessage> msg =
         already_AddRefed<DBusMessage>(dbus_message_new_method_call(
             "org.freedesktop.DBus", "/org/freedesktop/DBus",
             "org.freedesktop.DBus", "ListNames"));
     if (!msg) {
       return false;
@@ -145,20 +147,20 @@ bool DBusRemoteClient::GetRemoteDestinat
         return false;
       }
     }
 
     return true;
   }
 }
 
-nsresult DBusRemoteClient::DoSendDBusCommandLine(const char *aProgram,
-                                                 const char *aProfile,
-                                                 const char *aBuffer,
-                                                 int aLength) {
+nsresult nsDBusRemoteClient::DoSendDBusCommandLine(const char *aProgram,
+                                                   const char *aProfile,
+                                                   const char *aBuffer,
+                                                   int aLength) {
   nsAutoCString destinationName;
   if (!GetRemoteDestinationName(aProgram, aProfile, destinationName))
     return NS_ERROR_FAILURE;
 
   nsAutoCString pathName;
   pathName = nsPrintfCString("/org/mozilla/%s/Remote", aProgram);
 
   nsAutoCString remoteInterfaceName;
rename from widget/xremoteclient/DBusRemoteClient.h
rename to toolkit/components/remote/nsDBusRemoteClient.h
--- a/widget/xremoteclient/DBusRemoteClient.h
+++ b/toolkit/components/remote/nsDBusRemoteClient.h
@@ -6,20 +6,20 @@
 #ifndef DBusRemoteClient_h__
 #define DBusRemoteClient_h__
 
 #include "nsRemoteClient.h"
 #include "mozilla/StaticPtr.h"
 #include "mozilla/DBusHelpers.h"
 #include "nsString.h"
 
-class DBusRemoteClient : public nsRemoteClient {
+class nsDBusRemoteClient : public nsRemoteClient {
  public:
-  DBusRemoteClient();
-  ~DBusRemoteClient();
+  nsDBusRemoteClient();
+  ~nsDBusRemoteClient();
 
   virtual nsresult Init() override;
   virtual nsresult SendCommandLine(const char *aProgram, const char *aProfile,
                                    int32_t argc, char **argv,
                                    const char *aDesktopStartupID,
                                    char **aResponse, bool *aSucceeded) override;
   void Shutdown();
 
rename from widget/xremoteclient/nsRemoteClient.h
rename to toolkit/components/remote/nsRemoteClient.h
rename from widget/xremoteclient/XRemoteClient.cpp
rename to toolkit/components/remote/nsXRemoteClient.cpp
--- a/widget/xremoteclient/XRemoteClient.cpp
+++ b/toolkit/components/remote/nsXRemoteClient.cpp
@@ -6,17 +6,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsDebug.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/IntegerPrintfMacros.h"
 #include "mozilla/Sprintf.h"
 #include "mozilla/Unused.h"
-#include "XRemoteClient.h"
+#include "nsXRemoteClient.h"
 #include "RemoteUtils.h"
 #include "plstr.h"
 #include "prsystem.h"
 #include "mozilla/Logging.h"
 #include "prenv.h"
 #include "prdtoa.h"
 #include <stdlib.h>
 #include <unistd.h>
@@ -50,50 +50,50 @@
 #  else
 #    define MAX_PATH 1024
 #  endif
 #endif
 
 using mozilla::LogLevel;
 using mozilla::Unused;
 
-static mozilla::LazyLogModule sRemoteLm("XRemoteClient");
+static mozilla::LazyLogModule sRemoteLm("nsXRemoteClient");
 
 static int (*sOldHandler)(Display *, XErrorEvent *);
 static bool sGotBadWindow;
 
-XRemoteClient::XRemoteClient() {
+nsXRemoteClient::nsXRemoteClient() {
   mDisplay = 0;
   mInitialized = false;
   mMozVersionAtom = 0;
   mMozLockAtom = 0;
   mMozCommandLineAtom = 0;
   mMozResponseAtom = 0;
   mMozWMStateAtom = 0;
   mMozUserAtom = 0;
   mMozProfileAtom = 0;
   mMozProgramAtom = 0;
   mLockData = 0;
-  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("XRemoteClient::XRemoteClient"));
+  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("nsXRemoteClient::nsXRemoteClient"));
 }
 
-XRemoteClient::~XRemoteClient() {
-  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("XRemoteClient::~XRemoteClient"));
+nsXRemoteClient::~nsXRemoteClient() {
+  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("nsXRemoteClient::~nsXRemoteClient"));
   if (mInitialized) Shutdown();
 }
 
 // Minimize the roundtrips to the X-server
 static const char *XAtomNames[] = {
     MOZILLA_VERSION_PROP, MOZILLA_LOCK_PROP,       MOZILLA_RESPONSE_PROP,
     "WM_STATE",           MOZILLA_USER_PROP,       MOZILLA_PROFILE_PROP,
     MOZILLA_PROGRAM_PROP, MOZILLA_COMMANDLINE_PROP};
 static Atom XAtoms[MOZ_ARRAY_LENGTH(XAtomNames)];
 
-nsresult XRemoteClient::Init() {
-  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("XRemoteClient::Init"));
+nsresult nsXRemoteClient::Init() {
+  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("nsXRemoteClient::Init"));
 
   if (mInitialized) return NS_OK;
 
   // try to open the display
   mDisplay = XOpenDisplay(0);
   if (!mDisplay) return NS_ERROR_FAILURE;
 
   // get our atoms
@@ -110,18 +110,18 @@ nsresult XRemoteClient::Init() {
   mMozProgramAtom = XAtoms[i++];
   mMozCommandLineAtom = XAtoms[i];
 
   mInitialized = true;
 
   return NS_OK;
 }
 
-void XRemoteClient::Shutdown(void) {
-  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("XRemoteClient::Shutdown"));
+void nsXRemoteClient::Shutdown(void) {
+  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("nsXRemoteClient::Shutdown"));
 
   if (!mInitialized) return;
 
   // shut everything down
   XCloseDisplay(mDisplay);
   mDisplay = 0;
   mInitialized = false;
   if (mLockData) {
@@ -134,24 +134,22 @@ static int HandleBadWindow(Display *disp
   if (event->error_code == BadWindow) {
     sGotBadWindow = true;
     return 0;  // ignored
   }
 
   return (*sOldHandler)(display, event);
 }
 
-nsresult XRemoteClient::SendCommandLine(const char *aProgram,
-                                        const char *aProfile, int32_t argc,
-                                        char **argv,
-                                        const char *aDesktopStartupID,
-                                        char **aResponse, bool *aWindowFound) {
+nsresult nsXRemoteClient::SendCommandLine(
+    const char *aProgram, const char *aProfile, int32_t argc, char **argv,
+    const char *aDesktopStartupID, char **aResponse, bool *aWindowFound) {
   NS_ENSURE_TRUE(aProgram, NS_ERROR_INVALID_ARG);
 
-  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("XRemoteClient::SendCommandLine"));
+  MOZ_LOG(sRemoteLm, LogLevel::Debug, ("nsXRemoteClient::SendCommandLine"));
 
   *aWindowFound = false;
 
   // FindBestWindow() iterates down the window hierarchy, so catch X errors
   // when windows get destroyed before being accessed.
   sOldHandler = XSetErrorHandler(HandleBadWindow);
 
   Window w = FindBestWindow(aProgram, aProfile);
@@ -190,17 +188,17 @@ nsresult XRemoteClient::SendCommandLine(
 
   MOZ_LOG(sRemoteLm, LogLevel::Debug,
           ("SendCommandInternal returning 0x%" PRIx32 "\n",
            static_cast<uint32_t>(rv)));
 
   return rv;
 }
 
-Window XRemoteClient::CheckWindow(Window aWindow) {
+Window nsXRemoteClient::CheckWindow(Window aWindow) {
   Atom type = None;
   int format;
   unsigned long nitems, bytesafter;
   unsigned char *data;
   Window innerWindow;
 
   XGetWindowProperty(mDisplay, aWindow, mMozWMStateAtom, 0, 0, False,
                      AnyPropertyType, &type, &format, &nitems, &bytesafter,
@@ -214,17 +212,17 @@ Window XRemoteClient::CheckWindow(Window
   // didn't find it here so check the children of this window
   innerWindow = CheckChildren(aWindow);
 
   if (innerWindow) return innerWindow;
 
   return aWindow;
 }
 
-Window XRemoteClient::CheckChildren(Window aWindow) {
+Window nsXRemoteClient::CheckChildren(Window aWindow) {
   Window root, parent;
   Window *children;
   unsigned int nchildren;
   unsigned int i;
   Atom type = None;
   int format;
   unsigned long nitems, after;
   unsigned char *data;
@@ -249,17 +247,17 @@ Window XRemoteClient::CheckChildren(Wind
     retval = CheckChildren(children[i]);
   }
 
   if (children) XFree((char *)children);
 
   return retval;
 }
 
-nsresult XRemoteClient::GetLock(Window aWindow, bool *aDestroyed) {
+nsresult nsXRemoteClient::GetLock(Window aWindow, bool *aDestroyed) {
   bool locked = false;
   bool waited = false;
   *aDestroyed = false;
 
   nsresult rv = NS_OK;
 
   if (!mLockData) {
     char pidstr[32];
@@ -370,28 +368,28 @@ nsresult XRemoteClient::GetLock(Window a
   } else if (*aDestroyed) {
     MOZ_LOG(sRemoteLm, LogLevel::Debug,
             ("window 0x%x unexpectedly destroyed.\n", (unsigned int)aWindow));
   }
 
   return rv;
 }
 
-Window XRemoteClient::FindBestWindow(const char *aProgram,
-                                     const char *aProfile) {
+Window nsXRemoteClient::FindBestWindow(const char *aProgram,
+                                       const char *aProfile) {
   Window root = RootWindowOfScreen(DefaultScreenOfDisplay(mDisplay));
   Window bestWindow = 0;
   Window root2, parent, *kids;
   unsigned int nkids;
 
   // Get a list of the children of the root window, walk the list
   // looking for the best window that fits the criteria.
   if (!XQueryTree(mDisplay, root, &root2, &parent, &kids, &nkids)) {
     MOZ_LOG(sRemoteLm, LogLevel::Debug,
-            ("XQueryTree failed in XRemoteClient::FindBestWindow"));
+            ("XQueryTree failed in nsXRemoteClient::FindBestWindow"));
     return 0;
   }
 
   if (!(kids && nkids)) {
     MOZ_LOG(sRemoteLm, LogLevel::Debug, ("root window has no children"));
     return 0;
   }
 
@@ -494,17 +492,17 @@ Window XRemoteClient::FindBestWindow(con
     break;
   }
 
   if (kids) XFree((char *)kids);
 
   return bestWindow;
 }
 
-nsresult XRemoteClient::FreeLock(Window aWindow) {
+nsresult nsXRemoteClient::FreeLock(Window aWindow) {
   int result;
   Atom actual_type;
   int actual_format;
   unsigned long nitems, bytes_after;
   unsigned char *data = 0;
 
   result = XGetWindowProperty(
       mDisplay, aWindow, mMozLockAtom, 0, (65536 / sizeof(long)),
@@ -526,38 +524,39 @@ nsresult XRemoteClient::FreeLock(Window 
              mLockData, data));
     return NS_ERROR_FAILURE;
   }
 
   if (data) XFree(data);
   return NS_OK;
 }
 
-nsresult XRemoteClient::DoSendCommandLine(Window aWindow, int32_t argc,
-                                          char **argv,
-                                          const char *aDesktopStartupID,
-                                          char **aResponse, bool *aDestroyed) {
+nsresult nsXRemoteClient::DoSendCommandLine(Window aWindow, int32_t argc,
+                                            char **argv,
+                                            const char *aDesktopStartupID,
+                                            char **aResponse,
+                                            bool *aDestroyed) {
   *aDestroyed = false;
 
   int commandLineLength;
   char *commandLine =
       ConstructCommandLine(argc, argv, aDesktopStartupID, &commandLineLength);
   XChangeProperty(mDisplay, aWindow, mMozCommandLineAtom, XA_STRING, 8,
                   PropModeReplace, (unsigned char *)commandLine,
                   commandLineLength);
   free(commandLine);
 
   if (!WaitForResponse(aWindow, aResponse, aDestroyed, mMozCommandLineAtom))
     return NS_ERROR_FAILURE;
 
   return NS_OK;
 }
 
-bool XRemoteClient::WaitForResponse(Window aWindow, char **aResponse,
-                                    bool *aDestroyed, Atom aCommandAtom) {
+bool nsXRemoteClient::WaitForResponse(Window aWindow, char **aResponse,
+                                      bool *aDestroyed, Atom aCommandAtom) {
   bool done = false;
   bool accepted = false;
 
   while (!done) {
     XEvent event;
     XNextEvent(mDisplay, &event);
     if (event.xany.type == DestroyNotify &&
         event.xdestroywindow.window == aWindow) {
rename from widget/xremoteclient/XRemoteClient.h
rename to toolkit/components/remote/nsXRemoteClient.h
--- a/widget/xremoteclient/XRemoteClient.h
+++ b/toolkit/components/remote/nsXRemoteClient.h
@@ -3,20 +3,20 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <X11/X.h>
 #include <X11/Xlib.h>
 
 #include "nsRemoteClient.h"
 
-class XRemoteClient : public nsRemoteClient {
+class nsXRemoteClient : public nsRemoteClient {
  public:
-  XRemoteClient();
-  ~XRemoteClient();
+  nsXRemoteClient();
+  ~nsXRemoteClient();
 
   virtual nsresult Init() override;
   virtual nsresult SendCommandLine(const char *aProgram, const char *aProfile,
                                    int32_t argc, char **argv,
                                    const char *aDesktopStartupID,
                                    char **aResponse, bool *aSucceeded) override;
   void Shutdown();
 
--- a/toolkit/toolkit.mozbuild
+++ b/toolkit/toolkit.mozbuild
@@ -154,17 +154,16 @@ DIRS += [
     '/startupcache',
     '/js/ductwork/debugger',
     '/other-licenses/snappy',
 ]
 
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     DIRS += [
         '/toolkit/system/gnome',
-        '/widget/xremoteclient',
     ]
 
 if CONFIG['ENABLE_MARIONETTE']:
     DIRS += [
         '/testing/firefox-ui',
         '/testing/marionette',
     ]
 
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
@@ -240,19 +240,16 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
     ]
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
 CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
 CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']
 
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
-    LOCAL_INCLUDES += [
-        '/widget/xremoteclient',
-    ]
 
 DEFINES['TOPOBJDIR'] = TOPOBJDIR
 FINAL_TARGET_PP_FILES += [
     'platform.ini'
 ]
 
 if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
     CXXFLAGS += ['-Wno-error=shadow']
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -183,23 +183,23 @@
 
 #ifdef XP_MACOSX
 #  include "nsILocalFileMac.h"
 #  include "nsCommandLineServiceMac.h"
 #endif
 
 // for X remote support
 #if defined(MOZ_WIDGET_GTK)
-#  include "XRemoteClient.h"
+#  include "nsXRemoteClient.h"
 #  include "nsRemoteService.h"
 #  include "nsProfileLock.h"
 #  include "SpecialSystemDirectory.h"
 #  include <sched.h>
 #  ifdef MOZ_ENABLE_DBUS
-#    include "DBusRemoteClient.h"
+#    include "nsDBusRemoteClient.h"
 #  endif
 // Time to wait for the remoting service to start
 #  define MOZ_XREMOTE_START_TIMEOUT_SEC 5
 #endif
 
 #if defined(DEBUG) && defined(XP_WIN32)
 #  include <malloc.h>
 #endif
@@ -1549,21 +1549,21 @@ static inline void DumpVersion() {
 static RemoteResult StartRemoteClient(const char* aDesktopStartupID,
                                       nsCString& program, const char* profile) {
   nsAutoPtr<nsRemoteClient> client;
 
   bool useX11Remote = GDK_IS_X11_DISPLAY(gdk_display_get_default());
 
 #  if defined(MOZ_ENABLE_DBUS)
   if (!useX11Remote) {
-    client = new DBusRemoteClient();
+    client = new nsDBusRemoteClient();
   }
 #  endif
   if (useX11Remote) {
-    client = new XRemoteClient();
+    client = new nsXRemoteClient();
   }
 
   nsresult rv = client ? client->Init() : NS_ERROR_FAILURE;
   if (NS_FAILED(rv)) return REMOTE_NOT_FOUND;
 
   nsCString response;
   bool success = false;
   rv = client->SendCommandLine(program.get(), profile, gArgc, gArgv,
deleted file mode 100644
--- a/widget/xremoteclient/moz.build
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-with Files("**"):
-    BUG_COMPONENT = ("Core", "Widget")
-
-FINAL_LIBRARY = 'xul'
-
-SOURCES += [
-    'RemoteUtils.cpp',
-    'XRemoteClient.cpp',
-]
-
-if CONFIG['MOZ_ENABLE_DBUS']:
-    SOURCES += [
-        'DBusRemoteClient.cpp',
-    ]
-    CXXFLAGS += CONFIG['TK_CFLAGS']
-    CXXFLAGS += CONFIG['MOZ_DBUS_GLIB_CFLAGS']