Commit 65bdc0fc authored by Daniel Holbert's avatar Daniel Holbert
Browse files

Bug 1896711 part 1: Use MakeRefPtr to reduce boilerplate, in...

Bug 1896711 part 1: Use MakeRefPtr to reduce boilerplate, in layout/{build,inspector,mathml}. r=TYLin

Differential Revision: https://phabricator.services.mozilla.com/D210387
parent 53c7a295
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@

#undef NOISY_REGISTRY

using namespace mozilla;
using mozilla::dom::Document;

already_AddRefed<nsIDocumentViewer> NS_NewDocumentViewer();
@@ -63,7 +64,7 @@ nsresult NS_NewContentDocumentLoaderFactory(
  if (!aResult) {
    return NS_ERROR_NULL_POINTER;
  }
  RefPtr<nsContentDLF> it = new nsContentDLF();
  auto it = MakeRefPtr<nsContentDLF>();
  it.forget(aResult);
  return NS_OK;
}
+3 −3
Original line number Diff line number Diff line
@@ -207,16 +207,16 @@ nsresult Construct_nsIScriptSecurityManager(REFNSIID aIID, void** aResult) {

nsresult LocalStorageManagerConstructor(REFNSIID aIID, void** aResult) {
  if (NextGenLocalStorageEnabled()) {
    RefPtr<LocalStorageManager2> manager = new LocalStorageManager2();
    auto manager = MakeRefPtr<LocalStorageManager2>();
    return manager->QueryInterface(aIID, aResult);
  }

  RefPtr<LocalStorageManager> manager = new LocalStorageManager();
  auto manager = MakeRefPtr<LocalStorageManager>();
  return manager->QueryInterface(aIID, aResult);
}

nsresult SessionStorageManagerConstructor(REFNSIID aIID, void** aResult) {
  RefPtr<SessionStorageManager> manager = new SessionStorageManager(nullptr);
  auto manager = MakeRefPtr<SessionStorageManager>(nullptr);
  return manager->QueryInterface(aIID, aResult);
}

+1 −1
Original line number Diff line number Diff line
@@ -943,7 +943,7 @@ static void AddOverflowingChildrenOfElement(const nsIFrame* aFrame,

already_AddRefed<nsINodeList> InspectorUtils::GetOverflowingChildrenOfElement(
    GlobalObject& aGlobal, Element& aElement) {
  RefPtr<nsSimpleContentList> list = new nsSimpleContentList(&aElement);
  auto list = MakeRefPtr<nsSimpleContentList>(&aElement);
  const nsIScrollableFrame* scrollFrame = aElement.GetScrollFrame();
  // Element must have a nsIScrollableFrame
  if (!scrollFrame) {
+1 −1
Original line number Diff line number Diff line
@@ -624,7 +624,7 @@ static nsresult InitCharGlobals() {

  // Allocate the placeholders for the preferred parts and variants
  nsresult rv = NS_ERROR_OUT_OF_MEMORY;
  RefPtr<nsGlyphTableList> glyphTableList = new nsGlyphTableList();
  auto glyphTableList = MakeRefPtr<nsGlyphTableList>();
  if (glyphTableList) {
    rv = glyphTableList->Initialize();
  }