Backed out changeset e6e0200b6e03 (bug 568969) because it appears to have caused orange on a CLOSED TREE.
authorShawn Wilsher <sdwilsh@shawnwilsher.com>
Fri, 06 Aug 2010 11:53:39 -0700
changeset 49060 e88f6c524f3aeda886e7ee21f8ed9b467e946ec9
parent 49054 e6e0200b6e0325cda78b2634386a420da58f0431
child 49061 1e4f621a084dcaeb128576849f05a18b615bc20d
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs568969
milestone2.0b4pre
backs oute6e0200b6e0325cda78b2634386a420da58f0431
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset e6e0200b6e03 (bug 568969) because it appears to have caused orange on a CLOSED TREE.
content/base/public/nsContentUtils.h
content/base/src/Link.cpp
content/base/src/nsContentUtils.cpp
dom/ipc/ContentParent.cpp
toolkit/components/places/src/History.cpp
--- a/content/base/public/nsContentUtils.h
+++ b/content/base/public/nsContentUtils.h
@@ -135,16 +135,17 @@ class nsIChannel;
 struct nsIntMargin;
 
 #ifndef have_PrefChangedFunc_typedef
 typedef int (*PR_CALLBACK PrefChangedFunc)(const char *, void *);
 #define have_PrefChangedFunc_typedef
 #endif
 
 namespace mozilla {
+  class IHistory;
 
 namespace layers {
   class LayerManager;
 } // namespace layers
 
 namespace dom {
 class Element;
 } // namespace dom
@@ -493,16 +494,21 @@ public:
 
   static imgILoader* GetImgLoader()
   {
     if (!sImgLoaderInitialized)
       InitImgLoader();
     return sImgLoader;
   }
 
+  static mozilla::IHistory* GetHistory()
+  {
+    return sHistory;
+  }
+
 #ifdef MOZ_XTF
   static nsIXTFService* GetXTFService();
 #endif
 
 #ifdef IBMBIDI
   static nsIBidiKeyboard* GetBidiKeyboard();
 #endif
   
@@ -1715,16 +1721,18 @@ private:
 
   static bool sImgLoaderInitialized;
   static void InitImgLoader();
 
   // The following two members are initialized lazily
   static imgILoader* sImgLoader;
   static imgICache* sImgCache;
 
+  static mozilla::IHistory* sHistory;
+
   static nsIConsoleService* sConsoleService;
 
   static nsDataHashtable<nsISupportsHashKey, EventNameMapping>* sAtomEventTable;
   static nsDataHashtable<nsStringHashKey, EventNameMapping>* sStringEventTable;
   static nsCOMArray<nsIAtom>* sUserDefinedEvents;
 
   static nsIStringBundleService* sStringBundleService;
   static nsIStringBundle* sStringBundles[PropertiesFile_COUNT];
--- a/content/base/src/Link.cpp
+++ b/content/base/src/Link.cpp
@@ -44,17 +44,16 @@
 
 #include "nsContentUtils.h"
 #include "nsEscape.h"
 #include "nsGkAtoms.h"
 #include "nsString.h"
 #include "mozAutoDocUpdate.h"
 
 #include "mozilla/IHistory.h"
-#include "mozilla/Services.h"
 
 namespace mozilla {
 namespace dom {
 
 Link::Link()
   : mLinkState(defaultState)
   , mRegistered(false)
   , mContent(NULL)
@@ -124,17 +123,17 @@ Link::LinkState() const
     // First, make sure the href attribute has a valid link (bug 23209).
     nsCOMPtr<nsIURI> hrefURI(GetURI());
     if (!hrefURI) {
       self->mLinkState = eLinkState_NotLink;
       return 0;
     }
 
     // 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;
 
       // Assume that we are not visited until we are told otherwise.
       self->mLinkState = eLinkState_Unvisited;
 
       // And make sure we are in the document's link map.
@@ -504,17 +503,17 @@ Link::UnregisterFromHistory()
   // If we are not registered, we have nothing to do.
   if (!mRegistered) {
     return;
   }
 
   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)) {
     mRegistered = false;
   }
 }
 
 already_AddRefed<nsIURI>
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -97,16 +97,17 @@
 #include "nsIForm.h"
 #include "nsIFormControl.h"
 #include "nsGkAtoms.h"
 #include "nsISupportsPrimitives.h"
 #include "imgIDecoderObserver.h"
 #include "imgIRequest.h"
 #include "imgIContainer.h"
 #include "imgILoader.h"
+#include "mozilla/IHistory.h"
 #include "nsDocShellCID.h"
 #include "nsIImageLoadingContent.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsILoadGroup.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
 #include "nsContentPolicyUtils.h"
@@ -224,16 +225,17 @@ nsIParserService *nsContentUtils::sParse
 nsINameSpaceManager *nsContentUtils::sNameSpaceManager;
 nsIIOService *nsContentUtils::sIOService;
 #ifdef MOZ_XTF
 nsIXTFService *nsContentUtils::sXTFService = nsnull;
 #endif
 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;
 nsCOMArray<nsIAtom>* nsContentUtils::sUserDefinedEvents = nsnull;
 nsIStringBundleService *nsContentUtils::sStringBundleService;
 nsIStringBundle *nsContentUtils::sStringBundles[PropertiesFile_COUNT];
 nsIContentPolicy *nsContentUtils::sContentPolicyService;
 PRBool nsContentUtils::sTriedToGetContentPolicy = PR_FALSE;
@@ -457,16 +459,22 @@ nsContentUtils::Init()
   NS_ENSURE_SUCCESS(rv, rv);
   
   rv = CallGetService(NS_WBRK_CONTRACTID, &sWordBreaker);
   NS_ENSURE_SUCCESS(rv, rv);
 
   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;
   }
 
   if (!InitializeEventTable())
     return NS_ERROR_FAILURE;
 
@@ -1135,16 +1143,17 @@ nsContentUtils::Shutdown()
   NS_IF_RELEASE(sLineBreaker);
   NS_IF_RELEASE(sWordBreaker);
   NS_IF_RELEASE(sGenCat);
 #ifdef MOZ_XTF
   NS_IF_RELEASE(sXTFService);
 #endif
   NS_IF_RELEASE(sImgLoader);
   NS_IF_RELEASE(sImgCache);
+  NS_IF_RELEASE(sHistory);
   NS_IF_RELEASE(sPrefBranch);
 #ifdef IBMBIDI
   NS_IF_RELEASE(sBidiKeyboard);
 #endif
 
   delete sAtomEventTable;
   sAtomEventTable = nsnull;
   delete sStringEventTable;
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -436,41 +436,41 @@ ContentParent::RequestRunToCompletion()
     }
     return !!mRunToCompletionDepth;
 }
 
 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;
 }
 
 
 bool
 ContentParent::RecvVisitURI(const IPC::URI& uri,
                                    const IPC::URI& referrer,
                                    const PRUint32& flags)
 {
     nsCOMPtr<nsIURI> ourURI(uri);
     nsCOMPtr<nsIURI> ourReferrer(referrer);
-    nsCOMPtr<IHistory> history = services::GetHistoryService();
+    IHistory *history = nsContentUtils::GetHistory(); 
     history->VisitURI(ourURI, ourReferrer, flags);
     return true;
 }
 
 
 bool
 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;
 }
 
 /* void onDispatchedEvent (in nsIThreadInternal thread); */
 NS_IMETHODIMP
 ContentParent::OnDispatchedEvent(nsIThreadInternal *thread)
 {
--- a/toolkit/components/places/src/History.cpp
+++ b/toolkit/components/places/src/History.cpp
@@ -255,17 +255,17 @@ NS_IMPL_ISUPPORTS1(
  * your steps are finished, your task is finished.
  *
  * Be sure to use AppendTask to add your first step to the queue.
  */
 class FailSafeFinishTask
 {
 public:
   FailSafeFinishTask()
-  : mAppended(false)
+  : mAppended(false) 
   {
   }
 
   ~FailSafeFinishTask()
   {
     if (mAppended) {
       History::GetService()->CurrentTaskFinished();
     }