Merge mozilla-inbound to mozilla-central. a=merge
authorDorel Luca <dluca@mozilla.com>
Sat, 18 May 2019 13:25:28 +0300
changeset 536327 9b2f851979cb8d0dd0cd2618656eddee32e4f143
parent 536323 82437bfbc17b5ea4f90839b3c1b67b92e5fee23d (current diff)
parent 536326 87325e3589128e149794637b698a51567b94f28b (diff)
child 536328 384bf576abc4732259092d43f2e02d0036168537
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone68.0a1
first release with
nightly linux32
9b2f851979cb / 68.0a1 / 20190518102559 / files
nightly linux64
9b2f851979cb / 68.0a1 / 20190518102559 / files
nightly mac
9b2f851979cb / 68.0a1 / 20190518102559 / files
nightly win32
9b2f851979cb / 68.0a1 / 20190518102559 / files
nightly win64
9b2f851979cb / 68.0a1 / 20190518102559 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-inbound to mozilla-central. a=merge
dom/localstorage/ActorsParent.cpp
--- 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