зеркало из https://github.com/mozilla/gecko-dev.git
Bug 676110 - Part 3b: Remove double enqueuing from PlacesEvent. r=mak
--HG-- extra : rebase_source : cfd6970c8de81b2cdd81329084ca79516d02104e
This commit is contained in:
Родитель
3e9348d717
Коммит
c5114c7599
|
@ -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
|
||||||
|
|
Загрузка…
Ссылка в новой задаче