Bug 1301127 - Make nsNavHistoryFolderResultNode QueryInterface to mozIStorageStatementCallback, r=smaug
authorMichael Layzell <michael@thelayzells.com>
Wed, 07 Sep 2016 13:48:23 -0400
changeset 313072 15dfa78b6aabea262599bcb452ab606d876d78c3
parent 313071 0e851843cf5a65f8570dbc3f99ab16243b2bb307
child 313073 c2115d200aebfcf50507302c26e6ffc3c9ba12ec
push id30669
push userkwierso@gmail.com
push dateThu, 08 Sep 2016 00:56:12 +0000
treeherdermozilla-central@77940cbf0c2a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1301127
milestone51.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 1301127 - Make nsNavHistoryFolderResultNode QueryInterface to mozIStorageStatementCallback, r=smaug 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() override
   {
     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() override
   {
     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
@@ -3009,17 +3009,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),