Bug 1285898 - [e10s-multi] fixup PContent ordering via immediate event dispatch. r=baku

This commit is contained in:
Andrew Sutherland
2017-01-31 03:42:38 -05:00
parent ab62b3f75f
commit 9dd61a8f4c
3 changed files with 19 additions and 5 deletions

View File

@@ -231,7 +231,7 @@ Storage::BroadcastChangeNotification(const nsSubstring& aKey,
}
DispatchStorageEvent(GetType(), mDocumentURI, aKey, aOldValue, aNewValue,
mPrincipal, mIsPrivate, this);
mPrincipal, mIsPrivate, this, false);
}
/* static */ void
@@ -242,7 +242,8 @@ Storage::DispatchStorageEvent(StorageType aStorageType,
const nsAString& aNewValue,
nsIPrincipal* aPrincipal,
bool aIsPrivate,
Storage* aStorage)
Storage* aStorage,
bool aImmediateDispatch)
{
StorageEventInit dict;
dict.mBubbles = false;
@@ -266,7 +267,12 @@ Storage::DispatchStorageEvent(StorageType aStorageType,
? u"localStorage"
: u"sessionStorage",
aIsPrivate);
NS_DispatchToMainThread(r);
if (aImmediateDispatch) {
Unused << r->Run();
} else {
NS_DispatchToMainThread(r);
}
// If we are in the parent process and we have the principal, we want to
// broadcast this event to every other process.