Merge mozilla-central to autoland
authorDorel Luca <dluca@mozilla.com>
Sat, 18 May 2019 13:30:06 +0300
changeset 474427 384bf576abc4732259092d43f2e02d0036168537
parent 474426 3dbd20c23a4334a5a21f4ad9f0ed5f0b9e78ff7e (current diff)
parent 474425 9b2f851979cb8d0dd0cd2618656eddee32e4f143 (diff)
child 474428 9fc0f690af5abfa8245d078f9c92099b3ca42bdf
push id113153
push userapavel@mozilla.com
push dateSat, 18 May 2019 21:48:51 +0000
treeherdermozilla-inbound@e013f1f17109 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central to autoland
--- a/dom/localstorage/ActorsParent.cpp
+++ b/dom/localstorage/ActorsParent.cpp
@@ -2961,17 +2961,17 @@ void AssertIsOnConnectionThread() {
 
 void InitUsageForOrigin(const nsACString& aOrigin, int64_t aUsage) {
   AssertIsOnIOThread();
 
   if (!gUsages) {
     gUsages = new UsageHashtable();
   }
 
-  MOZ_ASSERT(!gUsages->Contains(aOrigin));
+  MOZ_DIAGNOSTIC_ASSERT(!gUsages->Contains(aOrigin));
   gUsages->Put(aOrigin, aUsage);
 }
 
 bool GetUsageForOrigin(const nsACString& aOrigin, int64_t& aUsage) {
   AssertIsOnIOThread();
 
   if (gUsages) {
     int64_t usage;
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -973,18 +973,20 @@ NPError _geturlnotify(NPP aNPP, const ch
 
   if (!aNPP)  // nullptr check for nspluginwrapper (bug 561690)
     return NPERR_INVALID_INSTANCE_ERROR;
 
   nsCString url = NullableString(aRelativeURL);
   auto* sn = new StreamNotifyChild(url);
 
   NPError err;
-  InstCast(aNPP)->CallPStreamNotifyConstructor(sn, url, NullableString(aTarget),
-                                               false, nsCString(), false, &err);
+  if (!InstCast(aNPP)->CallPStreamNotifyConstructor(
+          sn, url, NullableString(aTarget), false, nsCString(), false, &err)) {
+    return NPERR_GENERIC_ERROR;
+  }
 
   if (NPERR_NO_ERROR == err) {
     // If NPN_PostURLNotify fails, the parent will immediately send us
     // a PStreamNotifyDestructor, which should not call NPP_URLNotify.
     sn->SetValid(aNotifyData);
   }
 
   return err;
@@ -1076,19 +1078,21 @@ NPError _posturlnotify(NPP aNPP, const c
         ("NPN_PostURLNotify with file=true is no longer supported"));
     return NPERR_GENERIC_ERROR;
   }
 
   nsCString url = NullableString(aRelativeURL);
   auto* sn = new StreamNotifyChild(url);
 
   NPError err;
-  InstCast(aNPP)->CallPStreamNotifyConstructor(
-      sn, url, NullableString(aTarget), true, nsCString(aBuffer, aLength),
-      aIsFile, &err);
+  if (!InstCast(aNPP)->CallPStreamNotifyConstructor(
+          sn, url, NullableString(aTarget), true, nsCString(aBuffer, aLength),
+          aIsFile, &err)) {
+    return NPERR_GENERIC_ERROR;
+  }
 
   if (NPERR_NO_ERROR == err) {
     // If NPN_PostURLNotify fails, the parent will immediately send us
     // a PStreamNotifyDestructor, which should not call NPP_URLNotify.
     sn->SetValid(aNotifyData);
   }
 
   return err;
--- a/ipc/ipdl/ipdl/lower.py
+++ b/ipc/ipdl/ipdl/lower.py
@@ -4128,30 +4128,48 @@ class _GenerateProtocolActorCode(ipdl.as
         actor = md.actorDecl()
         method = MethodDefn(self.makeSendMethodDecl(md))
         method.addstmts(self.bindManagedActor(actor) + [Whitespace.NL])
 
         msgvar, stmts = self.makeMessage(md, errfnSendCtor)
 
         replyvar = self.replyvar
         sendok, sendstmts = self.sendBlocking(md, msgvar, replyvar)
+
+        failIf = StmtIf(ExprNot(sendok))
+        failIf.addifstmt(_printWarningMessage('Error sending constructor'))
+        failIf.addifstmts(self.destroyActor(md, actor.var(),
+                                            why=_DestroyReason.FailedConstructor))
+        failIf.addifstmt(StmtReturn(ExprLiteral.NULL))
+
         method.addstmts(
+            # Build our constructor message & verify it.
             stmts
             + [Whitespace.NL,
                 StmtDecl(Decl(Type('Message'), replyvar.name))]
             + self.genVerifyMessage(md.decl.type.verify, md.params,
                                     errfnSendCtor, ExprVar('msg__'))
+
+            # Synchronously send the constructor message to the other side.
+            #
+            # If the MessageChannel is closing, and we haven't been told yet,
+            # this send may fail. This error is ignored to treat it like a
+            # message being lost due to the other side shutting down before
+            # processing it.
+            #
+            # NOTE: We also free the actor here.
             + sendstmts
-            + self.failCtorIf(md, ExprNot(sendok)))
-
-        def errfnCleanupCtor(msg):
-            return self.failCtorIf(md, ExprLiteral.TRUE)
+
+            # Warn, destroy the actor and return null if the message failed to
+            # send.
+            + [failIf])
+
         stmts = self.deserializeReply(
             md, ExprAddrOf(replyvar), self.side,
-            errfnCleanupCtor, errfnSentinel(ExprLiteral.NULL))
+            errfnSendCtor, errfnSentinel(ExprLiteral.NULL))
         method.addstmts(stmts + [StmtReturn(actor.var())])
 
         return method
 
     def bindManagedActor(self, actordecl, errfn=ExprLiteral.NULL, idexpr=None):
         actorvar = actordecl.var()
         actorproto = actordecl.ipdltype.protocol
         actortype = ipdl.type.ActorType(actorproto)
@@ -4172,30 +4190,16 @@ class _GenerateProtocolActorCode(ipdl.as
             # mManagedPFoo.PutEntry(actor);
             StmtExpr(_callInsertManagedActor(
                 self.protocol.managedVar(actorproto, self.side), actorvar)),
             # actor->mLivenessState = START;
             StmtExpr(ExprAssn(_actorState(actorvar),
                               _startState(actorproto.hasReentrantDelete))),
         ]
 
-    def failCtorIf(self, md, cond):
-        actorvar = md.actorDecl().var()
-        failif = StmtIf(cond)
-
-        if self.side == 'child':
-            # in the child process this should not fail
-            failif.addifstmt(_fatalError('constructor for actor failed'))
-        else:
-            failif.addifstmts(self.destroyActor(md, actorvar,
-                                                why=_DestroyReason.FailedConstructor))
-
-        failif.addifstmt(StmtReturn(ExprLiteral.NULL))
-        return [failif]
-
     def genHelperCtor(self, md):
         helperdecl = self.makeSendMethodDecl(md)
         helperdecl.params = helperdecl.params[1:]
         helper = MethodDefn(helperdecl)
 
         callctor = self.callAllocActor(md, retsems='out', side=self.side)
         helper.addstmt(StmtReturn(ExprCall(
             ExprVar(helperdecl.name), args=[callctor] + callctor.args)))
@@ -4938,17 +4942,18 @@ class _GenerateProtocolActorCode(ipdl.as
         else:
             assert not promise
             returnsems = 'out'
             rettype = Type.BOOL
         decl = MethodDecl(
             md.sendMethod(),
             params=md.makeCxxParams(paramsems, returnsems=returnsems,
                                     side=self.side, implicit=implicit),
-            warn_unused=(self.side == 'parent' and returnsems != 'callback'),
+            warn_unused=((self.side == 'parent' and returnsems != 'callback') or
+                         (md.decl.type.isCtor() and not md.decl.type.isAsync())),
             ret=rettype)
         if md.decl.type.isCtor():
             decl.ret = md.actorDecl().bareType(self.side)
         return decl
 
     def logMessage(self, md, msgptr, pfx, actor=None, receiving=False):
         actorname = _actorName(self.protocol.name, self.side)
 
--- a/layout/reftests/css-valuesandunits/reftest.list
+++ b/layout/reftests/css-valuesandunits/reftest.list
@@ -3,17 +3,17 @@
 == unit-rem-div-width-outer.html unit-rem-ref.html
 fuzzy-if(webrender&&winWidget,0-27,0-4) == unit-rem-iframe.html unit-rem-ref-iframe.html
 == unit-rem-root-fontsize.html unit-rem-ref-root-fontsize.html
 == unit-rem-root-fontsize.html unit-rem-ref2-root-fontsize.html
 == unit-rem-root-width.html unit-rem-ref-root-width.html
 == unit-rem.svg unit-rem-ref.svg
 == unit-vh-vw.html unit-vh-vw-ref.html
 == unit-vh-vw-zoom.html unit-vh-vw-zoom-ref.html
-skip-if(gtkWidget||cocoaWidget) == unit-vh-vw-overflow-auto.html unit-vh-vw-overflow-auto-ref.html
+fuzzy(0-1,0-4) == unit-vh-vw-overflow-auto.html unit-vh-vw-overflow-auto-ref.html # fuzzy due to anti-aliasing pixels in scrollbar redendering
 
 # These tests should probably be removed, see bug 1393603.
 fails-if(!Android) == unit-vh-vw-overflow-scroll.html unit-vh-vw-overflow-scroll-ref.html
 fails-if(!Android) == unit-vh-vw-overflow-scroll-x.html unit-vh-vw-overflow-scroll-x-ref.html
 fails-if(!Android) == unit-vh-vw-overflow-scroll-y.html unit-vh-vw-overflow-scroll-y-ref.html
 skip-if(Android) fuzzy-if(gtkWidget,0-1,0-2) fails != unit-vh-vw-overflow-auto.html unit-vh-vw-overflow-scroll.html
 
 == ch-width-1.html ch-width-1-ref.html