Bug 1337619 - Reset mGoingToDispatchAllMessages flag before early return. r=baku draft
authorStone Shih <sshih@mozilla.com>
Fri, 03 Feb 2017 10:27:55 +0800
changeset 485861 0dfaf62025d3e73c5c6733a85ab7337c31eb5e6a
parent 485860 47e5c01413df0ee5e5bf1dcb6910dbed83e2d1ac
child 485862 c4deff449fa7391a0849b5bf7ca799bf29453f9e
push id45870
push userbmo:kechen@mozilla.com
push dateFri, 17 Feb 2017 09:36:54 +0000
reviewersbaku
bugs1337619
milestone54.0a1
Bug 1337619 - Reset mGoingToDispatchAllMessages flag before early return. r=baku MozReview-Commit-ID: LWKfJQ86A3W
dom/base/EventSource.cpp
--- a/dom/base/EventSource.cpp
+++ b/dom/base/EventSource.cpp
@@ -1439,22 +1439,22 @@ EventSourceImpl::DispatchCurrentMessageE
 
   return NS_OK;
 }
 
 void
 EventSourceImpl::DispatchAllMessageEvents()
 {
   AssertIsOnTargetThread();
+  mGoingToDispatchAllMessages = false;
+
   if (IsClosed() || IsFrozen()) {
     return;
   }
 
-  mGoingToDispatchAllMessages = false;
-
   nsresult rv = mEventSource->CheckInnerWindowCorrectness();
   if (NS_FAILED(rv)) {
     return;
   }
 
   AutoJSAPI jsapi;
   if (mIsMainThread) {
     if (NS_WARN_IF(!jsapi.Init(mEventSource->GetOwner()))) {