Bug 676110 - Part 3b: Remove double enqueuing from PlacesEvent. r=mak

--HG--
extra : rebase_source : cfd6970c8de81b2cdd81329084ca79516d02104e
This commit is contained in:
Philipp von Weitershausen 2011-08-19 10:12:11 -07:00
Родитель 3e9348d717
Коммит c5114c7599
2 изменённых файлов: 4 добавлений и 20 удалений

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

@ -377,14 +377,6 @@ GetHiddenState(bool aIsRedirect,
PlacesEvent::PlacesEvent(const char* aTopic) PlacesEvent::PlacesEvent(const char* aTopic)
: mTopic(aTopic) : mTopic(aTopic)
, mDoubleEnqueue(false)
{
}
PlacesEvent::PlacesEvent(const char* aTopic,
bool aDoubleEnqueue)
: mTopic(aTopic)
, mDoubleEnqueue(aDoubleEnqueue)
{ {
} }
@ -405,16 +397,10 @@ PlacesEvent::Complete()
void void
PlacesEvent::Notify() PlacesEvent::Notify()
{ {
if (mDoubleEnqueue) { NS_ASSERTION(NS_IsMainThread(), "Must only be used on the main thread!");
mDoubleEnqueue = false; nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
(void)NS_DispatchToMainThread(this); if (obs) {
} (void)obs->NotifyObservers(nsnull, mTopic, nsnull);
else {
NS_ASSERTION(NS_IsMainThread(), "Must only be used on the main thread!");
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
if (obs) {
(void)obs->NotifyObservers(nsnull, mTopic, nsnull);
}
} }
} }

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

@ -298,12 +298,10 @@ public:
NS_DECL_MOZISTORAGECOMPLETIONCALLBACK NS_DECL_MOZISTORAGECOMPLETIONCALLBACK
PlacesEvent(const char* aTopic); PlacesEvent(const char* aTopic);
PlacesEvent(const char* aTopic, bool aDoubleEnqueue);
protected: protected:
void Notify(); void Notify();
const char* const mTopic; const char* const mTopic;
bool mDoubleEnqueue;
}; };
} // namespace places } // namespace places