Bug 1489790 - Part 11: Remove the overload of nsEditingSession::SetupEditorCommandController which takes a string and uses the XPCOM service manager to create the controller; r=baku
authorEhsan Akhgari <ehsan@mozilla.com>
Sat, 08 Sep 2018 12:15:35 -0400
changeset 435708 5719833485cf984846d663495010ade3b6675b13
parent 435707 1bf6928fd462262c56f9abf37d8e51332fabfba9
child 435709 598c02ce23163569a3f430dc05868ebe2768d6a4
push id34618
push userbtara@mozilla.com
push dateTue, 11 Sep 2018 22:13:11 +0000
treeherdermozilla-central@1169e8a4ca2b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1489790
milestone64.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 1489790 - Part 11: Remove the overload of nsEditingSession::SetupEditorCommandController which takes a string and uses the XPCOM service manager to create the controller; r=baku Differential Revision: https://phabricator.services.mozilla.com/D5366
editor/composer/nsEditingSession.cpp
editor/composer/nsEditingSession.h
--- a/editor/composer/nsEditingSession.cpp
+++ b/editor/composer/nsEditingSession.cpp
@@ -1130,64 +1130,16 @@ nsEditingSession::SetupEditorCommandCont
   }
 
   // Set the context
   return SetContextOnControllerById(controllers, aContext, *aControllerId);
 }
 
 /*---------------------------------------------------------------------------
 
-  SetupEditorCommandController
-
-  Create a command controller, append to controllers,
-  get and return the controller ID, and set the context
-----------------------------------------------------------------------------*/
-nsresult
-nsEditingSession::SetupEditorCommandController(
-                                  const char *aControllerClassName,
-                                  mozIDOMWindowProxy *aWindow,
-                                  nsISupports *aContext,
-                                  uint32_t *aControllerId)
-{
-  NS_ENSURE_ARG_POINTER(aControllerClassName);
-  NS_ENSURE_ARG_POINTER(aWindow);
-  NS_ENSURE_ARG_POINTER(aContext);
-  NS_ENSURE_ARG_POINTER(aControllerId);
-
-  auto* piWindow = nsPIDOMWindowOuter::From(aWindow);
-  MOZ_ASSERT(piWindow);
-
-  nsCOMPtr<nsIControllers> controllers;
-  nsresult rv = piWindow->GetControllers(getter_AddRefs(controllers));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // We only have to create each singleton controller once
-  // We know this has happened once we have a controllerId value
-  if (!*aControllerId) {
-    nsCOMPtr<nsIController> controller;
-    controller = do_CreateInstance(aControllerClassName, &rv);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    // We must insert at head of the list to be sure our
-    //   controller is found before other implementations
-    //   (e.g., not-implemented versions by browser)
-    rv = controllers->InsertControllerAt(0, controller);
-    NS_ENSURE_SUCCESS(rv, rv);
-
-    // Remember the ID for the controller
-    rv = controllers->GetControllerId(controller, aControllerId);
-    NS_ENSURE_SUCCESS(rv, rv);
-  }
-
-  // Set the context
-  return SetContextOnControllerById(controllers, aContext, *aControllerId);
-}
-
-/*---------------------------------------------------------------------------
-
   SetEditorOnControllers
 
   Set the editor on the controller(s) for this window
 ----------------------------------------------------------------------------*/
 NS_IMETHODIMP
 nsEditingSession::SetEditorOnControllers(mozIDOMWindowProxy* aWindow,
                                          nsIEditor* aEditor)
 {
--- a/editor/composer/nsEditingSession.h
+++ b/editor/composer/nsEditingSession.h
@@ -64,21 +64,16 @@ protected:
 
   typedef already_AddRefed<nsIController> (*ControllerCreatorFn)();
 
   nsresult        SetupEditorCommandController(ControllerCreatorFn aControllerCreatorFn,
                                                mozIDOMWindowProxy* aWindow,
                                                nsISupports* aContext,
                                                uint32_t* aControllerId);
 
-  nsresult        SetupEditorCommandController(const char *aControllerClassName,
-                                               mozIDOMWindowProxy* aWindow,
-                                               nsISupports *aContext,
-                                               uint32_t *aControllerId);
-
   nsresult        SetContextOnControllerById(nsIControllers* aControllers,
                                             nsISupports* aContext,
                                             uint32_t aID);
 
   nsresult        PrepareForEditing(nsPIDOMWindowOuter* aWindow);
 
   static void     TimerCallback(nsITimer *aTimer, void *aClosure);
   nsCOMPtr<nsITimer>  mLoadBlankDocTimer;