Bug 885247 - Remove History::GetPageTitle synchronous API. r=standard8
MozReview-Commit-ID: FleAOXBHyeK
--- a/toolkit/components/places/nsINavHistoryService.idl
+++ b/toolkit/components/places/nsINavHistoryService.idl
@@ -1311,22 +1311,16 @@ interface nsINavHistoryService : nsISupp
* True if there is any history. This can be used in UI to determine whether
* the "clear history" button should be enabled or not. This is much better
* than using BrowserHistory.count since that can be very slow if there is
* a lot of history (it must enumerate each item). This is pretty fast.
*/
readonly attribute boolean hasHistoryEntries;
/**
- * Gets the original title of the page.
- * @deprecated use PlacesUtils.history.fetch instead.
- */
- AString getPageTitle(in nsIURI aURI);
-
- /**
* This is just like markPageAsTyped (in nsIBrowserHistory, also implemented
* by the history service), but for bookmarks. It declares that the given URI
* is being opened as a result of following a bookmark. If this URI is loaded
* soon after this message has been received, that transition will be marked
* as following a bookmark.
*/
void markPageAsFollowedBookmark(in nsIURI aURI);
--- a/toolkit/components/places/nsNavHistory.cpp
+++ b/toolkit/components/places/nsNavHistory.cpp
@@ -2750,53 +2750,16 @@ nsNavHistory::MarkPageAsFollowedLink(nsI
if (mRecentLink.Count() > RECENT_EVENT_QUEUE_MAX_LENGTH)
ExpireNonrecentEvents(&mRecentLink);
return NS_OK;
}
-NS_IMETHODIMP
-nsNavHistory::GetPageTitle(nsIURI* aURI, nsAString& aTitle)
-{
- PLACES_WARN_DEPRECATED();
-
- NS_ASSERTION(NS_IsMainThread(), "This can only be called on the main thread");
- NS_ENSURE_ARG(aURI);
-
- aTitle.Truncate(0);
-
- nsCOMPtr<mozIStorageStatement> stmt = mDB->GetStatement(
- "SELECT id, url, title, rev_host, visit_count, guid "
- "FROM moz_places "
- "WHERE url_hash = hash(:page_url) AND url = :page_url "
- );
- NS_ENSURE_STATE(stmt);
- mozStorageStatementScoper scoper(stmt);
-
- nsresult rv = URIBinder::Bind(stmt, NS_LITERAL_CSTRING("page_url"), aURI);
- NS_ENSURE_SUCCESS(rv, rv);
-
- bool hasResults = false;
- rv = stmt->ExecuteStep(&hasResults);
- NS_ENSURE_SUCCESS(rv, rv);
-
- if (!hasResults) {
- aTitle.SetIsVoid(true);
- return NS_OK; // Not found, return a void string.
- }
-
- rv = stmt->GetString(2, aTitle);
- NS_ENSURE_SUCCESS(rv, rv);
-
- return NS_OK;
-}
-
-
////////////////////////////////////////////////////////////////////////////////
//// mozIStorageVacuumParticipant
NS_IMETHODIMP
nsNavHistory::GetDatabaseConnection(mozIStorageConnection** _DBConnection)
{
return GetDBConnection(_DBConnection);
}