Bug 1258127 - Explain some sync change counter update queries. draft
authorKit Cambridge <kcambridge@mozilla.com>
Tue, 24 May 2016 14:53:52 -0700
changeset 385676 4f631c480b22aa1c4ec30b8662286e74c855498a
parent 385675 9e10aae5573ac881c98efab62b6a5bc3f741ce5e
child 524999 171160a3296f1eb7e65dda6e971b5aefc3cb0bb6
push id22576
push userkcambridge@mozilla.com
push dateSat, 09 Jul 2016 00:19:36 +0000
bugs1258127
milestone50.0a1
Bug 1258127 - Explain some sync change counter update queries. MozReview-Commit-ID: AFnsYqv0SK8
toolkit/components/places/nsNavBookmarks.cpp
--- a/toolkit/components/places/nsNavBookmarks.cpp
+++ b/toolkit/components/places/nsNavBookmarks.cpp
@@ -1338,16 +1338,18 @@ nsNavBookmarks::MoveItem(int64_t aItemId
     NS_ENSURE_SUCCESS(rv, rv);
     rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("item_id"), bookmark.id);
     NS_ENSURE_SUCCESS(rv, rv);
     // The item itself only gets a change increment if it was re-parented.
     rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("delta"), sameParent ? 0 : 1);
     NS_ENSURE_SUCCESS(rv, rv);
     rv = stmt->Execute();
     NS_ENSURE_SUCCESS(rv, rv);
+    rv = stmt->Explain();
+    NS_ENSURE_SUCCESS(rv, rv);
   }
 
   PRTime now = RoundedPRNow();
   rv = SetItemDateInternal(LAST_MODIFIED, TRACK, bookmark.parentId, now);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = SetItemDateInternal(LAST_MODIFIED, sameParent ? IGNORE : TRACK,
                            aNewParent, now);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1502,16 +1504,19 @@ nsNavBookmarks::SetItemDateInternal(enum
   nsresult rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("date"), aValue);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("item_id"), aItemId);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = stmt->Execute();
   NS_ENSURE_SUCCESS(rv, rv);
 
+  rv = stmt->Explain();
+  NS_ENSURE_SUCCESS(rv, rv);
+
   // note, we are not notifying the observers
   // that the item has changed.
 
   return NS_OK;
 }
 
 
 NS_IMETHODIMP
@@ -1625,17 +1630,23 @@ nsNavBookmarks::TrackSyncTagChange(int64
   NS_ENSURE_STATE(statement);
   mozStorageStatementScoper scoper(statement);
 
   nsresult rv = URIBinder::Bind(statement, NS_LITERAL_CSTRING("page_url"), aURI);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = statement->BindInt64ByName(NS_LITERAL_CSTRING("tag_id"), aTagId);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  return statement->Execute();
+  rv = statement->Execute();
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  rv = statement->Explain();
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNavBookmarks::SetItemTitle(int64_t aItemId, const nsACString& aTitle,
                              uint16_t aSource)
 {
   NS_ENSURE_ARG_MIN(aItemId, 1);
 
@@ -1681,16 +1692,19 @@ nsNavBookmarks::SetItemTitle(int64_t aIt
                                   bookmark.lastModified);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = statement->BindInt64ByName(NS_LITERAL_CSTRING("item_id"), bookmark.id);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = statement->Execute();
   NS_ENSURE_SUCCESS(rv, rv);
 
+  rv = statement->Explain();
+  NS_ENSURE_SUCCESS(rv, rv);
+
   NOTIFY_OBSERVERS(mCanNotify, mCacheObservers, mObservers,
                    nsINavBookmarkObserver,
                    OnItemChanged(bookmark.id,
                                  NS_LITERAL_CSTRING("title"),
                                  false,
                                  title,
                                  bookmark.lastModified,
                                  bookmark.type,
@@ -2165,16 +2179,19 @@ nsNavBookmarks::ChangeBookmarkURI(int64_
   rv = statement->BindInt64ByName(NS_LITERAL_CSTRING("date"),
                                   bookmark.lastModified);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = statement->BindInt64ByName(NS_LITERAL_CSTRING("item_id"), bookmark.id);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = statement->Execute();
   NS_ENSURE_SUCCESS(rv, rv);
 
+  rv = statement->Explain();
+  NS_ENSURE_SUCCESS(rv, rv);
+
   rv = transaction.Commit();
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = history->UpdateFrecency(newPlaceId);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Upon changing the URI for a bookmark, update the frecency for the old
   // place as well.
@@ -2418,16 +2435,19 @@ nsNavBookmarks::SetItemIndex(int64_t aIt
     mozStorageStatementScoper scoper(stmt);
 
     rv = stmt->BindInt64ByName(NS_LITERAL_CSTRING("parent_id"),
                                bookmark.parentId);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = stmt->Execute();
     NS_ENSURE_SUCCESS(rv, rv);
+
+    rv = stmt->Explain();
+    NS_ENSURE_SUCCESS(rv, rv);
   }
 
   rv = transaction.Commit();
   NS_ENSURE_SUCCESS(rv, rv);
 
   NOTIFY_OBSERVERS(mCanNotify, mCacheObservers, mObservers,
                    nsINavBookmarkObserver,
                    OnItemMoved(bookmark.id,
@@ -2532,16 +2552,19 @@ nsNavBookmarks::SetKeywordForBookmark(in
          "syncChangeCounter = syncChangeCounter + 1 "
         "WHERE id IN ids")
       );
       NS_ENSURE_STATE(stmt);
       mozStorageStatementScoper scoper(stmt);
 
       rv = stmt->Execute();
       NS_ENSURE_SUCCESS(rv, rv);
+
+      rv = stmt->Explain();
+      NS_ENSURE_SUCCESS(rv, rv);
     }
 
     rv = removeTxn.Commit();
     NS_ENSURE_SUCCESS(rv, rv);
 
     for (uint32_t i = 0; i < bookmarks.Length(); ++i) {
       NOTIFY_OBSERVERS(mCanNotify, mCacheObservers, mObservers,
                        nsINavBookmarkObserver,
@@ -2662,16 +2685,19 @@ nsNavBookmarks::SetKeywordForBookmark(in
        "syncChangeCounter = syncChangeCounter + 1 "
       "WHERE id IN ids")
     );
     NS_ENSURE_STATE(stmt);
     mozStorageStatementScoper scoper(stmt);
 
     rv = stmt->Execute();
     NS_ENSURE_SUCCESS(rv, rv);
+
+    rv = stmt->Explain();
+    NS_ENSURE_SUCCESS(rv, rv);
   }
 
   rv = updateTxn.Commit();
   NS_ENSURE_SUCCESS(rv, rv);
 
   // In both cases, notify about the change.
   for (uint32_t i = 0; i < bookmarks.Length(); ++i) {
     NOTIFY_OBSERVERS(mCanNotify, mCacheObservers, mObservers,