Bug 1484373: Follow-up: Fix missed review comment. r=froydnj (implied)
authorKris Maglione <maglione.k@gmail.com>
Fri, 24 Aug 2018 22:31:10 -0700
changeset 491439 7edee7974317eae6ce129eadf99833a58b6f543a
parent 491438 d40ab2ee60232d20ee38d3601ef15a85fa8c6d86
child 491440 8340805509c5503ff44c5d47d7333aa206960a58
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1484373
milestone63.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 1484373: Follow-up: Fix missed review comment. r=froydnj (implied)
toolkit/components/extensions/ExtensionPolicyService.cpp
xpcom/ds/SimpleEnumerator.h
--- a/toolkit/components/extensions/ExtensionPolicyService.cpp
+++ b/toolkit/components/extensions/ExtensionPolicyService.cpp
@@ -324,18 +324,18 @@ nsresult
 ForEachDocShell(nsIDocShell* aDocShell,
                 const std::function<nsresult(nsIDocShell*)>& aCallback)
 {
   nsCOMPtr<nsISimpleEnumerator> iter;
   MOZ_TRY(aDocShell->GetDocShellEnumerator(nsIDocShell::typeContent,
                                            nsIDocShell::ENUMERATE_FORWARDS,
                                            getter_AddRefs(iter)));
 
-  for (nsIDocShell& docShell : SimpleEnumerator<nsIDocShell>(iter)) {
-    MOZ_TRY(aCallback(&docShell));
+  for (auto& docShell : SimpleEnumerator<nsIDocShell>(iter)) {
+    MOZ_TRY(aCallback(docShell));
   }
   return NS_OK;
 }
 
 
 already_AddRefed<Promise>
 ExtensionPolicyService::ExecuteContentScript(nsPIDOMWindowInner* aWindow,
                                              WebExtensionContentScript& aScript)
--- a/xpcom/ds/SimpleEnumerator.h
+++ b/xpcom/ds/SimpleEnumerator.h
@@ -41,20 +41,20 @@ public:
     {}
 
     explicit Entry(nsISimpleEnumerator& aEnum)
       : mEnum(&aEnum)
     {
       ++*this;
     }
 
-    T& operator*()
+    const nsCOMPtr<T>& operator*()
     {
       MOZ_ASSERT(mPtr);
-      return *mPtr;
+      return mPtr;
     }
 
     Entry& operator++()
     {
       MOZ_ASSERT(mEnum);
       nsCOMPtr<nsISupports> next;
       if (NS_SUCCEEDED(mEnum->GetNext(getter_AddRefs(next)))) {
         mPtr = do_QueryInterface(next);