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 488808 7edee7974317eae6ce129eadf99833a58b6f543a
parent 488807 d40ab2ee60232d20ee38d3601ef15a85fa8c6d86
child 488809 8340805509c5503ff44c5d47d7333aa206960a58
push id9734
push usershindli@mozilla.com
push dateThu, 30 Aug 2018 12:18:07 +0000
treeherdermozilla-beta@71c71ab3afae [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);