Merge for back out of changeset e6e0200b6e03 (bug 568969) because it appears to have caused orange on a CLOSED TREE.

This commit is contained in:
Shawn Wilsher 2010-08-06 11:54:03 -07:00
commit 21bbb0bd04
5 changed files with 23 additions and 7 deletions

View File

@ -140,6 +140,7 @@ typedef int (*PR_CALLBACK PrefChangedFunc)(const char *, void *);
#endif
namespace mozilla {
class IHistory;
namespace layers {
class LayerManager;
@ -498,6 +499,11 @@ public:
return sImgLoader;
}
static mozilla::IHistory* GetHistory()
{
return sHistory;
}
#ifdef MOZ_XTF
static nsIXTFService* GetXTFService();
#endif
@ -1720,6 +1726,8 @@ private:
static imgILoader* sImgLoader;
static imgICache* sImgCache;
static mozilla::IHistory* sHistory;
static nsIConsoleService* sConsoleService;
static nsDataHashtable<nsISupportsHashKey, EventNameMapping>* sAtomEventTable;

View File

@ -49,7 +49,6 @@
#include "mozAutoDocUpdate.h"
#include "mozilla/IHistory.h"
#include "mozilla/Services.h"
namespace mozilla {
namespace dom {
@ -129,7 +128,7 @@ Link::LinkState() const
}
// We have a good href, so register with History.
nsCOMPtr<IHistory> history = services::GetHistoryService();
IHistory *history = nsContentUtils::GetHistory();
nsresult rv = history->RegisterVisitedCallback(hrefURI, self);
if (NS_SUCCEEDED(rv)) {
self->mRegistered = true;
@ -509,7 +508,7 @@ Link::UnregisterFromHistory()
NS_ASSERTION(mCachedURI, "mRegistered is true, but we have no cached URI?!");
// And tell History to stop tracking us.
nsCOMPtr<IHistory> history = services::GetHistoryService();
IHistory *history = nsContentUtils::GetHistory();
nsresult rv = history->UnregisterVisitedCallback(mCachedURI, this);
NS_ASSERTION(NS_SUCCEEDED(rv), "This should only fail if we misuse the API!");
if (NS_SUCCEEDED(rv)) {

View File

@ -102,6 +102,7 @@
#include "imgIRequest.h"
#include "imgIContainer.h"
#include "imgILoader.h"
#include "mozilla/IHistory.h"
#include "nsDocShellCID.h"
#include "nsIImageLoadingContent.h"
#include "nsIInterfaceRequestor.h"
@ -229,6 +230,7 @@ nsIXTFService *nsContentUtils::sXTFService = nsnull;
nsIPrefBranch2 *nsContentUtils::sPrefBranch = nsnull;
imgILoader *nsContentUtils::sImgLoader;
imgICache *nsContentUtils::sImgCache;
mozilla::IHistory *nsContentUtils::sHistory;
nsIConsoleService *nsContentUtils::sConsoleService;
nsDataHashtable<nsISupportsHashKey, EventNameMapping>* nsContentUtils::sAtomEventTable = nsnull;
nsDataHashtable<nsStringHashKey, EventNameMapping>* nsContentUtils::sStringEventTable = nsnull;
@ -462,6 +464,12 @@ nsContentUtils::Init()
rv = CallGetService(NS_UNICHARCATEGORY_CONTRACTID, &sGenCat);
NS_ENSURE_SUCCESS(rv, rv);
rv = CallGetService(NS_IHISTORY_CONTRACTID, &sHistory);
if (NS_FAILED(rv)) {
NS_RUNTIMEABORT("Cannot get the history service");
return rv;
}
sPtrsToPtrsToRelease = new nsTArray<nsISupports**>();
if (!sPtrsToPtrsToRelease) {
return NS_ERROR_OUT_OF_MEMORY;
@ -1140,6 +1148,7 @@ nsContentUtils::Shutdown()
#endif
NS_IF_RELEASE(sImgLoader);
NS_IF_RELEASE(sImgCache);
NS_IF_RELEASE(sHistory);
NS_IF_RELEASE(sPrefBranch);
#ifdef IBMBIDI
NS_IF_RELEASE(sBidiKeyboard);

View File

@ -441,7 +441,7 @@ bool
ContentParent::RecvStartVisitedQuery(const IPC::URI& aURI)
{
nsCOMPtr<nsIURI> newURI(aURI);
nsCOMPtr<IHistory> history = services::GetHistoryService();
IHistory *history = nsContentUtils::GetHistory();
history->RegisterVisitedCallback(newURI, nsnull);
return true;
}
@ -454,7 +454,7 @@ ContentParent::RecvVisitURI(const IPC::URI& uri,
{
nsCOMPtr<nsIURI> ourURI(uri);
nsCOMPtr<nsIURI> ourReferrer(referrer);
nsCOMPtr<IHistory> history = services::GetHistoryService();
IHistory *history = nsContentUtils::GetHistory();
history->VisitURI(ourURI, ourReferrer, flags);
return true;
}
@ -465,7 +465,7 @@ ContentParent::RecvSetURITitle(const IPC::URI& uri,
const nsString& title)
{
nsCOMPtr<nsIURI> ourURI(uri);
nsCOMPtr<IHistory> history = services::GetHistoryService();
IHistory *history = nsContentUtils::GetHistory();
history->SetURITitle(ourURI, title);
return true;
}

View File

@ -260,7 +260,7 @@ class FailSafeFinishTask
{
public:
FailSafeFinishTask()
: mAppended(false)
: mAppended(false)
{
}