Backed out changeset 060ce5929799

This commit is contained in:
Chris Jones 2011-07-13 22:25:05 -07:00
Родитель 2a90d26c77
Коммит 961e8a988c
2 изменённых файлов: 10 добавлений и 16 удалений

Просмотреть файл

@ -56,7 +56,6 @@
#include "nsNetUtil.h"
#include "nsIXPConnect.h"
#include "mozilla/Util.h"
#include "nsContentUtils.h"
// Initial size for the cache holding visited status observers.
#define VISIT_OBSERVERS_INITIAL_CACHE_SIZE 128
@ -1279,8 +1278,6 @@ History::NotifyVisited(nsIURI* aURI)
{
NS_ASSERTION(aURI, "Ruh-roh! A NULL URI was passed to us!");
nsAutoScriptBlocker scriptBlocker;
if (XRE_GetProcessType() == GeckoProcessType_Default) {
mozilla::dom::ContentParent* cpp =
mozilla::dom::ContentParent::GetSingleton(PR_FALSE);
@ -1301,17 +1298,14 @@ History::NotifyVisited(nsIURI* aURI)
return;
}
// Update status of each Link node.
{
// RemoveEntry will destroy the array, this iterator should not survive it.
ObserverArray::ForwardIterator iter(key->array);
while (iter.HasMore()) {
Link* link = iter.GetNext();
link->SetLinkState(eLinkState_Visited);
// Verify that the observers hash doesn't mutate while looping through
// the links associated with this URI.
MOZ_ASSERT(key == mObservers.GetEntry(aURI));
}
// Walk through the array, and update each Link node.
const ObserverArray& observers = key->array;
ObserverArray::index_type len = observers.Length();
for (ObserverArray::index_type i = 0; i < len; i++) {
Link* link = observers[i];
link->SetLinkState(eLinkState_Visited);
NS_ASSERTION(len == observers.Length(),
"Calling SetLinkState added or removed an observer!");
}
// All the registered nodes can now be removed for this URI.

Просмотреть файл

@ -46,7 +46,7 @@
#include "nsTHashtable.h"
#include "nsString.h"
#include "nsURIHashKey.h"
#include "nsTObserverArray.h"
#include "nsTArray.h"
#include "nsDeque.h"
#include "nsIObserver.h"
#include "mozIStorageConnection.h"
@ -167,7 +167,7 @@ private:
// Ensures new tasks aren't started on destruction.
bool mShuttingDown;
typedef nsTObserverArray<mozilla::dom::Link* > ObserverArray;
typedef nsTArray<mozilla::dom::Link* > ObserverArray;
class KeyClass : public nsURIHashKey
{