Bug 1323983 part 2 - Avoid sending response for native synthesis if there is no observer. r=smaug
MozReview-Commit-ID: 4skR41IaOs7
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -1243,18 +1243,19 @@ public:
{
MOZ_ASSERT(mTabParent);
}
NS_IMETHOD Observe(nsISupports* aSubject,
const char* aTopic,
const char16_t* aData) override
{
- if (!mTabParent) {
- // We already sent the notification
+ if (!mTabParent || !mObserverId) {
+ // We already sent the notification, or we don't actually need to
+ // send any notification at all.
return NS_OK;
}
if (!mTabParent->SendNativeSynthesisResponse(mObserverId, nsCString(aTopic))) {
NS_WARNING("Unable to send native event synthesization response!");
}
// Null out tabparent to indicate we already sent the response
mTabParent = nullptr;