Bug 1254923 - Remove RemoveAllPages API. r=mak
authorTimur Valeev <tvaleev@gmail.com>
Wed, 09 Mar 2016 19:34:51 +0300
changeset 291385 3eb3406f08b594fe2b54926c6649eb8c5347104d
parent 291384 646cc46e3cfc57fde0a898635a866bb7341750aa
child 291386 6b710da110000b8d4b0116281fa319ab78879fbe
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1254923
milestone48.0a1
Bug 1254923 - Remove RemoveAllPages API. r=mak
toolkit/components/places/nsIBrowserHistory.idl
toolkit/components/places/nsNavHistory.cpp
--- a/toolkit/components/places/nsIBrowserHistory.idl
+++ b/toolkit/components/places/nsIBrowserHistory.idl
@@ -79,22 +79,9 @@ interface nsIBrowserHistory : nsISupport
      *        Microseconds from epoch, representing the final time.
      *
      * @note The removal happens in a batch.
      *
      * @deprecated Please use PlacesUtils.history.removeVisitsByFilter instead
      */
     void removeVisitsByTimeframe(in PRTime aBeginTime,
                                  in PRTime aEndTime);
-
-    /**
-     * Removes all existing pages from global history.
-     * Visits are removed synchronously, but pages are expired asynchronously
-     * off the main-thread.
-     *
-     * @deprecated Please use PlacesUtils.history.clear() instead.
-     *
-     * @note The removal happens in a batch. Single removals are not notified,
-     *       instead an onClearHistory notification is sent to
-     *       nsINavHistoryObserver implementers.
-     */
-    void removeAllPages();
 };
--- a/toolkit/components/places/nsNavHistory.cpp
+++ b/toolkit/components/places/nsNavHistory.cpp
@@ -2784,51 +2784,16 @@ nsNavHistory::RemoveVisitsByTimeframe(PR
 
   // Invalidate the cached value for whether there's history or not.
   mDaysOfHistory = -1;
 
   return NS_OK;
 }
 
 
-// nsNavHistory::RemoveAllPages
-//
-//    This function is used to clear history.
-
-NS_IMETHODIMP
-nsNavHistory::RemoveAllPages()
-{
-  PLACES_WARN_DEPRECATED();
-
-  NS_ASSERTION(NS_IsMainThread(), "This can only be called on the main thread");
-
-  nsresult rv = mDB->MainConn()->ExecuteSimpleSQL(NS_LITERAL_CSTRING(
-    "DELETE FROM moz_historyvisits"
-  ));
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  // Clear the registered embed visits.
-  clearEmbedVisits();
-
-  // Update the cached value for whether there's history or not.
-  mDaysOfHistory = 0;
-
-  // Expiration will take care of orphans.
-  NOTIFY_OBSERVERS(mCanNotify, mCacheObservers, mObservers,
-                   nsINavHistoryObserver, OnClearHistory());
-
-  // Invalidate frecencies for the remaining places.  This must happen
-  // after the notification to ensure it runs enqueued to expiration.
-  rv = invalidateFrecencies(EmptyCString());
-  NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "failed to fix invalid frecencies");
-
-  return NS_OK;
-}
-
-
 // Call this method before visiting a URL in order to help determine the
 // transition type of the visit.
 //
 // @see MarkPageAsFollowedBookmark
 
 NS_IMETHODIMP
 nsNavHistory::MarkPageAsTyped(nsIURI *aURI)
 {