From 7928338245da79e01e199aef52d0f7430a4dcddf Mon Sep 17 00:00:00 2001 From: Shawn Wilsher Date: Thu, 18 Feb 2010 10:05:15 -0800 Subject: [PATCH] Backed out changeset cf4d10139ec0 --- content/base/src/Link.cpp | 11 ++++------- content/base/src/Link.h | 2 -- toolkit/components/places/tests/cpp/mock_Link.h | 4 ---- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/content/base/src/Link.cpp b/content/base/src/Link.cpp index 10b77cbaf0a6..8acd27b796b4 100644 --- a/content/base/src/Link.cpp +++ b/content/base/src/Link.cpp @@ -58,11 +58,6 @@ Link::Link() { } -Link::~Link() -{ - UnregisterFromHistory(); -} - nsLinkState Link::GetLinkState() const { @@ -466,11 +461,13 @@ Link::UnregisterFromHistory() return; } - NS_ASSERTION(mCachedURI, "mRegistered is true, but we have no cached URI?!"); + // Obtain the URI that we registered with. + nsCOMPtr hrefURI(GetURI()); + NS_ASSERTION(hrefURI, "mRegistered is true, but we have no URI?!"); // And tell History to stop tracking us. IHistory *history = nsContentUtils::GetHistory(); - nsresult rv = history->UnregisterVisitedCallback(mCachedURI, this); + nsresult rv = history->UnregisterVisitedCallback(hrefURI, this); NS_ASSERTION(NS_SUCCEEDED(rv), "This should only fail if we misuse the API!"); if (NS_SUCCEEDED(rv)) { mRegistered = false; diff --git a/content/base/src/Link.h b/content/base/src/Link.h index 0e2619e2e2a5..c8d80fea0b2f 100644 --- a/content/base/src/Link.h +++ b/content/base/src/Link.h @@ -93,8 +93,6 @@ protected: */ virtual void ResetLinkState(); - virtual ~Link(); - private: /** * Unregisters from History so this node no longer gets notifications about diff --git a/toolkit/components/places/tests/cpp/mock_Link.h b/toolkit/components/places/tests/cpp/mock_Link.h index e2f01ceceb9e..aeed9f9eb435 100644 --- a/toolkit/components/places/tests/cpp/mock_Link.h +++ b/toolkit/components/places/tests/cpp/mock_Link.h @@ -94,10 +94,6 @@ Link::Link() { } -Link::~Link() -{ -} - nsLinkState Link::GetLinkState() const {