Bug 1301127 - Make nsNavHistoryFolderResultNode QueryInterface to mozIStorageStatementCallback. r=smaug, a=ritu
authorMichael Layzell <michael@thelayzells.com>
Wed, 07 Sep 2016 13:48:23 -0400
changeset 348304 917fe502471a3e6846e2de665a7d940894937249
parent 348303 f6f6a67f5f1d1f305fba492b9e30e7570d3a64af
child 348305 729bb7ca036f73d87091ef943813465a472f956c
push id6412
push userryanvm@gmail.com
push dateThu, 22 Sep 2016 20:54:09 +0000
treeherdermozilla-beta@781b860baf29 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, ritu
bugs1301127
milestone50.0
Bug 1301127 - Make nsNavHistoryFolderResultNode QueryInterface to mozIStorageStatementCallback. r=smaug, a=ritu MozReview-Commit-ID: 5CPNIz3w4Iy
storage/mozStorageAsyncStatementExecution.cpp
toolkit/components/places/nsNavHistoryResult.cpp
--- a/storage/mozStorageAsyncStatementExecution.cpp
+++ b/storage/mozStorageAsyncStatementExecution.cpp
@@ -65,20 +65,17 @@ public:
   NS_IMETHOD Run()
   {
     NS_ASSERTION(mCallback, "Trying to notify about results without a callback!");
 
     if (mEventStatus->shouldNotify()) {
       // Hold a strong reference to the callback while notifying it, so that if
       // it spins the event loop, the callback won't be released and freed out
       // from under us.
-      //
-      // We can't put it in a nsCOMPtr, as sometimes mCallback doesn't
-      // QueryInterface to a mozIStorageStatementCallback, despite being one
-      RefPtr<mozIStorageStatementCallback> callback = mCallback;
+      nsCOMPtr<mozIStorageStatementCallback> callback = mCallback;
 
       (void)callback->HandleResult(mResults);
     }
 
     return NS_OK;
   }
 
 private:
@@ -103,20 +100,17 @@ public:
   }
 
   NS_IMETHOD Run()
   {
     if (mEventStatus->shouldNotify() && mCallback) {
       // Hold a strong reference to the callback while notifying it, so that if
       // it spins the event loop, the callback won't be released and freed out
       // from under us.
-      //
-      // We can't put it in a nsCOMPtr, as sometimes mCallback doesn't
-      // QueryInterface to a mozIStorageStatementCallback, despite being one
-      RefPtr<mozIStorageStatementCallback> callback = mCallback;
+      nsCOMPtr<mozIStorageStatementCallback> callback = mCallback;
 
       (void)callback->HandleError(mErrorObj);
     }
 
     return NS_OK;
   }
 
 private:
--- a/toolkit/components/places/nsNavHistoryResult.cpp
+++ b/toolkit/components/places/nsNavHistoryResult.cpp
@@ -2999,17 +2999,18 @@ nsNavHistoryQueryResultNode::OnItemMoved
  * operations to keep ourselves in sync with the bookmark service.  If the
  * folder is closed, we just clear our list to mark it as invalid and
  * unregister as a listener.  This means we do not have to keep maintaining
  * an up-to-date list for the entire bookmark menu structure in every place
  * it is used.
  */
 NS_IMPL_ISUPPORTS_INHERITED(nsNavHistoryFolderResultNode,
                             nsNavHistoryContainerResultNode,
-                            nsINavHistoryQueryResultNode)
+                            nsINavHistoryQueryResultNode,
+                            mozIStorageStatementCallback)
 
 nsNavHistoryFolderResultNode::nsNavHistoryFolderResultNode(
     const nsACString& aTitle, nsNavHistoryQueryOptions* aOptions,
     int64_t aFolderId) :
   nsNavHistoryContainerResultNode(EmptyCString(), aTitle, EmptyCString(),
                                   nsNavHistoryResultNode::RESULT_TYPE_FOLDER,
                                   aOptions),
   mContentsValid(false),