merge mozilla-inbound to mozilla-central a=merge
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 02 Nov 2015 11:54:07 +0100
changeset 270742 451a185791433bce1a6a894c27f3da60a3119431
parent 270741 fc0b155bdac7a43d28c13e0cdd281a7928e64e09 (current diff)
parent 270660 826e977db3bbcb991d77ca98d54d6509be33a5cb (diff)
child 270743 f45fb9a0db0e20a376e4d2b97a6e2a9799db319e
child 270825 f9bc72b08ea3451d4e1f92a22447b2bd7ad80c5b
child 270848 cbb27a88e499604c4bf0be54eb5373a001f8cf62
push id67436
push usercbook@mozilla.com
push dateMon, 02 Nov 2015 11:04:40 +0000
treeherdermozilla-inbound@f45fb9a0db0e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone45.0a1
first release with
nightly linux32
451a18579143 / 45.0a1 / 20151102030241 / files
nightly linux64
451a18579143 / 45.0a1 / 20151102030241 / files
nightly mac
451a18579143 / 45.0a1 / 20151102030241 / files
nightly win32
451a18579143 / 45.0a1 / 20151102030241 / files
nightly win64
451a18579143 / 45.0a1 / 20151102030241 / 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/base/crashtests/713417.html
dom/workers/test/1158031.html
dom/workers/test/779707.html
dom/workers/test/943516.html
dom/workers/test/crashtests.list
editor/crashtests.list
layout/generic/crashtests/812879.html
layout/generic/crashtests/first-letter-638937.html
--- a/accessible/base/NotificationController.cpp
+++ b/accessible/base/NotificationController.cpp
@@ -225,22 +225,21 @@ NotificationController::WillRefresh(mozi
       NS_ASSERTION(!textAcc,
                    "Text node isn't rendered but accessible is kept alive!");
       continue;
     }
 
     nsIContent* containerElm = containerNode->IsElement() ?
       containerNode->AsElement() : nullptr;
 
-    nsAutoString text;
-    textFrame->GetRenderedText(&text);
+    nsIFrame::RenderedText text = textFrame->GetRenderedText();
 
     // Remove text accessible if rendered text is empty.
     if (textAcc) {
-      if (text.IsEmpty()) {
+      if (text.mString.IsEmpty()) {
   #ifdef A11Y_LOG
         if (logging::IsEnabled(logging::eTree | logging::eText)) {
           logging::MsgBegin("TREE", "text node lost its content");
           logging::Node("container", containerElm);
           logging::Node("content", textNode);
           logging::MsgEnd();
         }
   #endif
@@ -253,27 +252,27 @@ NotificationController::WillRefresh(mozi
   #ifdef A11Y_LOG
       if (logging::IsEnabled(logging::eText)) {
         logging::MsgBegin("TEXT", "text may be changed");
         logging::Node("container", containerElm);
         logging::Node("content", textNode);
         logging::MsgEntry("old text '%s'",
                           NS_ConvertUTF16toUTF8(textAcc->AsTextLeaf()->Text()).get());
         logging::MsgEntry("new text: '%s'",
-                          NS_ConvertUTF16toUTF8(text).get());
+                          NS_ConvertUTF16toUTF8(text.mString).get());
         logging::MsgEnd();
       }
   #endif
 
-      TextUpdater::Run(mDocument, textAcc->AsTextLeaf(), text);
+      TextUpdater::Run(mDocument, textAcc->AsTextLeaf(), text.mString);
       continue;
     }
 
     // Append an accessible if rendered text is not empty.
-    if (!text.IsEmpty()) {
+    if (!text.mString.IsEmpty()) {
   #ifdef A11Y_LOG
       if (logging::IsEnabled(logging::eTree | logging::eText)) {
         logging::MsgBegin("TREE", "text node gains new content");
         logging::Node("container", containerElm);
         logging::Node("content", textNode);
         logging::MsgEnd();
       }
   #endif
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -1086,34 +1086,33 @@ nsAccessibilityService::GetOrCreateAcces
                "Image map manages the area accessible creation!");
 #endif
 
   // Attempt to create an accessible based on what we know.
   RefPtr<Accessible> newAcc;
 
   // Create accessible for visible text frames.
   if (content->IsNodeOfType(nsINode::eTEXT)) {
-    nsAutoString text;
-    frame->GetRenderedText(&text, nullptr, nullptr, 0, UINT32_MAX);
+    nsIFrame::RenderedText text = frame->GetRenderedText();
     // Ignore not rendered text nodes and whitespace text nodes between table
     // cells.
-    if (text.IsEmpty() ||
-        (aContext->IsTableRow() && nsCoreUtils::IsWhitespaceString(text))) {
+    if (text.mString.IsEmpty() ||
+        (aContext->IsTableRow() && nsCoreUtils::IsWhitespaceString(text.mString))) {
       if (aIsSubtreeHidden)
         *aIsSubtreeHidden = true;
 
       return nullptr;
     }
 
     newAcc = CreateAccessibleByFrameType(frame, content, aContext);
     if (!aContext->IsAcceptableChild(newAcc))
       return nullptr;
 
     document->BindToDocument(newAcc, nullptr);
-    newAcc->AsTextLeaf()->SetText(text);
+    newAcc->AsTextLeaf()->SetText(text.mString);
     return newAcc;
   }
 
   if (content->IsHTMLElement(nsGkAtoms::map)) {
     // Create hyper text accessible for HTML map if it is used to group links
     // (see http://www.w3.org/TR/WCAG10-HTML-TECHS/#group-bypass). If the HTML
     // map rect is empty then it is used for links grouping. Otherwise it should
     // be used in conjunction with HTML image element and in this case we don't
--- a/accessible/base/nsTextEquivUtils.cpp
+++ b/accessible/base/nsTextEquivUtils.cpp
@@ -134,18 +134,18 @@ nsTextEquivUtils::AppendTextEquivFromTex
           }
         }
       }
     }
     
     if (aContent->TextLength() > 0) {
       nsIFrame *frame = aContent->GetPrimaryFrame();
       if (frame) {
-        nsresult rv = frame->GetRenderedText(aString);
-        NS_ENSURE_SUCCESS(rv, rv);
+        nsIFrame::RenderedText text = frame->GetRenderedText();
+        aString->Append(text.mString);
       } else {
         // If aContent is an object that is display: none, we have no a frame.
         aContent->AppendTextTo(*aString);
       }
       if (isHTMLBlock && !aString->IsEmpty()) {
         aString->Append(char16_t(' '));
       }
     }
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -389,20 +389,20 @@ Accessible::VisibilityState()
   // Zero area rects can occur in the first frame of a multi-frame text flow,
   // in which case the rendered text is not empty and the frame should not be
   // marked invisible.
   // XXX Can we just remove this check? Why do we need to mark empty
   // text invisible?
   if (frame->GetType() == nsGkAtoms::textFrame &&
       !(frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) &&
       frame->GetRect().IsEmpty()) {
-    nsAutoString renderedText;
-    frame->GetRenderedText(&renderedText, nullptr, nullptr, 0, 1);
-    if (renderedText.IsEmpty())
+    nsIFrame::RenderedText text = frame->GetRenderedText();
+    if (text.mString.IsEmpty()) {
       return states::INVISIBLE;
+    }
   }
 
   return 0;
 }
 
 uint64_t
 Accessible::NativeState()
 {
--- a/accessible/generic/HyperTextAccessible.cpp
+++ b/accessible/generic/HyperTextAccessible.cpp
@@ -1979,27 +1979,19 @@ HyperTextAccessible::ContentToRenderedOf
     return NS_OK;
   }
 
   NS_ASSERTION(aFrame->GetType() == nsGkAtoms::textFrame,
                "Need text frame for offset conversion");
   NS_ASSERTION(aFrame->GetPrevContinuation() == nullptr,
                "Call on primary frame only");
 
-  gfxSkipChars skipChars;
-  gfxSkipCharsIterator iter;
-  // Only get info up to original offset, we know that will be larger than skipped offset
-  nsresult rv = aFrame->GetRenderedText(nullptr, &skipChars, &iter, 0, aContentOffset);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  uint32_t ourRenderedStart = iter.GetSkippedOffset();
-  int32_t ourContentStart = iter.GetOriginalOffset();
-
-  *aRenderedOffset = iter.ConvertOriginalToSkipped(aContentOffset + ourContentStart) -
-                    ourRenderedStart;
+  nsIFrame::RenderedText text = aFrame->GetRenderedText(aContentOffset,
+      aContentOffset + 1);
+  *aRenderedOffset = text.mOffsetWithinNodeRenderedText;
 
   return NS_OK;
 }
 
 nsresult
 HyperTextAccessible::RenderedToContentOffset(nsIFrame* aFrame, uint32_t aRenderedOffset,
                                              int32_t* aContentOffset) const
 {
@@ -2011,26 +2003,19 @@ HyperTextAccessible::RenderedToContentOf
   *aContentOffset = 0;
   NS_ENSURE_TRUE(aFrame, NS_ERROR_FAILURE);
 
   NS_ASSERTION(aFrame->GetType() == nsGkAtoms::textFrame,
                "Need text frame for offset conversion");
   NS_ASSERTION(aFrame->GetPrevContinuation() == nullptr,
                "Call on primary frame only");
 
-  gfxSkipChars skipChars;
-  gfxSkipCharsIterator iter;
-  // We only need info up to skipped offset -- that is what we're converting to original offset
-  nsresult rv = aFrame->GetRenderedText(nullptr, &skipChars, &iter, 0, aRenderedOffset);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  uint32_t ourRenderedStart = iter.GetSkippedOffset();
-  int32_t ourContentStart = iter.GetOriginalOffset();
-
-  *aContentOffset = iter.ConvertSkippedToOriginal(aRenderedOffset + ourRenderedStart) - ourContentStart;
+  nsIFrame::RenderedText text = aFrame->GetRenderedText(aRenderedOffset,
+      aRenderedOffset + 1, nsIFrame::TextOffsetType::OFFSETS_IN_RENDERED_TEXT);
+  *aContentOffset = text.mOffsetWithinNodeText;
 
   return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HyperTextAccessible public
 
 int32_t
--- a/accessible/ipc/ProxyAccessible.cpp
+++ b/accessible/ipc/ProxyAccessible.cpp
@@ -75,63 +75,63 @@ ProxyAccessible::MustPruneChildren() con
   return mChildren[0]->Role() == roles::TEXT_LEAF
     || mChildren[0]->Role() == roles::STATICTEXT;
 }
 
 uint64_t
 ProxyAccessible::State() const
 {
   uint64_t state = 0;
-  unused << mDoc->SendState(mID, &state);
+  Unused << mDoc->SendState(mID, &state);
   return state;
 }
 
 uint64_t
 ProxyAccessible::NativeState() const
 {
   uint64_t state = 0;
-  unused << mDoc->SendNativeState(mID, &state);
+  Unused << mDoc->SendNativeState(mID, &state);
   return state;
 }
 
 void
 ProxyAccessible::Name(nsString& aName) const
 {
-  unused << mDoc->SendName(mID, &aName);
+  Unused << mDoc->SendName(mID, &aName);
 }
 
 void
 ProxyAccessible::Value(nsString& aValue) const
 {
-  unused << mDoc->SendValue(mID, &aValue);
+  Unused << mDoc->SendValue(mID, &aValue);
 }
 
 void
 ProxyAccessible::Help(nsString& aHelp) const
 {
-  unused << mDoc->SendHelp(mID, &aHelp);
+  Unused << mDoc->SendHelp(mID, &aHelp);
 }
 
 void
 ProxyAccessible::Description(nsString& aDesc) const
 {
-  unused << mDoc->SendDescription(mID, &aDesc);
+  Unused << mDoc->SendDescription(mID, &aDesc);
 }
 
 void
 ProxyAccessible::Attributes(nsTArray<Attribute> *aAttrs) const
 {
-  unused << mDoc->SendAttributes(mID, aAttrs);
+  Unused << mDoc->SendAttributes(mID, aAttrs);
 }
 
 nsTArray<ProxyAccessible*>
 ProxyAccessible::RelationByType(RelationType aType) const
 {
   nsTArray<uint64_t> targetIDs;
-  unused << mDoc->SendRelationByType(mID, static_cast<uint32_t>(aType),
+  Unused << mDoc->SendRelationByType(mID, static_cast<uint32_t>(aType),
                                      &targetIDs);
 
   size_t targetCount = targetIDs.Length();
   nsTArray<ProxyAccessible*> targets(targetCount);
   for (size_t i = 0; i < targetCount; i++)
     if (ProxyAccessible* proxy = mDoc->GetAccessible(targetIDs[i]))
       targets.AppendElement(proxy);
 
@@ -139,17 +139,17 @@ ProxyAccessible::RelationByType(Relation
 }
 
 void
 ProxyAccessible::Relations(nsTArray<RelationType>* aTypes,
                            nsTArray<nsTArray<ProxyAccessible*>>* aTargetSets)
   const
 {
   nsTArray<RelationTargets> ipcRelations;
-  unused << mDoc->SendRelations(mID, &ipcRelations);
+  Unused << mDoc->SendRelations(mID, &ipcRelations);
 
   size_t relationCount = ipcRelations.Length();
   aTypes->SetCapacity(relationCount);
   aTargetSets->SetCapacity(relationCount);
   for (size_t i = 0; i < relationCount; i++) {
     uint32_t type = ipcRelations[i].Type();
     if (type > static_cast<uint32_t>(RelationType::LAST))
       continue;
@@ -167,977 +167,977 @@ ProxyAccessible::Relations(nsTArray<Rela
     aTypes->AppendElement(static_cast<RelationType>(type));
   }
 }
 
 bool
 ProxyAccessible::IsSearchbox() const
 {
   bool retVal = false;
-  unused << mDoc->SendIsSearchbox(mID, &retVal);
+  Unused << mDoc->SendIsSearchbox(mID, &retVal);
   return retVal;
 }
 
 nsIAtom*
 ProxyAccessible::LandmarkRole() const
 {
   nsString landmark;
-  unused << mDoc->SendLandmarkRole(mID, &landmark);
+  Unused << mDoc->SendLandmarkRole(mID, &landmark);
   return NS_GetStaticAtom(landmark);
 }
 
 nsIAtom*
 ProxyAccessible::ARIARoleAtom() const
 {
   nsString role;
-  unused << mDoc->SendARIARoleAtom(mID, &role);
+  Unused << mDoc->SendARIARoleAtom(mID, &role);
   return NS_GetStaticAtom(role);
 }
 
 int32_t
 ProxyAccessible::GetLevelInternal()
 {
   int32_t level = 0;
-  unused << mDoc->SendGetLevelInternal(mID, &level);
+  Unused << mDoc->SendGetLevelInternal(mID, &level);
   return level;
 }
 
 int32_t
 ProxyAccessible::CaretLineNumber()
 {
   int32_t line = -1;
-  unused << mDoc->SendCaretOffset(mID, &line);
+  Unused << mDoc->SendCaretOffset(mID, &line);
   return line;
 }
 
 int32_t
 ProxyAccessible::CaretOffset()
 {
   int32_t offset = 0;
-  unused << mDoc->SendCaretOffset(mID, &offset);
+  Unused << mDoc->SendCaretOffset(mID, &offset);
   return offset;
 }
 
 void
 ProxyAccessible::SetCaretOffset(int32_t aOffset)
 {
-  unused << mDoc->SendSetCaretOffset(mID, aOffset);
+  Unused << mDoc->SendSetCaretOffset(mID, aOffset);
 }
 
 int32_t
 ProxyAccessible::CharacterCount()
 {
   int32_t count = 0;
-  unused << mDoc->SendCharacterCount(mID, &count);
+  Unused << mDoc->SendCharacterCount(mID, &count);
   return count;
 }
 
 int32_t
 ProxyAccessible::SelectionCount()
 {
   int32_t count = 0;
-  unused << mDoc->SendSelectionCount(mID, &count);
+  Unused << mDoc->SendSelectionCount(mID, &count);
   return count;
 }
 
 bool
 ProxyAccessible::TextSubstring(int32_t aStartOffset, int32_t aEndOfset,
                                nsString& aText) const
 {
   bool valid;
-  unused << mDoc->SendTextSubstring(mID, aStartOffset, aEndOfset, &aText, &valid);
+  Unused << mDoc->SendTextSubstring(mID, aStartOffset, aEndOfset, &aText, &valid);
   return valid;
 }
 
 void
 ProxyAccessible::GetTextAfterOffset(int32_t aOffset,
                                     AccessibleTextBoundary aBoundaryType,
                                     nsString& aText, int32_t* aStartOffset,
                                     int32_t* aEndOffset)
 {
-  unused << mDoc->SendGetTextAfterOffset(mID, aOffset, aBoundaryType,
+  Unused << mDoc->SendGetTextAfterOffset(mID, aOffset, aBoundaryType,
                                          &aText, aStartOffset, aEndOffset);
 }
 
 void
 ProxyAccessible::GetTextAtOffset(int32_t aOffset,
                                  AccessibleTextBoundary aBoundaryType,
                                  nsString& aText, int32_t* aStartOffset,
                                  int32_t* aEndOffset)
 {
-  unused << mDoc->SendGetTextAtOffset(mID, aOffset, aBoundaryType,
+  Unused << mDoc->SendGetTextAtOffset(mID, aOffset, aBoundaryType,
                                       &aText, aStartOffset, aEndOffset);
 }
 
 void
 ProxyAccessible::GetTextBeforeOffset(int32_t aOffset,
                                      AccessibleTextBoundary aBoundaryType,
                                      nsString& aText, int32_t* aStartOffset,
                                      int32_t* aEndOffset)
 {
-  unused << mDoc->SendGetTextBeforeOffset(mID, aOffset, aBoundaryType,
+  Unused << mDoc->SendGetTextBeforeOffset(mID, aOffset, aBoundaryType,
                                           &aText, aStartOffset, aEndOffset);
 }
 
 char16_t
 ProxyAccessible::CharAt(int32_t aOffset)
 {
   uint16_t retval = 0;
-  unused << mDoc->SendCharAt(mID, aOffset, &retval);
+  Unused << mDoc->SendCharAt(mID, aOffset, &retval);
   return static_cast<char16_t>(retval);
 }
 
 void
 ProxyAccessible::TextAttributes(bool aIncludeDefAttrs,
                                 int32_t aOffset,
                                 nsTArray<Attribute>* aAttributes,
                                 int32_t* aStartOffset,
                                 int32_t* aEndOffset)
 {
-  unused << mDoc->SendTextAttributes(mID, aIncludeDefAttrs, aOffset,
+  Unused << mDoc->SendTextAttributes(mID, aIncludeDefAttrs, aOffset,
                                      aAttributes, aStartOffset, aEndOffset);
 }
 
 void
 ProxyAccessible::DefaultTextAttributes(nsTArray<Attribute>* aAttrs)
 {
-  unused << mDoc->SendDefaultTextAttributes(mID, aAttrs);
+  Unused << mDoc->SendDefaultTextAttributes(mID, aAttrs);
 }
 
 nsIntRect
 ProxyAccessible::TextBounds(int32_t aStartOffset, int32_t aEndOffset,
                             uint32_t aCoordType)
 {
   nsIntRect rect;
-  unused <<
+  Unused <<
     mDoc->SendTextBounds(mID, aStartOffset, aEndOffset, aCoordType, &rect);
   return rect;
 }
 
 nsIntRect
 ProxyAccessible::CharBounds(int32_t aOffset, uint32_t aCoordType)
 {
   nsIntRect rect;
-  unused <<
+  Unused <<
     mDoc->SendCharBounds(mID, aOffset, aCoordType, &rect);
   return rect;
 }
 
 int32_t
 ProxyAccessible::OffsetAtPoint(int32_t aX, int32_t aY, uint32_t aCoordType)
 {
   int32_t retVal = -1;
-  unused << mDoc->SendOffsetAtPoint(mID, aX, aY, aCoordType, &retVal);
+  Unused << mDoc->SendOffsetAtPoint(mID, aX, aY, aCoordType, &retVal);
   return retVal;
 }
 
 bool
 ProxyAccessible::SelectionBoundsAt(int32_t aSelectionNum,
                                    nsString& aData,
                                    int32_t* aStartOffset,
                                    int32_t* aEndOffset)
 {
   bool retVal = false;
-  unused << mDoc->SendSelectionBoundsAt(mID, aSelectionNum, &retVal, &aData,
+  Unused << mDoc->SendSelectionBoundsAt(mID, aSelectionNum, &retVal, &aData,
                                         aStartOffset, aEndOffset);
   return retVal;
 }
 
 bool
 ProxyAccessible::SetSelectionBoundsAt(int32_t aSelectionNum,
                                       int32_t aStartOffset,
                                       int32_t aEndOffset)
 {
   bool retVal = false;
-  unused << mDoc->SendSetSelectionBoundsAt(mID, aSelectionNum, aStartOffset,
+  Unused << mDoc->SendSetSelectionBoundsAt(mID, aSelectionNum, aStartOffset,
                                            aEndOffset, &retVal);
   return retVal;
 }
 
 bool
 ProxyAccessible::AddToSelection(int32_t aStartOffset,
                                 int32_t aEndOffset)
 {
   bool retVal = false;
-  unused << mDoc->SendAddToSelection(mID, aStartOffset, aEndOffset, &retVal);
+  Unused << mDoc->SendAddToSelection(mID, aStartOffset, aEndOffset, &retVal);
   return retVal;
 }
 
 bool
 ProxyAccessible::RemoveFromSelection(int32_t aSelectionNum)
 {
   bool retVal = false;
-  unused << mDoc->SendRemoveFromSelection(mID, aSelectionNum, &retVal);
+  Unused << mDoc->SendRemoveFromSelection(mID, aSelectionNum, &retVal);
   return retVal;
 }
 
 void
 ProxyAccessible::ScrollSubstringTo(int32_t aStartOffset, int32_t aEndOffset,
                                    uint32_t aScrollType)
 {
-  unused << mDoc->SendScrollSubstringTo(mID, aStartOffset, aEndOffset, aScrollType);
+  Unused << mDoc->SendScrollSubstringTo(mID, aStartOffset, aEndOffset, aScrollType);
 }
 
 void
 ProxyAccessible::ScrollSubstringToPoint(int32_t aStartOffset,
                                         int32_t aEndOffset,
                                         uint32_t aCoordinateType,
                                         int32_t aX, int32_t aY)
 {
-  unused << mDoc->SendScrollSubstringToPoint(mID, aStartOffset, aEndOffset,
+  Unused << mDoc->SendScrollSubstringToPoint(mID, aStartOffset, aEndOffset,
                                              aCoordinateType, aX, aY);
 }
 
 void
 ProxyAccessible::Text(nsString* aText)
 {
-  unused << mDoc->SendText(mID, aText);
+  Unused << mDoc->SendText(mID, aText);
 }
 
 void
 ProxyAccessible::ReplaceText(const nsString& aText)
 {
-  unused << mDoc->SendReplaceText(mID, aText);
+  Unused << mDoc->SendReplaceText(mID, aText);
 }
 
 bool
 ProxyAccessible::InsertText(const nsString& aText, int32_t aPosition)
 {
   bool valid;
-  unused << mDoc->SendInsertText(mID, aText, aPosition, &valid);
+  Unused << mDoc->SendInsertText(mID, aText, aPosition, &valid);
   return valid;
 }
 
 bool
 ProxyAccessible::CopyText(int32_t aStartPos, int32_t aEndPos)
 {
   bool valid;
-  unused << mDoc->SendCopyText(mID, aStartPos, aEndPos, &valid);
+  Unused << mDoc->SendCopyText(mID, aStartPos, aEndPos, &valid);
   return valid;
 }
 
 bool
 ProxyAccessible::CutText(int32_t aStartPos, int32_t aEndPos)
 {
   bool valid;
-  unused << mDoc->SendCutText(mID, aStartPos, aEndPos, &valid);
+  Unused << mDoc->SendCutText(mID, aStartPos, aEndPos, &valid);
   return valid;
 }
 
 bool
 ProxyAccessible::DeleteText(int32_t aStartPos, int32_t aEndPos)
 {
   bool valid;
-  unused << mDoc->SendDeleteText(mID, aStartPos, aEndPos, &valid);
+  Unused << mDoc->SendDeleteText(mID, aStartPos, aEndPos, &valid);
   return valid;
 }
 
 bool
 ProxyAccessible::PasteText(int32_t aPosition)
 {
   bool valid;
-  unused << mDoc->SendPasteText(mID, aPosition, &valid);
+  Unused << mDoc->SendPasteText(mID, aPosition, &valid);
   return valid;
 }
 
 nsIntPoint
 ProxyAccessible::ImagePosition(uint32_t aCoordType)
 {
   nsIntPoint retVal;
-  unused << mDoc->SendImagePosition(mID, aCoordType, &retVal);
+  Unused << mDoc->SendImagePosition(mID, aCoordType, &retVal);
   return retVal;
 }
 
 nsIntSize
 ProxyAccessible::ImageSize()
 {
   nsIntSize retVal;
-  unused << mDoc->SendImageSize(mID, &retVal);
+  Unused << mDoc->SendImageSize(mID, &retVal);
   return retVal;
 }
 
 uint32_t
 ProxyAccessible::StartOffset(bool* aOk)
 {
   uint32_t retVal = 0;
-  unused << mDoc->SendStartOffset(mID, &retVal, aOk);
+  Unused << mDoc->SendStartOffset(mID, &retVal, aOk);
   return retVal;
 }
 
 uint32_t
 ProxyAccessible::EndOffset(bool* aOk)
 {
   uint32_t retVal = 0;
-  unused << mDoc->SendEndOffset(mID, &retVal, aOk);
+  Unused << mDoc->SendEndOffset(mID, &retVal, aOk);
   return retVal;
 }
 
 bool
 ProxyAccessible::IsLinkValid()
 {
   bool retVal = false;
-  unused << mDoc->SendIsLinkValid(mID, &retVal);
+  Unused << mDoc->SendIsLinkValid(mID, &retVal);
   return retVal;
 }
 
 uint32_t
 ProxyAccessible::AnchorCount(bool* aOk)
 {
   uint32_t retVal = 0;
-  unused << mDoc->SendAnchorCount(mID, &retVal, aOk);
+  Unused << mDoc->SendAnchorCount(mID, &retVal, aOk);
   return retVal;
 }
 
 void
 ProxyAccessible::AnchorURIAt(uint32_t aIndex, nsCString& aURI, bool* aOk)
 {
-  unused << mDoc->SendAnchorURIAt(mID, aIndex, &aURI, aOk);
+  Unused << mDoc->SendAnchorURIAt(mID, aIndex, &aURI, aOk);
 }
 
 ProxyAccessible*
 ProxyAccessible::AnchorAt(uint32_t aIndex)
 {
   uint64_t id = 0;
   bool ok = false;
-  unused << mDoc->SendAnchorAt(mID, aIndex, &id, &ok);
+  Unused << mDoc->SendAnchorAt(mID, aIndex, &id, &ok);
   return ok ? mDoc->GetAccessible(id) : nullptr;
 }
 
 uint32_t
 ProxyAccessible::LinkCount()
 {
   uint32_t retVal = 0;
-  unused << mDoc->SendLinkCount(mID, &retVal);
+  Unused << mDoc->SendLinkCount(mID, &retVal);
   return retVal;
 }
 
 ProxyAccessible*
 ProxyAccessible::LinkAt(const uint32_t& aIndex)
 {
   uint64_t linkID = 0;
   bool ok = false;
-  unused << mDoc->SendLinkAt(mID, aIndex, &linkID, &ok);
+  Unused << mDoc->SendLinkAt(mID, aIndex, &linkID, &ok);
   return ok ? mDoc->GetAccessible(linkID) : nullptr;
 }
 
 int32_t
 ProxyAccessible::LinkIndexOf(ProxyAccessible* aLink)
 {
   int32_t retVal = -1;
   if (aLink) {
-    unused << mDoc->SendLinkIndexOf(mID, aLink->ID(), &retVal);
+    Unused << mDoc->SendLinkIndexOf(mID, aLink->ID(), &retVal);
   }
 
   return retVal;
 }
 
 int32_t
 ProxyAccessible::LinkIndexAtOffset(uint32_t aOffset)
 {
   int32_t retVal = -1;
-  unused << mDoc->SendLinkIndexAtOffset(mID, aOffset, &retVal);
+  Unused << mDoc->SendLinkIndexAtOffset(mID, aOffset, &retVal);
   return retVal;
 }
 
 ProxyAccessible*
 ProxyAccessible::TableOfACell()
 {
   uint64_t tableID = 0;
   bool ok = false;
-  unused << mDoc->SendTableOfACell(mID, &tableID, &ok);
+  Unused << mDoc->SendTableOfACell(mID, &tableID, &ok);
   return ok ? mDoc->GetAccessible(tableID) : nullptr;
 }
 
 uint32_t
 ProxyAccessible::ColIdx()
 {
   uint32_t index = 0;
-  unused << mDoc->SendColIdx(mID, &index);
+  Unused << mDoc->SendColIdx(mID, &index);
   return index;
 }
 
 uint32_t
 ProxyAccessible::RowIdx()
 {
   uint32_t index = 0;
-  unused << mDoc->SendRowIdx(mID, &index);
+  Unused << mDoc->SendRowIdx(mID, &index);
   return index;
 }
 
 uint32_t
 ProxyAccessible::ColExtent()
 {
   uint32_t extent = 0;
-  unused << mDoc->SendColExtent(mID, &extent);
+  Unused << mDoc->SendColExtent(mID, &extent);
   return extent;
 }
 
 uint32_t
 ProxyAccessible::RowExtent()
 {
   uint32_t extent = 0;
-  unused << mDoc->SendRowExtent(mID, &extent);
+  Unused << mDoc->SendRowExtent(mID, &extent);
   return extent;
 }
 
 void
 ProxyAccessible::ColHeaderCells(nsTArray<ProxyAccessible*>* aCells)
 {
   nsTArray<uint64_t> targetIDs;
-  unused << mDoc->SendColHeaderCells(mID, &targetIDs);
+  Unused << mDoc->SendColHeaderCells(mID, &targetIDs);
 
   size_t targetCount = targetIDs.Length();
   for (size_t i = 0; i < targetCount; i++) {
     aCells->AppendElement(mDoc->GetAccessible(targetIDs[i]));
   }
 }
 
 void
 ProxyAccessible::RowHeaderCells(nsTArray<ProxyAccessible*>* aCells)
 {
   nsTArray<uint64_t> targetIDs;
-  unused << mDoc->SendRowHeaderCells(mID, &targetIDs);
+  Unused << mDoc->SendRowHeaderCells(mID, &targetIDs);
 
   size_t targetCount = targetIDs.Length();
   for (size_t i = 0; i < targetCount; i++) {
     aCells->AppendElement(mDoc->GetAccessible(targetIDs[i]));
   }
 }
 
 bool
 ProxyAccessible::IsCellSelected()
 {
   bool selected = false;
-  unused << mDoc->SendIsCellSelected(mID, &selected);
+  Unused << mDoc->SendIsCellSelected(mID, &selected);
   return selected;
 }
 
 ProxyAccessible*
 ProxyAccessible::TableCaption()
 {
   uint64_t captionID = 0;
   bool ok = false;
-  unused << mDoc->SendTableCaption(mID, &captionID, &ok);
+  Unused << mDoc->SendTableCaption(mID, &captionID, &ok);
   return ok ? mDoc->GetAccessible(captionID) : nullptr;
 }
 
 void
 ProxyAccessible::TableSummary(nsString& aSummary)
 {
-  unused << mDoc->SendTableSummary(mID, &aSummary);
+  Unused << mDoc->SendTableSummary(mID, &aSummary);
 }
 
 uint32_t
 ProxyAccessible::TableColumnCount()
 {
   uint32_t count = 0;
-  unused << mDoc->SendTableColumnCount(mID, &count);
+  Unused << mDoc->SendTableColumnCount(mID, &count);
   return count;
 }
 
 uint32_t
 ProxyAccessible::TableRowCount()
 {
   uint32_t count = 0;
-  unused << mDoc->SendTableRowCount(mID, &count);
+  Unused << mDoc->SendTableRowCount(mID, &count);
   return count;
 }
 
 ProxyAccessible*
 ProxyAccessible::TableCellAt(uint32_t aRow, uint32_t aCol)
 {
   uint64_t cellID = 0;
   bool ok = false;
-  unused << mDoc->SendTableCellAt(mID, aRow, aCol, &cellID, &ok);
+  Unused << mDoc->SendTableCellAt(mID, aRow, aCol, &cellID, &ok);
   return ok ? mDoc->GetAccessible(cellID) : nullptr;
 }
 
 int32_t
 ProxyAccessible::TableCellIndexAt(uint32_t aRow, uint32_t aCol)
 {
   int32_t index = 0;
-  unused << mDoc->SendTableCellIndexAt(mID, aRow, aCol, &index);
+  Unused << mDoc->SendTableCellIndexAt(mID, aRow, aCol, &index);
   return index;
 }
 
 int32_t
 ProxyAccessible::TableColumnIndexAt(uint32_t aCellIndex)
 {
   int32_t index = 0;
-  unused << mDoc->SendTableColumnIndexAt(mID, aCellIndex, &index);
+  Unused << mDoc->SendTableColumnIndexAt(mID, aCellIndex, &index);
   return index;
 }
 
 int32_t
 ProxyAccessible::TableRowIndexAt(uint32_t aCellIndex)
 {
   int32_t index = 0;
-  unused << mDoc->SendTableRowIndexAt(mID, aCellIndex, &index);
+  Unused << mDoc->SendTableRowIndexAt(mID, aCellIndex, &index);
   return index;
 }
 
 void
 ProxyAccessible::TableRowAndColumnIndicesAt(uint32_t aCellIndex,
                                             int32_t* aRow, int32_t* aCol)
 {
-  unused << mDoc->SendTableRowAndColumnIndicesAt(mID, aCellIndex, aRow, aCol);
+  Unused << mDoc->SendTableRowAndColumnIndicesAt(mID, aCellIndex, aRow, aCol);
 }
 
 uint32_t
 ProxyAccessible::TableColumnExtentAt(uint32_t aRow, uint32_t aCol)
 {
   uint32_t extent = 0;
-  unused << mDoc->SendTableColumnExtentAt(mID, aRow, aCol, &extent);
+  Unused << mDoc->SendTableColumnExtentAt(mID, aRow, aCol, &extent);
   return extent;
 }
 
 uint32_t
 ProxyAccessible::TableRowExtentAt(uint32_t aRow, uint32_t aCol)
 {
   uint32_t extent = 0;
-  unused << mDoc->SendTableRowExtentAt(mID, aRow, aCol, &extent);
+  Unused << mDoc->SendTableRowExtentAt(mID, aRow, aCol, &extent);
   return extent;
 }
 
 void
 ProxyAccessible::TableColumnDescription(uint32_t aCol, nsString& aDescription)
 {
-  unused << mDoc->SendTableColumnDescription(mID, aCol, &aDescription);
+  Unused << mDoc->SendTableColumnDescription(mID, aCol, &aDescription);
 }
 
 void
 ProxyAccessible::TableRowDescription(uint32_t aRow, nsString& aDescription)
 {
-  unused << mDoc->SendTableRowDescription(mID, aRow, &aDescription);
+  Unused << mDoc->SendTableRowDescription(mID, aRow, &aDescription);
 }
 
 bool
 ProxyAccessible::TableColumnSelected(uint32_t aCol)
 {
   bool selected = false;
-  unused << mDoc->SendTableColumnSelected(mID, aCol, &selected);
+  Unused << mDoc->SendTableColumnSelected(mID, aCol, &selected);
   return selected;
 }
 
 bool
 ProxyAccessible::TableRowSelected(uint32_t aRow)
 {
   bool selected = false;
-  unused << mDoc->SendTableRowSelected(mID, aRow, &selected);
+  Unused << mDoc->SendTableRowSelected(mID, aRow, &selected);
   return selected;
 }
 
 bool
 ProxyAccessible::TableCellSelected(uint32_t aRow, uint32_t aCol)
 {
   bool selected = false;
-  unused << mDoc->SendTableCellSelected(mID, aRow, aCol, &selected);
+  Unused << mDoc->SendTableCellSelected(mID, aRow, aCol, &selected);
   return selected;
 }
 
 uint32_t
 ProxyAccessible::TableSelectedCellCount()
 {
   uint32_t count = 0;
-  unused << mDoc->SendTableSelectedCellCount(mID, &count);
+  Unused << mDoc->SendTableSelectedCellCount(mID, &count);
   return count;
 }
 
 uint32_t
 ProxyAccessible::TableSelectedColumnCount()
 {
   uint32_t count = 0;
-  unused << mDoc->SendTableSelectedColumnCount(mID, &count);
+  Unused << mDoc->SendTableSelectedColumnCount(mID, &count);
   return count;
 }
 
 uint32_t
 ProxyAccessible::TableSelectedRowCount()
 {
   uint32_t count = 0;
-  unused << mDoc->SendTableSelectedRowCount(mID, &count);
+  Unused << mDoc->SendTableSelectedRowCount(mID, &count);
   return count;
 }
 
 void
 ProxyAccessible::TableSelectedCells(nsTArray<ProxyAccessible*>* aCellIDs)
 {
   nsAutoTArray<uint64_t, 30> cellIDs;
-  unused << mDoc->SendTableSelectedCells(mID, &cellIDs);
+  Unused << mDoc->SendTableSelectedCells(mID, &cellIDs);
   aCellIDs->SetCapacity(cellIDs.Length());
   for (uint32_t i = 0; i < cellIDs.Length(); ++i) {
     aCellIDs->AppendElement(mDoc->GetAccessible(cellIDs[i]));
   }
 }
 
 void
 ProxyAccessible::TableSelectedCellIndices(nsTArray<uint32_t>* aCellIndices)
 {
-  unused << mDoc->SendTableSelectedCellIndices(mID, aCellIndices);
+  Unused << mDoc->SendTableSelectedCellIndices(mID, aCellIndices);
 }
 
 void
 ProxyAccessible::TableSelectedColumnIndices(nsTArray<uint32_t>* aColumnIndices)
 {
-  unused << mDoc->SendTableSelectedColumnIndices(mID, aColumnIndices);
+  Unused << mDoc->SendTableSelectedColumnIndices(mID, aColumnIndices);
 }
 
 void
 ProxyAccessible::TableSelectedRowIndices(nsTArray<uint32_t>* aRowIndices)
 {
-  unused << mDoc->SendTableSelectedRowIndices(mID, aRowIndices);
+  Unused << mDoc->SendTableSelectedRowIndices(mID, aRowIndices);
 }
 
 void
 ProxyAccessible::TableSelectColumn(uint32_t aCol)
 {
-  unused << mDoc->SendTableSelectColumn(mID, aCol);
+  Unused << mDoc->SendTableSelectColumn(mID, aCol);
 }
 
 void
 ProxyAccessible::TableSelectRow(uint32_t aRow)
 {
-  unused << mDoc->SendTableSelectRow(mID, aRow);
+  Unused << mDoc->SendTableSelectRow(mID, aRow);
 }
 
 void
 ProxyAccessible::TableUnselectColumn(uint32_t aCol)
 {
-  unused << mDoc->SendTableUnselectColumn(mID, aCol);
+  Unused << mDoc->SendTableUnselectColumn(mID, aCol);
 }
 
 void
 ProxyAccessible::TableUnselectRow(uint32_t aRow)
 {
-  unused << mDoc->SendTableUnselectRow(mID, aRow);
+  Unused << mDoc->SendTableUnselectRow(mID, aRow);
 }
 
 bool
 ProxyAccessible::TableIsProbablyForLayout()
 {
   bool forLayout = false;
-  unused << mDoc->SendTableIsProbablyForLayout(mID, &forLayout);
+  Unused << mDoc->SendTableIsProbablyForLayout(mID, &forLayout);
   return forLayout;
 }
 
 ProxyAccessible*
 ProxyAccessible::AtkTableColumnHeader(int32_t aCol)
 {
   uint64_t headerID = 0;
   bool ok = false;
-  unused << mDoc->SendAtkTableColumnHeader(mID, aCol, &headerID, &ok);
+  Unused << mDoc->SendAtkTableColumnHeader(mID, aCol, &headerID, &ok);
   return ok ? mDoc->GetAccessible(headerID) : nullptr;
 }
 
 ProxyAccessible*
 ProxyAccessible::AtkTableRowHeader(int32_t aRow)
 {
   uint64_t headerID = 0;
   bool ok = false;
-  unused << mDoc->SendAtkTableRowHeader(mID, aRow, &headerID, &ok);
+  Unused << mDoc->SendAtkTableRowHeader(mID, aRow, &headerID, &ok);
   return ok ? mDoc->GetAccessible(headerID) : nullptr;
 }
 
 void
 ProxyAccessible::SelectedItems(nsTArray<ProxyAccessible*>* aSelectedItems)
 {
   nsAutoTArray<uint64_t, 10> itemIDs;
-  unused << mDoc->SendSelectedItems(mID, &itemIDs);
+  Unused << mDoc->SendSelectedItems(mID, &itemIDs);
   aSelectedItems->SetCapacity(itemIDs.Length());
   for (size_t i = 0; i < itemIDs.Length(); ++i) {
     aSelectedItems->AppendElement(mDoc->GetAccessible(itemIDs[i]));
   }
 }
 
 uint32_t
 ProxyAccessible::SelectedItemCount()
 {
   uint32_t count = 0;
-  unused << mDoc->SendSelectedItemCount(mID, &count);
+  Unused << mDoc->SendSelectedItemCount(mID, &count);
   return count;
 }
 
 ProxyAccessible*
 ProxyAccessible::GetSelectedItem(uint32_t aIndex)
 {
   uint64_t selectedItemID = 0;
   bool ok = false;
-  unused << mDoc->SendGetSelectedItem(mID, aIndex, &selectedItemID, &ok);
+  Unused << mDoc->SendGetSelectedItem(mID, aIndex, &selectedItemID, &ok);
   return ok ? mDoc->GetAccessible(selectedItemID) : nullptr;
 }
 
 bool
 ProxyAccessible::IsItemSelected(uint32_t aIndex)
 {
   bool selected = false;
-  unused << mDoc->SendIsItemSelected(mID, aIndex, &selected);
+  Unused << mDoc->SendIsItemSelected(mID, aIndex, &selected);
   return selected;
 }
  
 bool
 ProxyAccessible::AddItemToSelection(uint32_t aIndex)
 {
   bool success = false;
-  unused << mDoc->SendAddItemToSelection(mID, aIndex, &success);
+  Unused << mDoc->SendAddItemToSelection(mID, aIndex, &success);
   return success;
 }
 
 bool
 ProxyAccessible::RemoveItemFromSelection(uint32_t aIndex)
 {
   bool success = false;
-  unused << mDoc->SendRemoveItemFromSelection(mID, aIndex, &success);
+  Unused << mDoc->SendRemoveItemFromSelection(mID, aIndex, &success);
   return success;
 }
 
 bool
 ProxyAccessible::SelectAll()
 {
   bool success = false;
-  unused << mDoc->SendSelectAll(mID, &success);
+  Unused << mDoc->SendSelectAll(mID, &success);
   return success;
 }
 
 bool
 ProxyAccessible::UnselectAll()
 {
   bool success = false;
-  unused << mDoc->SendUnselectAll(mID, &success);
+  Unused << mDoc->SendUnselectAll(mID, &success);
   return success;
 }
 
 void
 ProxyAccessible::TakeSelection()
 {
-  unused << mDoc->SendTakeSelection(mID);
+  Unused << mDoc->SendTakeSelection(mID);
 }
 
 void
 ProxyAccessible::SetSelected(bool aSelect)
 {
-  unused << mDoc->SendSetSelected(mID, aSelect);
+  Unused << mDoc->SendSetSelected(mID, aSelect);
 }
 
 bool
 ProxyAccessible::DoAction(uint8_t aIndex)
 {
   bool success = false;
-  unused << mDoc->SendDoAction(mID, aIndex, &success);
+  Unused << mDoc->SendDoAction(mID, aIndex, &success);
   return success;
 }
 
 uint8_t
 ProxyAccessible::ActionCount()
 {
   uint8_t count = 0;
-  unused << mDoc->SendActionCount(mID, &count);
+  Unused << mDoc->SendActionCount(mID, &count);
   return count;
 }
 
 void
 ProxyAccessible::ActionDescriptionAt(uint8_t aIndex, nsString& aDescription)
 {
-  unused << mDoc->SendActionDescriptionAt(mID, aIndex, &aDescription);
+  Unused << mDoc->SendActionDescriptionAt(mID, aIndex, &aDescription);
 }
 
 void
 ProxyAccessible::ActionNameAt(uint8_t aIndex, nsString& aName)
 {
-  unused << mDoc->SendActionNameAt(mID, aIndex, &aName);
+  Unused << mDoc->SendActionNameAt(mID, aIndex, &aName);
 }
 
 KeyBinding
 ProxyAccessible::AccessKey()
 {
   uint32_t key = 0;
   uint32_t modifierMask = 0;
-  unused << mDoc->SendAccessKey(mID, &key, &modifierMask);
+  Unused << mDoc->SendAccessKey(mID, &key, &modifierMask);
   return KeyBinding(key, modifierMask);
 }
 
 KeyBinding
 ProxyAccessible::KeyboardShortcut()
 {
   uint32_t key = 0;
   uint32_t modifierMask = 0;
-  unused << mDoc->SendKeyboardShortcut(mID, &key, &modifierMask);
+  Unused << mDoc->SendKeyboardShortcut(mID, &key, &modifierMask);
   return KeyBinding(key, modifierMask);
 }
 
 void
 ProxyAccessible::AtkKeyBinding(nsString& aBinding)
 {
-  unused << mDoc->SendAtkKeyBinding(mID, &aBinding);
+  Unused << mDoc->SendAtkKeyBinding(mID, &aBinding);
 }
 
 double
 ProxyAccessible::CurValue()
 {
   double val = UnspecifiedNaN<double>();
-  unused << mDoc->SendCurValue(mID, &val);
+  Unused << mDoc->SendCurValue(mID, &val);
   return val;
 }
 
 bool
 ProxyAccessible::SetCurValue(double aValue)
 {
   bool success = false;
-  unused << mDoc->SendSetCurValue(mID, aValue, &success);
+  Unused << mDoc->SendSetCurValue(mID, aValue, &success);
   return success;
 }
 
 double
 ProxyAccessible::MinValue()
 {
   double val = UnspecifiedNaN<double>();
-  unused << mDoc->SendMinValue(mID, &val);
+  Unused << mDoc->SendMinValue(mID, &val);
   return val;
 }
 
 double
 ProxyAccessible::MaxValue()
 {
   double val = UnspecifiedNaN<double>();
-  unused << mDoc->SendMaxValue(mID, &val);
+  Unused << mDoc->SendMaxValue(mID, &val);
   return val;
 }
 
 double
 ProxyAccessible::Step()
 {
   double step = UnspecifiedNaN<double>();
-  unused << mDoc->SendStep(mID, &step);
+  Unused << mDoc->SendStep(mID, &step);
   return step;
 }
 
 void
 ProxyAccessible::TakeFocus()
 {
-  unused << mDoc->SendTakeFocus(mID);
+  Unused << mDoc->SendTakeFocus(mID);
 }
 
 uint32_t
 ProxyAccessible::EmbeddedChildCount() const
 {
   uint32_t count;
-  unused << mDoc->SendEmbeddedChildCount(mID, &count);
+  Unused << mDoc->SendEmbeddedChildCount(mID, &count);
   return count;
 }
 
 int32_t
 ProxyAccessible::IndexOfEmbeddedChild(const ProxyAccessible* aChild)
 {
   uint64_t childID = aChild->mID;
   uint32_t childIdx;
-  unused << mDoc->SendIndexOfEmbeddedChild(mID, childID, &childIdx);
+  Unused << mDoc->SendIndexOfEmbeddedChild(mID, childID, &childIdx);
   return childIdx;
 }
 
 ProxyAccessible*
 ProxyAccessible::EmbeddedChildAt(size_t aChildIdx)
 {
   // For an outer doc the only child is a document, which is of course an
   // embedded child.  Further asking the child process for the id of the child
   // document won't work because the id of the child doc will be 0, which we
   // would interpret as being our parent document.
   if (mOuterDoc) {
     return ChildAt(aChildIdx);
   }
 
   uint64_t childID;
-  unused << mDoc->SendEmbeddedChildAt(mID, aChildIdx, &childID);
+  Unused << mDoc->SendEmbeddedChildAt(mID, aChildIdx, &childID);
   return mDoc->GetAccessible(childID);
 }
 
 ProxyAccessible*
 ProxyAccessible::FocusedChild()
 {
   uint64_t childID = 0;
   bool ok = false;
-  unused << mDoc->SendFocusedChild(mID, &childID, &ok);
+  Unused << mDoc->SendFocusedChild(mID, &childID, &ok);
   return ok ? mDoc->GetAccessible(childID) : nullptr;
 }
 
 ProxyAccessible*
 ProxyAccessible::ChildAtPoint(int32_t aX, int32_t aY,
                               Accessible::EWhichChildAtPoint aWhichChild)
 {
   uint64_t childID = 0;
   bool ok = false;
-  unused << mDoc->SendAccessibleAtPoint(mID, aX, aY, false,
+  Unused << mDoc->SendAccessibleAtPoint(mID, aX, aY, false,
                                         static_cast<uint32_t>(aWhichChild),
                                         &childID, &ok);
   return ok ? mDoc->GetAccessible(childID) : nullptr;
 }
 
 nsIntRect
 ProxyAccessible::Bounds()
 {
   nsIntRect rect;
-  unused << mDoc->SendExtents(mID, false,
+  Unused << mDoc->SendExtents(mID, false,
                               &(rect.x), &(rect.y),
                               &(rect.width), &(rect.height));
   return rect;
 }
 
 void
 ProxyAccessible::Language(nsString& aLocale)
 {
-  unused << mDoc->SendLanguage(mID, &aLocale);
+  Unused << mDoc->SendLanguage(mID, &aLocale);
 }
 
 void
 ProxyAccessible::DocType(nsString& aType)
 {
-  unused << mDoc->SendDocType(mID, &aType);
+  Unused << mDoc->SendDocType(mID, &aType);
 }
 
 void
 ProxyAccessible::Title(nsString& aTitle)
 {
-  unused << mDoc->SendTitle(mID, &aTitle);
+  Unused << mDoc->SendTitle(mID, &aTitle);
 }
 
 void
 ProxyAccessible::URL(nsString& aURL)
 {
-  unused << mDoc->SendURL(mID, &aURL);
+  Unused << mDoc->SendURL(mID, &aURL);
 }
 
 void
 ProxyAccessible::MimeType(nsString aMime)
 {
-  unused << mDoc->SendMimeType(mID, &aMime);
+  Unused << mDoc->SendMimeType(mID, &aMime);
 }
 
 void
 ProxyAccessible::URLDocTypeMimeType(nsString& aURL, nsString& aDocType,
                                     nsString& aMimeType)
 {
-  unused << mDoc->SendURLDocTypeMimeType(mID, &aURL, &aDocType, &aMimeType);
+  Unused << mDoc->SendURLDocTypeMimeType(mID, &aURL, &aDocType, &aMimeType);
 }
 
 ProxyAccessible*
 ProxyAccessible::AccessibleAtPoint(int32_t aX, int32_t aY,
                                    bool aNeedsScreenCoords)
 {
   uint64_t childID = 0;
   bool ok = false;
-  unused <<
+  Unused <<
     mDoc->SendAccessibleAtPoint(mID, aX, aY, aNeedsScreenCoords,
                                 static_cast<uint32_t>(Accessible::eDirectChild),
                                 &childID, &ok);
   return ok ? mDoc->GetAccessible(childID) : nullptr;
 }
 
 void
 ProxyAccessible::Extents(bool aNeedsScreenCoords, int32_t* aX, int32_t* aY,
                         int32_t* aWidth, int32_t* aHeight)
 {
-  unused << mDoc->SendExtents(mID, aNeedsScreenCoords, aX, aY, aWidth, aHeight);
+  Unused << mDoc->SendExtents(mID, aNeedsScreenCoords, aX, aY, aWidth, aHeight);
 }
 
 Accessible*
 ProxyAccessible::OuterDocOfRemoteBrowser() const
 {
   auto tab = static_cast<dom::TabParent*>(mDoc->Manager());
   dom::Element* frame = tab->GetOwnerElement();
   NS_ASSERTION(frame, "why isn't the tab in a frame!");
--- a/accessible/tests/mochitest/jsat/test_traversal.html
+++ b/accessible/tests/mochitest/jsat/test_traversal.html
@@ -108,28 +108,28 @@
                               'Or me! ', 'Value 1', 'Value 2', 'Value 3',
                               'Electronic mailing address:', 'input-1-5',
                               'button-1-3', 'heading-2', 'heading-3',
                               'button-2-1', 'button-2-2', 'button-2-3',
                               'button-2-4', 'Programming Language',
                               'A esoteric weapon wielded by only the most ' +
                               'formidable warriors, for its unrelenting strict' +
                               ' power is unfathomable.',
-                              '• Lists of Programming Languages', 'Lisp ',
+                              '• Lists of Programming Languages', 'Lisp',
                               '1. Scheme', '2. Racket', '3. Clojure',
                               '4. Standard Lisp', 'link-0', ' Lisp',
                               'checkbox-1-5', ' LeLisp', '• JavaScript',
                               'heading-5', 'image-2', 'image-3',
                               'Not actually an image', 'link-1', 'anchor-1',
                               'link-2', 'anchor-2', 'link-3', '3', '1', '4',
                               '1', 'Sunday', 'M', 'Week 1', '3', '4', '7', '2',
                               '5 8', 'gridcell4', 'Just an innocuous separator',
                               'Dirty Words', 'Meaning', 'Mud', 'Wet Dirt',
                               'Dirt', 'Messy Stuff', 'statusbar-1', 'statusbar-2',
-                              'switch-1', 'This is a MathML formula ', 'math-1',
+                              'switch-1', 'This is a MathML formula', 'math-1',
                               'with some text after.']);
 
       queueTraversalSequence(gQueue, docAcc, TraversalRules.Landmark, null,
                              ['header-1', 'main-1', 'footer-1']);
 
 
       queueTraversalSequence(gQueue, docAcc, TraversalRules.Control, null,
                              ['input-1-1', 'label-1-2', 'button-1-1',
--- a/accessible/tests/mochitest/pivot/test_virtualcursor.html
+++ b/accessible/tests/mochitest/pivot/test_virtualcursor.html
@@ -47,17 +47,17 @@
 
       queueTraversalSequence(gQueue, docAcc, HeadersTraversalRule, null,
                              ['heading-1-1', 'heading-2-1', 'heading-2-2']);
 
       queueTraversalSequence(
         gQueue, docAcc, ObjectTraversalRule, null,
         ['Main Title', 'Lorem ipsum ',
          'dolor', ' sit amet. Integer vitae urna leo, id ',
-         'semper', ' nulla. ', 'Second Section Title',
+         'semper', ' nulla.', 'Second Section Title',
          'Sed accumsan luctus lacus, vitae mollis arcu tristique vulputate.',
          'An ', 'embedded', ' document.', 'Hide me', 'Link 1', 'Link 2',
          'Link 3', 'Hello', 'World']);
 
       // Just a random smoke test to see if our setTextRange works.
       gQueue.push(
         new setVCRangeInvoker(
           docAcc,
@@ -85,17 +85,17 @@
       // Attempting a coordinate outside any header, should move to null
       gQueue.push(new moveVCCoordInvoker(docAcc, x - 1, y - 1, false,
                                          HeadersTraversalRule, null));
 
       queueTraversalSequence(
         gQueue, docAcc, ObjectTraversalRule,
         getAccessible(doc.getElementById('paragraph-1')),
         ['Lorem ipsum ', 'dolor', ' sit amet. Integer vitae urna leo, id ',
-         'semper', ' nulla. ']);
+         'semper', ' nulla.']);
 
       gQueue.push(new setModalRootInvoker(docAcc, docAcc.parent,
                                           NS_ERROR_INVALID_ARG));
 
       // Put cursor in an ignored subtree
       // set isFromUserInput to false, just to test..
       gQueue.push(new setVCPosInvoker(docAcc, null, null,
                                       getAccessible(doc.getElementById("hidden-link")),
--- a/accessible/tests/mochitest/text/test_doc.html
+++ b/accessible/tests/mochitest/text/test_doc.html
@@ -11,18 +11,18 @@
           src="../common.js"></script>
   <script type="application/javascript"
           src="../text.js"></script>
   <script type="application/javascript">
     
     function doTest()
     {
       var iframeDoc = [ getNode("iframe").contentDocument ];
-      testCharacterCount(iframeDoc, 15);
-      testText(iframeDoc, 0, 15, "outbody inbody ");
+      testCharacterCount(iframeDoc, 13);
+      testText(iframeDoc, 0, 13, "outbodyinbody");
 
       SimpleTest.finish();
     }
 
     SimpleTest.waitForExplicitFinish();
     addA11yLoadEvent(doTest);
   </script>
 </head>
--- a/accessible/tests/mochitest/text/test_hypertext.html
+++ b/accessible/tests/mochitest/text/test_hypertext.html
@@ -53,17 +53,17 @@
       testText(IDs, 0, 1, "h");
       testText(IDs, 5, 7, " " + kEmbedChar);
       testText(IDs, 10, 13, "e " + kEmbedChar);
       testText(IDs, 0, 13, "hello " + kEmbedChar + " see " + kEmbedChar);
 
       ////////////////////////////////////////////////////////////////////////
       // getTextAtOffset line boundary
 
-      testTextAtOffset(0, BOUNDARY_LINE_START, "line ", 0, 5,
+      testTextAtOffset(0, BOUNDARY_LINE_START, "line", 0, 4,
                        "hypertext3", kOk, kOk, kOk);
 
       // XXX: see bug 634202.
       testTextAtOffset(0, BOUNDARY_LINE_START, "line ", 0, 5,
                        "hypertext4", kTodo, kOk, kTodo);
 
       //////////////////////////////////////////////////////////////////////////
       // list
@@ -117,17 +117,17 @@
 
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <div id="nulltext"></div>
 
-  <div id="hypertext">hello <a>friend</a> see <img></div>
+  <div id="hypertext">hello <a>friend</a> see <img src="about:blank"></div>
   <div id="hypertext2">hello <a>friend</a> see <input></div>
   <ol id="list">
     <li id="listitem">foo</li>
     <li id="listitemnone">bar</li>
   </ol>
 
   <div id="hypertext3">line
 <!-- haha -->
--- a/accessible/tests/mochitest/text/test_lineboundary.html
+++ b/accessible/tests/mochitest/text/test_lineboundary.html
@@ -9,19 +9,19 @@
   <script type="application/javascript"
           src="../common.js"></script>
   <script type="application/javascript"
           src="../text.js"></script>
   <script type="application/javascript">
     function doTest()
     {
       testTextAtOffset("line_test_1", BOUNDARY_LINE_START,
-                       [[0, 6, "Line 1 ", 0, 7],
-                        [7, 7, "", 7, 7],
-                        [8, 15, "Line 3 ", 8, 15]]);
+                       [[0, 5, "Line 1", 0, 6],
+                        [6, 6, "", 6, 6],
+                        [7, 13, "Line 3", 7, 13]]);
 
       //////////////////////////////////////////////////////////////////////////
       // __h__e__l__l__o__ __m__y__ __f__r__i__e__n__d__
       //  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15
 
       var IDs = [ "input", "div", "editable", "textarea",
                   getNode("ta", getNode("ta_cntr").contentDocument) ];
 
@@ -109,20 +109,20 @@
       testTextAtOffset([ getAccessible("ht_2").firstChild.firstChild ],
                        BOUNDARY_LINE_START,
                        [ [ 0, 3, "foo", 0, 3 ] ]);
       testTextAtOffset([ getAccessible("ht_3").firstChild.firstChild ],
                        BOUNDARY_LINE_START,
                        [ [ 0, 3, "foo\n", 0, 4 ], [ 4, 4, "", 4, 4 ] ]);
 
       //////////////////////////////////////////////////////////////////////////
-      // 'Hello world ' (\n is rendered as space)
+      // 'Hello world'
 
       testTextAtOffset([ "ht_4" ], BOUNDARY_LINE_START,
-                       [ [ 0, 12, "Hello world ", 0, 12 ] ]);
+                       [ [ 0, 11, "Hello world", 0, 11 ] ]);
 
       //////////////////////////////////////////////////////////////////////////
       // list items
 
       testTextAtOffset([ "li1" ], BOUNDARY_LINE_START,
                        [ [ 0, 6, kDiscBulletText + "Item", 0, 6 ] ]);
       testTextAtOffset([ "li2" ], BOUNDARY_LINE_START,
                        [ [ 0, 2, kDiscBulletText, 0, 2 ] ]);
--- a/accessible/tests/mochitest/text/test_wordboundary.html
+++ b/accessible/tests/mochitest/text/test_wordboundary.html
@@ -37,37 +37,30 @@
       // "hello "
       // __h__e__l__l__o__ __
       //  0  1  2  3  4  5  6
       var ids = [ "i2", "d2", "e2", "t2" ];
       testTextBeforeOffset(ids, BOUNDARY_WORD_START,
                            [ [ 0, 6, "", 0, 0 ] ]);
       testTextBeforeOffset(ids, BOUNDARY_WORD_END,
                            [ [ 0, 5, "", 0, 0 ],
-                             [ 6, 6, "hello", 0, 5,
-                               [ [6, "e2", kTodo, kOk, kTodo ] ]
-                             ]
+                             [ 6, 6, "hello", 0, 5 ]
                            ]);
 
       testTextAtOffset(ids, BOUNDARY_WORD_START,
                        [ [ 0, 6, "hello ", 0, 6 ] ]);
       testTextAtOffset(ids, BOUNDARY_WORD_END,
                        [ [ 0, 4, "hello", 0, 5 ],
-                         [ 5, 6, " ", 5, 6,
-                           [ [ 5, "e2", kTodo, kTodo, kOk ],
-                             [ 6, "e2", kTodo, kTodo, kOk ] ]
-                         ]
+                         [ 5, 6, " ", 5, 6 ]
                        ]);
 
       testTextAfterOffset(ids, BOUNDARY_WORD_START,
                           [ [ 0, 6, "", 6, 6 ] ]);
       testTextAfterOffset(ids, BOUNDARY_WORD_END,
-                          [ [ 0, 5, " ", 5, 6,
-                              [ [ 5, "e2", kTodo, kTodo, kOk ] ]
-                            ],
+                          [ [ 0, 5, " ", 5, 6 ],
                             [ 6, 6, "", 6, 6 ]
                           ]);
 
       // "hello all"
       // __h__e__l__l__o__ __a__l__l__
       //  0  1  2  3  4  5  6  7  8  9
       ids = [ "i6", "d6", "e6", "t6" ];
       testTextBeforeOffset(ids, BOUNDARY_WORD_START,
@@ -251,17 +244,17 @@
 
   <input id="i1" value="hello"/>
   <div id="d1">hello</div>
   <div id="e1" contenteditable="true">hello</div>
   <textarea id="t1">hello</textarea>
 
   <input id="i2" value="hello "/>
   <pre><div id="d2">hello </div></pre>
-  <div id="e2" contenteditable="true">hello </div>
+  <div id="e2" contenteditable="true" style='white-space:pre'>hello </div>
   <textarea id="t2">hello </textarea>
 
   <input id="i6" value="hello all"/>
   <div id="d6">hello all</div>
   <div id="e6" contenteditable="true">hello all</div>
   <textarea id="t6">hello all</textarea>
 
   <input id="i7" value="hello my friend"/>
--- a/accessible/tests/mochitest/textattrs/test_general.html
+++ b/accessible/tests/mochitest/textattrs/test_general.html
@@ -84,17 +84,17 @@
       gComputedStyle = document.defaultView.getComputedStyle(tempElem, "");
       attrs = {"color": gComputedStyle.color};
       testTextAttrs(ID, 26, attrs, defAttrs, 26, 27);
 
       tempElem = tempElem.nextSibling;
       gComputedStyle = document.defaultView.getComputedStyle(tempElem, "");
       attrs = {"color": gComputedStyle.color,
                "background-color": gComputedStyle.backgroundColor};
-      testTextAttrs(ID, 27, attrs, defAttrs, 27, 50);
+      testTextAttrs(ID, 27, attrs, defAttrs, 27, 49);
 
       //////////////////////////////////////////////////////////////////////////
       // area4
       ID = "area4";
       defAttrs = buildDefaultTextAttrs(ID, "12pt");
       testDefaultTextAttrs(ID, defAttrs);
 
       tempElem = getNode(ID).firstChild.nextSibling;
@@ -105,17 +105,17 @@
       tempElem = tempElem.nextSibling.firstChild.nextSibling;
       gComputedStyle = document.defaultView.getComputedStyle(tempElem, "");
       attrs = {"color": gComputedStyle.color};
       testTextAttrs(ID, 16, attrs, defAttrs, 16, 33);
 
       tempElem = tempElem.parentNode;
       gComputedStyle = document.defaultView.getComputedStyle(tempElem, "");
       attrs = {"color": gComputedStyle.color};
-      testTextAttrs(ID, 34, attrs, defAttrs, 33, 46);
+      testTextAttrs(ID, 34, attrs, defAttrs, 33, 45);
 
       //////////////////////////////////////////////////////////////////////////
       // area5: "Green!*!RedNormal"
       ID = "area5";
       defAttrs = buildDefaultTextAttrs(ID, "12pt");
       testDefaultTextAttrs(ID, defAttrs);
 
       // Green
@@ -139,17 +139,17 @@
       // Red
       tempElem = tempElem.nextSibling.nextSibling.nextSibling.nextSibling;
       gComputedStyle = document.defaultView.getComputedStyle(tempElem, "");
       attrs = {"color": gComputedStyle.color};
       testTextAttrs(ID, 9, attrs, defAttrs, 8, 11);
 
       // Normal
       attrs = {};
-      testTextAttrs(ID, 11, attrs, defAttrs, 11, 18);
+      testTextAttrs(ID, 11, attrs, defAttrs, 11, 17);
 
       //////////////////////////////////////////////////////////////////////////
       // area6 (CSS vertical-align property, refer to bug 445938 for details
       // 	and sup and sub elements, refer to bug 735645 for details)
       ID = "area6";
       defAttrs = buildDefaultTextAttrs(ID, "12pt");
       testDefaultTextAttrs(ID, defAttrs);
 
@@ -318,17 +318,17 @@
 
       attrs = {
         "text-line-through-style": "solid",
         "text-line-through-color": gComputedStyle.color
       };
       testTextAttrs(ID, 152, attrs, defAttrs, 151, 164);
 
       attrs = {};
-      testTextAttrs(ID, 165, attrs, defAttrs, 164, 172);
+      testTextAttrs(ID, 165, attrs, defAttrs, 164, 171);
 
       //////////////////////////////////////////////////////////////////////////
       // area10, different single style spans in non-styled paragraph
       ID = "area10";
       defAttrs = buildDefaultTextAttrs(ID, "12pt");
       testDefaultTextAttrs(ID, defAttrs);
 
       attrs = {};
@@ -378,17 +378,17 @@
 
       attrs = {
         "text-line-through-style": "solid",
         "text-line-through-color": gComputedStyle.color
       };
       testTextAttrs(ID, 111, attrs, defAttrs, 110, 123);
 
       attrs = {};
-      testTextAttrs(ID, 124, attrs, defAttrs, 123, 131);
+      testTextAttrs(ID, 124, attrs, defAttrs, 123, 130);
 
       //////////////////////////////////////////////////////////////////////////
       // area11, "font-weight" tests
       ID = "area11";
       defAttrs = buildDefaultTextAttrs(ID, "12pt", kBoldFontWeight);
       testDefaultTextAttrs(ID, defAttrs);
 
       attrs = { };
@@ -405,17 +405,17 @@
 
       attrs = { };
       testTextAttrs(ID, 33, attrs, defAttrs, 33, 51);
 
       attrs = { "font-weight": kNormalFontWeight };
       testTextAttrs(ID, 51, attrs, defAttrs, 51, 57);
 
       attrs = { };
-      testTextAttrs(ID, 57, attrs, defAttrs, 57, 97);
+      testTextAttrs(ID, 57, attrs, defAttrs, 57, 96);
 
       //////////////////////////////////////////////////////////////////////////
       // test out of range offset
       testTextAttrsWrongOffset("area12", -1);
       testTextAttrsWrongOffset("area12", 500);
 
       //////////////////////////////////////////////////////////////////////////
       // test zero offset on empty hypertext accessibles
@@ -480,17 +480,17 @@
 
       attrs = { };
       testTextAttrs(ID, 22, attrs, defAttrs, 22, 27);
 
       attrs = { "font-family": kCursiveFontFamily };
       testTextAttrs(ID, 27, attrs, defAttrs, 27, 31);
 
       attrs = { };
-      testTextAttrs(ID, 31, attrs, defAttrs, 31, 45);
+      testTextAttrs(ID, 31, attrs, defAttrs, 31, 44);
 
       //////////////////////////////////////////////////////////////////////////
       // area17, "text-decoration" tests
       ID = "area17";
       defAttrs = buildDefaultTextAttrs(ID, "12pt");
       testDefaultTextAttrs(ID, defAttrs);
 
       attrs = {
@@ -522,17 +522,17 @@
         "text-line-through-color": "rgb(0, 0, 255)",
       };
       testTextAttrs(ID, 34, attrs, defAttrs, 34, 39);
 
       attrs = {
         "text-line-through-style": "wavy",
         "text-line-through-color": "rgb(0, 0, 0)",
       };
-      testTextAttrs(ID, 39, attrs, defAttrs, 39, 44);
+      testTextAttrs(ID, 39, attrs, defAttrs, 39, 43);
 
       //////////////////////////////////////////////////////////////////////////
       // area18, "auto-generation text" tests
       ID = "area18";
       defAttrs = buildDefaultTextAttrs(ID, "12pt");
       testDefaultTextAttrs(ID, defAttrs);
 
       var attrs = {
@@ -552,17 +552,17 @@
       testTextAttrs(ID, 0, attrs, defAttrs, 0, 10);
       
       tempElem = getNode(ID).firstChild.nextSibling;
       gComputedStyle = document.defaultView.getComputedStyle(tempElem, "");
       attrs = { "background-color": gComputedStyle.backgroundColor };
       testTextAttrs(ID, 11, attrs, defAttrs, 10, 17);
 
       attrs = {};
-      testTextAttrs(ID, 18, attrs, defAttrs, 17, 28);
+      testTextAttrs(ID, 18, attrs, defAttrs, 17, 27);
 
        //////////////////////////////////////////////////////////////////////////
       // area20, "aOffset as -1 (Mozilla Bug 789621)" test
 
       ID = "area20";
       defAttrs = buildDefaultTextAttrs(ID, "15pt");
       testDefaultTextAttrs(ID, defAttrs);
 
--- a/accessible/tests/mochitest/textcaret/test_general.html
+++ b/accessible/tests/mochitest/textcaret/test_general.html
@@ -66,17 +66,17 @@
     //gA11yEventDumpID = "eventdump"; // debug stuff
     //gA11yEventDumpToConsole = true;
 
     function doTests()
     {
       turnCaretBrowsing(true);
 
       // test caret offsets
-      testCaretOffset(document, 16);
+      testCaretOffset(document, 15);
       testCaretOffset("textbox", -1);
       testCaretOffset("textarea", -1);
       testCaretOffset("p", -1);
 
       // test caret move events and caret offsets
       gQueue = new eventQueue();
 
       gQueue.push(new setCaretOffset("textbox", 1, "textbox"));
--- a/accessible/tests/mochitest/tree/test_invalidationlist.html
+++ b/accessible/tests/mochitest/tree/test_invalidationlist.html
@@ -46,12 +46,12 @@
   </a>
   <p id="display"></p>
   <div id="content" style="display: none"></div>
   <pre id="test">
   </pre>
 
   <div id="container">
     <div><label for="x"></label></div>
-    <div style="display: table-cell;" id="x">Z<span> </span><span></span></div>
+    <div style="display: table-cell;" id="x">Z<span style='white-space:pre'> </span><span></span></div>
   </div>
 </body>
 </html>
--- a/accessible/tests/mochitest/tree/test_txtcntr.html
+++ b/accessible/tests/mochitest/tree/test_txtcntr.html
@@ -44,52 +44,52 @@
             role: ROLE_TEXT_LEAF,
             name: "Hello2"
           },
           {
             role: ROLE_SEPARATOR
           },
           {
             role: ROLE_TEXT_LEAF,
-            name: "Hello3 "
+            name: "Hello3"
           },
           {
             role: ROLE_PARAGRAPH,
             children: [
               {
                 role: ROLE_TEXT_LEAF,
-                name: "Hello4 "
+                name: "Hello4"
               }
             ]
           }
         ]
       };
 
       testAccessibleTree("c3", accTree);
 
       // contentEditable div
       accTree = {
         role: ROLE_SECTION,
         children: [
           {
             role: ROLE_TEXT_LEAF,
-            name: "helllo "
+            name: "helllo"
           },
           {
             role: ROLE_PARAGRAPH,
             children: [
               {
                 role: ROLE_TEXT_LEAF,
                 name: "blabla"
               }
             ]
           },
           {
             role: ROLE_TEXT_LEAF,
-            name: "hello "
+            name: "hello"
           }
         ]
       };
 
       testAccessibleTree("c4", accTree);
 
       // blockquote
       accTree = {
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -991,16 +991,17 @@ pref("urlclassifier.downloadBlockTable",
 // only useful for suppressing remote lookups for signed binaries which we can
 // only verify on Windows (Bug 974579). Other platforms always do remote lookups.
 pref("urlclassifier.downloadAllowTable", "goog-downloadwhite-digest256");
 #endif
 #endif
 
 pref("browser.geolocation.warning.infoURL", "https://www.mozilla.org/%LOCALE%/firefox/geolocation/");
 pref("browser.push.warning.infoURL", "https://www.mozilla.org/%LOCALE%/firefox/push/");
+pref("browser.push.warning.migrationURL", "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/push#w_upgraded-notifications");
 
 pref("browser.EULA.version", 3);
 pref("browser.rights.version", 3);
 pref("browser.rights.3.shown", false);
 
 #ifdef DEBUG
 // Don't show the about:rights notification in debug builds.
 pref("browser.rights.override", true);
--- a/browser/base/content/test/alerts/browser_notification_permission_migration.js
+++ b/browser/base/content/test/alerts/browser_notification_permission_migration.js
@@ -19,17 +19,17 @@ add_task(function* test_permissionMigrat
   }
 
   info("Waiting for migration notification");
   let alertWindowPromise = promiseAlertWindow();
   gBrowserGlue.observe(null, "browser-glue-test", "force-ui-migration");
   let alertWindow = yield alertWindowPromise;
 
   info("Clicking on notification");
-  let url = Services.urlFormatter.formatURLPref("browser.push.warning.infoURL");
+  let url = Services.urlFormatter.formatURLPref("browser.push.warning.migrationURL");
   let closePromise = promiseWindowClosed(alertWindow);
   let tabPromise = BrowserTestUtils.waitForNewTab(gBrowser, url);
   EventUtils.synthesizeMouseAtCenter(alertWindow.document.getElementById("alertTitleLabel"), {}, alertWindow);
 
   info("Waiting for migration info tab");
   let tab = yield tabPromise;
   ok(tab, "The migration info tab opened");
 
--- a/browser/base/content/test/general/mochitest.ini
+++ b/browser/base/content/test/general/mochitest.ini
@@ -1,10 +1,10 @@
 [DEFAULT]
-skip-if = buildapp == 'b2g' || e10s
+skip-if = buildapp == 'b2g'
 support-files =
   audio.ogg
   bug364677-data.xml
   bug364677-data.xml^headers^
   bug395533-data.txt
   contextmenu_common.js
   ctxmenu-image.png
   feed_discovery.html
@@ -26,14 +26,15 @@ support-files =
   subtst_contextmenu.html
   video.ogg
 
 [test_bug364677.html]
 [test_bug395533.html]
 [test_contextmenu.html]
 skip-if = toolkit == "gtk2" || toolkit == "gtk3" || (os == 'mac' && os_version != '10.6') # disabled on Linux due to bug 513558, on Mac after 10.6 due to bug 792304
 [test_contextmenu_input.html]
-skip-if = toolkit == "gtk2" || toolkit == "gtk3" # disabled on Linux due to bug 513558
+skip-if = toolkit == "gtk2" || toolkit == "gtk3" || e10s # disabled on Linux due to bug 513558
 [test_feed_discovery.html]
+skip-if = e10s
 [test_offlineNotification.html]
-skip-if = buildapp == 'mulet' # Bug 1066070 - I don't think either popup notifications nor addon install stuff works?
+skip-if = buildapp == 'mulet' || e10s # Bug 1066070 - I don't think either popup notifications nor addon install stuff works?
 [test_offline_gzip.html]
-skip-if = buildapp == 'mulet' # Bug 1066070 - I don't think either popup notifications nor addon install stuff works?
+skip-if = buildapp == 'mulet' || e10s # Bug 1066070 - I don't think either popup notifications nor addon install stuff works?
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -2239,17 +2239,17 @@ BrowserGlue.prototype = {
       if (topic != "alertclickcallback")
         return;
       let win = RecentWindow.getMostRecentBrowserWindow();
       win.openUILinkIn(data, "tab");
     }
     let imageURL = "chrome://browser/skin/web-notifications-icon.svg";
     let title = gBrowserBundle.GetStringFromName("webNotifications.upgradeTitle");
     let text = gBrowserBundle.GetStringFromName("webNotifications.upgradeInfo");
-    let url = Services.urlFormatter.formatURLPref("browser.push.warning.infoURL");
+    let url = Services.urlFormatter.formatURLPref("browser.push.warning.migrationURL");
 
     try {
       AlertsService.showAlertNotification(imageURL, title, text,
                                           true, url, clickCallback);
     }
     catch (e) {
       Cu.reportError(e);
     }
--- a/caps/DomainPolicy.cpp
+++ b/caps/DomainPolicy.cpp
@@ -30,17 +30,17 @@ BroadcastDomainSetChange(DomainSetType a
     if (!parents.Length()) {
        return NS_OK;
     }
 
     OptionalURIParams uri;
     SerializeURI(aDomain, uri);
 
     for (uint32_t i = 0; i < parents.Length(); i++) {
-        unused << parents[i]->SendDomainSetChanged(aSetType, aChangeType, uri);
+        Unused << parents[i]->SendDomainSetChanged(aSetType, aChangeType, uri);
     }
     return NS_OK;
 }
 
 DomainPolicy::DomainPolicy() : mBlacklist(new DomainSet(BLACKLIST))
                              , mSuperBlacklist(new DomainSet(SUPER_BLACKLIST))
                              , mWhitelist(new DomainSet(WHITELIST))
                              , mSuperWhitelist(new DomainSet(SUPER_WHITELIST))
--- a/chrome/nsChromeRegistryChrome.cpp
+++ b/chrome/nsChromeRegistryChrome.cpp
@@ -744,17 +744,17 @@ static void
 SendManifestEntry(const ChromeRegistryItem &aItem)
 {
   nsTArray<ContentParent*> parents;
   ContentParent::GetAll(parents);
   if (!parents.Length())
     return;
 
   for (uint32_t i = 0; i < parents.Length(); i++) {
-    unused << parents[i]->SendRegisterChromeItem(aItem);
+    Unused << parents[i]->SendRegisterChromeItem(aItem);
   }
 }
 
 void
 nsChromeRegistryChrome::ManifestContent(ManifestProcessingContext& cx, int lineno,
                                         char *const * argv, int flags)
 {
   char* package = argv[0];
--- a/chrome/test/unit/head_crtestutils.js
+++ b/chrome/test/unit/head_crtestutils.js
@@ -4,11 +4,11 @@ const XULAPPINFO_CID = Components.ID("{4
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cr = Components.results;
 
 
 function registerManifests(manifests)
 {
   var reg = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
-  for each (var manifest in manifests)
+  for (var manifest of manifests)
     reg.autoRegister(manifest);
 }
--- a/config/static-checking.js
+++ b/config/static-checking.js
@@ -21,44 +21,46 @@ include('string-format.js');
 var modules = [];
 
 function LoadModules(modulelist)
 {
   if (modulelist == "")
     return;
 
   let modulenames = modulelist.split(',');
-  for each (let modulename in modulenames) {
+  for (let modulename of modulenames) {
     let module = { __proto__: this };
     include(modulename, module);
     modules.push(module);
   }
 }
 
 LoadModules(options['dehydra-modules']);
 if (treehydra_enabled())
   LoadModules(options['treehydra-modules']);
 
 function process_type(c)
 {
-  for each (let module in modules)
+  for (let module of modules)
     if (module.hasOwnProperty('process_type'))
       module.process_type(c);
 }
 
 function hasAttribute(c, attrname)
 {
   var attr;
 
   if (c.attributes === undefined)
     return false;
 
-  for each (attr in c.attributes)
+  for (var key in c.attributes) {
+    attr = c.attributes[key];
     if (attr.name == 'user' && attr.value[0] == attrname)
       return true;
+  }
 
   return false;
 }
 
 // This is useful for detecting method overrides
 function signaturesMatch(m1, m2)
 {
   if (m1.shortName != m2.shortName)
@@ -130,18 +132,18 @@ const forward_functions = [
   'process_tree',
   'process_cp_pre_genericize',
   'input_end'
 ];
 
 function setup_forwarding(n)
 {
   this[n] = function() {
-    for each (let module in modules) {
+    for (let module of modules) {
       if (module.hasOwnProperty(n)) {
         module[n].apply(this, arguments);
       }
     }
   }
 }
 
-for each (let n in forward_functions)
+for (let n of forward_functions)
   setup_forwarding(n);
--- a/devtools/shared/apps/tests/mochitest.ini
+++ b/devtools/shared/apps/tests/mochitest.ini
@@ -1,9 +1,8 @@
 [DEFAULT]
-skip-if = e10s
 support-files =
   debugger-protocol-helper.js
   redirect.sjs
 
 [test_webapps_actor.html]
 # The mochitest doesn't work on fennec yet
 skip-if = toolkit == 'android'
--- a/docshell/base/crashtests/crashtests.list
+++ b/docshell/base/crashtests/crashtests.list
@@ -1,14 +1,14 @@
 load 40929-1.html
 load 369126-1.html
 load 403574-1.xhtml
 load 430124-1.html
 load 430628-1.html
 load 432114-1.html
 load 432114-2.html
 load 436900-1.html
-asserts(0-3) load 436900-2.html # bug 566159
+asserts(0-1) load 436900-2.html # bug 566159
 load 500328-1.html
 load 514779-1.xhtml
 load 614499-1.html
 load 678872-1.html
-skip-if(Android||B2G||browserIsRemote) pref(dom.disable_open_during_load,false) load 914521.html
+skip-if(Android||B2G) pref(dom.disable_open_during_load,false) load 914521.html
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -5102,17 +5102,17 @@ nsDocShell::DisplayLoadError(nsresult aE
     // Display an error page
     LoadErrorPage(aURI, aURL, errorPage.get(), error.get(),
                   messageStr.get(), cssClass.get(), aFailedChannel);
   } else {
     // The prompter reqires that our private window has a document (or it
     // asserts). Satisfy that assertion now since GetDoc will force
     // creation of one if it hasn't already been created.
     if (mScriptGlobal) {
-      unused << mScriptGlobal->GetDoc();
+      Unused << mScriptGlobal->GetDoc();
     }
 
     // Display a message box
     prompter->Alert(nullptr, messageStr.get());
   }
 
   return NS_OK;
 }
--- a/dom/animation/Animation.cpp
+++ b/dom/animation/Animation.cpp
@@ -928,17 +928,17 @@ Animation::ResumeAt(const TimeDuration& 
 }
 
 void
 Animation::PauseAt(const TimeDuration& aReadyTime)
 {
   MOZ_ASSERT(mPendingState == PendingState::PausePending,
              "Expected to pause a pause-pending animation");
 
-  if (!mStartTime.IsNull()) {
+  if (!mStartTime.IsNull() && mHoldTime.IsNull()) {
     mHoldTime.SetValue((aReadyTime - mStartTime.Value())
                         .MultDouble(mPlaybackRate));
   }
   mStartTime.SetNull();
   mPendingState = PendingState::NotPending;
 
   UpdateTiming(SeekFlag::NoSeek, SyncNotifyFlag::Async);
 
--- a/dom/animation/test/css-animations/file_animation-pausing.html
+++ b/dom/animation/test/css-animations/file_animation-pausing.html
@@ -252,11 +252,24 @@ test(function(t) {
 
   assert_throws('InvalidStateError',
                 function () { animation.pause(); },
                 'Expect InvalidStateError exception on calling pause() ' +
                 'from idle with a negative playbackRate and ' +
                 'infinite-duration animation');
 }, 'pause() from idle with a negative playbackRate and endless effect');
 
+promise_test(function(t) {
+  var div = addDiv(t, { style: 'animation: anim 1000s' });
+  return div.getAnimations()[0].ready
+    .then(function(animation) {
+      animation.finish();
+      animation.pause();
+      return animation.ready;
+    }).then(function(animation) {
+      assert_equals(animation.currentTime, 1000 * 1000,
+                    'currentTime after pausing finished animation');
+    });
+}, 'pause() on a finished animation');
+
 done();
 </script>
 </body>
--- a/dom/animation/test/testcommon.js
+++ b/dom/animation/test/testcommon.js
@@ -91,17 +91,17 @@ function flushComputedStyle(elem) {
 
 if (opener) {
   for (var funcName of ["async_test", "assert_not_equals", "assert_equals",
                         "assert_approx_equals", "assert_less_than",
                         "assert_less_than_equal", "assert_greater_than",
                         "assert_between_inclusive",
                         "assert_true", "assert_false",
                         "assert_class_string", "assert_throws",
-                        "assert_unreached", "test"]) {
+                        "assert_unreached", "promise_test", "test"]) {
     window[funcName] = opener[funcName].bind(opener);
   }
 
   window.EventWatcher = opener.EventWatcher;
 
   function done() {
     opener.add_completion_callback(function() {
       self.close();
--- a/dom/apps/tests/mochitest.ini
+++ b/dom/apps/tests/mochitest.ini
@@ -1,10 +1,9 @@
 [DEFAULT]
-skip-if = e10s
 support-files =
   addons/application.zip
   addons/invalid.webapp
   addons/invalid.webapp^headers^
   addons/update.webapp
   addons/update.webapp^headers^
   addons/index.html
   chromeAddCert.js
@@ -33,41 +32,41 @@ support-files =
   test_packaged_app_common.js
   marketplace/*
   pkg_install_iframe.html
   icon15.png
   icon15alternate.png
   icon48.png
 
 [test_app_addons.html]
-skip-if = os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
+skip-if = os == "android" || toolkit == "gonk" || e10s # embed-apps doesn't work in mochitest app
 [test_app_blocklist.html]
 skip-if = buildapp != 'mulet' # we need MOZ_B2G defined and the test to run in the parent process.
 [test_app_enabled.html]
 [test_app_update.html]
-skip-if = os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
+skip-if = os == "android" || toolkit == "gonk" || e10s # embed-apps doesn't work in mochitest app
 [test_bug_795164.html]
 [test_bug_1168300.html]
-skip-if = toolkit == "gonk" # see bug 1175784
+skip-if = toolkit == "gonk" || e10s # see bug 1175784
 [test_import_export.html]
 [test_install_dev_mode.html]
 [test_install_multiple_apps_origin.html]
 [test_install_receipts.html]
 [test_langpacks.html]
-skip-if = os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
+skip-if = os == "android" || toolkit == "gonk" || e10s # embed-apps doesn't work in mochitest app
 [test_marketplace_pkg_install.html]
 skip-if = buildapp == "b2g" || toolkit == "android" # see bug 989806
 [test_packaged_app_install.html]
 skip-if = (toolkit == 'android' && processor == 'x86') #x86 only
 [test_packaged_app_update.html]
 skip-if = (toolkit == 'android' && processor == 'x86') #x86 only
 [test_receipt_operations.html]
 [test_signed_pkg_install.html]
 [test_uninstall_errors.html]
 [test_theme_role.html]
 [test_third_party_homescreen.html]
-skip-if = os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
+skip-if = os == "android" || toolkit == "gonk" || e10s # embed-apps doesn't work in mochitest app
 [test_web_app_install.html]
 [test_widget.html]
-skip-if = os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
+skip-if = os == "android" || toolkit == "gonk" || e10s # embed-apps doesn't work in mochitest app
 [test_widget_browser.html]
-skip-if = os == "android" || toolkit == "gonk" # embed-apps doesn't work in mochitest app
+skip-if = os == "android" || toolkit == "gonk" || e10s # embed-apps doesn't work in mochitest app
 [test_checkInstalled.html]
--- a/dom/asmjscache/AsmJSCache.cpp
+++ b/dom/asmjscache/AsmJSCache.cpp
@@ -51,17 +51,17 @@ using mozilla::dom::quota::PersistenceTy
 using mozilla::dom::quota::QuotaManager;
 using mozilla::dom::quota::QuotaObject;
 using mozilla::dom::quota::UsageInfo;
 using mozilla::ipc::AssertIsOnBackgroundThread;
 using mozilla::ipc::BackgroundChild;
 using mozilla::ipc::IsOnBackgroundThread;
 using mozilla::ipc::PBackgroundChild;
 using mozilla::ipc::PrincipalInfo;
-using mozilla::unused;
+using mozilla::Unused;
 using mozilla::HashString;
 
 namespace mozilla {
 
 MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedPRFileDesc, PRFileDesc, PR_Close);
 
 namespace dom {
 namespace asmjscache {
@@ -473,17 +473,17 @@ private:
 
     mState = eFinished;
 
     MOZ_ASSERT(!mOpened);
 
     FinishOnOwningThread();
 
     if (!mActorDestroyed) {
-      unused << Send__delete__(this, mResult);
+      Unused << Send__delete__(this, mResult);
     }
   }
 
   // The same as method above but is intended to be called off the owning
   // thread.
   void
   FailOnNonOwningThread()
   {
@@ -988,17 +988,17 @@ ParentRunnable::Run()
     case eSendingMetadataForRead: {
       AssertIsOnOwningThread();
       MOZ_ASSERT(mOpenMode == eOpenForRead);
 
       mState = eWaitingToOpenCacheFileForRead;
 
       // Metadata is now open.
       if (!SendOnOpenMetadataForRead(mMetadata)) {
-        unused << Send__delete__(this, JS::AsmJSCache_InternalError);
+        Unused << Send__delete__(this, JS::AsmJSCache_InternalError);
       }
 
       return NS_OK;
     }
 
     case eDispatchToMainThread: {
       MOZ_ASSERT(NS_IsMainThread());
 
@@ -1030,17 +1030,17 @@ ParentRunnable::Run()
 
       // The entry is now open.
       MOZ_ASSERT(!mOpened);
       mOpened = true;
 
       FileDescriptor::PlatformHandleType handle =
         FileDescriptor::PlatformHandleType(PR_FileDesc2NativeHandle(mFileDesc));
       if (!SendOnOpenCacheFile(mFileSize, FileDescriptor(handle))) {
-        unused << Send__delete__(this, JS::AsmJSCache_InternalError);
+        Unused << Send__delete__(this, JS::AsmJSCache_InternalError);
       }
 
       return NS_OK;
     }
 
     case eFailing: {
       AssertIsOnOwningThread();
 
@@ -1446,17 +1446,17 @@ ChildRunnable::Run()
       mOpened = false;
 
       // Match the AddRef in BlockUntilOpen(). The main thread event loop still
       // holds an outstanding ref which will keep 'this' alive until returning to
       // the event loop.
       Release();
 
       if (!mActorDestroyed) {
-        unused << Send__delete__(this, JS::AsmJSCache_Success);
+        Unused << Send__delete__(this, JS::AsmJSCache_Success);
       }
 
       mState = eFinished;
       return NS_OK;
     }
 
     case eBackgroundChildPending:
     case eOpening:
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -1154,17 +1154,17 @@ FragmentOrElement::RemoveChildAt(uint32_
     doRemoveChildAt(aIndex, aNotify, oldKid, mAttrsAndChildren);
   }
 }
 
 void
 FragmentOrElement::GetTextContentInternal(nsAString& aTextContent,
                                           ErrorResult& aError)
 {
-  if(!nsContentUtils::GetNodeTextContent(this, true, aTextContent, fallible)) {
+  if (!nsContentUtils::GetNodeTextContent(this, true, aTextContent, fallible)) {
     aError.Throw(NS_ERROR_OUT_OF_MEMORY);
   }
 }
 
 void
 FragmentOrElement::SetTextContentInternal(const nsAString& aTextContent,
                                           ErrorResult& aError)
 {
--- a/dom/base/ImageEncoder.cpp
+++ b/dom/base/ImageEncoder.cpp
@@ -205,17 +205,17 @@ public:
     if (NS_FAILED(rv)) {
       mEncodingCompleteEvent->SetFailed();
     } else {
       mEncodingCompleteEvent->SetMembers(imgData, imgSize, mType);
     }
     rv = NS_DispatchToMainThread(mEncodingCompleteEvent);
     if (NS_FAILED(rv)) {
       // Better to leak than to crash.
-      unused << mEncodingCompleteEvent.forget();
+      Unused << mEncodingCompleteEvent.forget();
       return rv;
     }
 
     return rv;
   }
 
 private:
   nsAutoString mType;
rename from dom/base/crashtests/713417.html
rename to dom/base/crashtests/713417-1.html
--- a/dom/base/crashtests/crashtests.list
+++ b/dom/base/crashtests/crashtests.list
@@ -1,8 +1,9 @@
+load 43040-1.html
 load 90613-1.html
 load 116848-1.html
 load 149320-1.html
 load 205225-1.html
 load 231475-1.html
 load 244933-1.html
 load 275912-1.html
 load 293388-1.html
@@ -61,17 +62,16 @@ load 407818.html
 load 410860-1.xml
 load 411882-1.xhtml
 load 416734-1.html
 load 417852-1.html
 load 418928-1.html
 load 420620-1.html
 load 424276-1.html
 load 426987-1.html
-load 43040-1.html
 load 439206-1.html
 load 443538-1.svg
 load 448615-1.html
 load 450383-1.html
 load 450385-1.html
 skip load 458637-1.html # sporadically times out (bug 473680)
 load 462947.html
 load 467392.html
@@ -141,18 +141,18 @@ load 697643.html
 load 698974-1.html
 load 700090-1.html
 load 700090-2.html
 load 700512.html
 load 706283-1.html
 load 708405-1.html
 load 709384.html
 load 709954.html
+load 713417-1.html
 load 713417-2.html
-load 713417.html
 load 715056.html
 load 729431-1.xhtml
 load 741163-1.html
 load 745495.html
 load 752226-1.html
 load 752226-2.html
 load 766426.html
 load 771639.html
@@ -179,29 +179,29 @@ load 838489-2.html
 load 841205.html
 load 844404.html
 load 845093-1.html
 load 845093-2.html
 load 847127.html
 load 849601.html
 load 849727.html
 load 849732.html
-skip-if(Android) load 851353-1.html
+load 851353-1.html
 load 852381.html
 load 863950.html
 load 864448.html
 load 886213.html
 load 898906.html
 load 930250.html
 load 942979.html
 load 973401.html
 load 978646.html
-pref(dom.webcomponents.enabled,true) load 1027461-1.html
 pref(dom.webcomponents.enabled,true) load 1024428-1.html
 load 1026714.html
+pref(dom.webcomponents.enabled,true) load 1027461-1.html
 pref(dom.webcomponents.enabled,true) load 1029710.html
+load 1154598.xhtml
+load 1157995.html
+load 1181619.html
+load structured_clone_container_throws.html
 HTTP(..) load xhr_abortinprogress.html
 load xhr_empty_datauri.html
 load xhr_html_nullresponse.html
-load structured_clone_container_throws.html
-load 1154598.xhtml
-load 1157995.html
-load 1181619.html
--- a/dom/base/nsContentPermissionHelper.cpp
+++ b/dom/base/nsContentPermissionHelper.cpp
@@ -28,17 +28,17 @@
 #include "nsContentPermissionHelper.h"
 #include "nsJSUtils.h"
 #include "nsISupportsPrimitives.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIDocument.h"
 #include "nsIDOMEvent.h"
 #include "nsWeakPtr.h"
 
-using mozilla::unused;          // <snicker>
+using mozilla::Unused;          // <snicker>
 using namespace mozilla::dom;
 using namespace mozilla;
 
 #define kVisibilityChange "visibilitychange"
 
 NS_IMPL_ISUPPORTS(VisibilityChangeListener, nsIDOMEventListener)
 
 VisibilityChangeListener::VisibilityChangeListener(nsPIDOMWindow* aWindow)
@@ -468,17 +468,17 @@ NS_IMPL_ISUPPORTS(nsContentPermissionReq
 NS_IMETHODIMP
 nsContentPermissionRequestProxy::nsContentPermissionRequesterProxy
   ::GetVisibility(nsIContentPermissionRequestCallback* aCallback)
 {
   NS_ENSURE_ARG_POINTER(aCallback);
 
   mGetCallback = aCallback;
   mWaitGettingResult = true;
-  unused << mParent->SendGetVisibility();
+  Unused << mParent->SendGetVisibility();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsContentPermissionRequestProxy::nsContentPermissionRequesterProxy
   ::SetOnVisibilityChange(nsIContentPermissionRequestCallback* aCallback)
 {
   mOnChangeCallback = aCallback;
@@ -603,17 +603,17 @@ nsContentPermissionRequestProxy::Cancel(
   // Don't send out the delete message when the managing protocol (PBrowser) is
   // being destroyed and PContentPermissionRequest will soon be.
   if (mParent->IsBeingDestroyed()) {
     return NS_ERROR_FAILURE;
   }
 
   nsTArray<PermissionChoice> emptyChoices;
 
-  unused << ContentPermissionRequestParent::Send__delete__(mParent, false, emptyChoices);
+  Unused << ContentPermissionRequestParent::Send__delete__(mParent, false, emptyChoices);
   mParent = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsContentPermissionRequestProxy::Allow(JS::HandleValue aChoices)
 {
   if (mParent == nullptr) {
@@ -667,17 +667,17 @@ nsContentPermissionRequestProxy::Allow(J
         choices.AppendElement(PermissionChoice(type, choice));
       }
     }
   } else {
     MOZ_ASSERT(false, "SelectedChoices should be undefined or an JS object");
     return NS_ERROR_FAILURE;
   }
 
-  unused << ContentPermissionRequestParent::Send__delete__(mParent, true, choices);
+  Unused << ContentPermissionRequestParent::Send__delete__(mParent, true, choices);
   mParent = nullptr;
   return NS_OK;
 }
 
 void
 nsContentPermissionRequestProxy::NotifyVisibility(const bool& aIsVisible)
 {
   MOZ_ASSERT(mRequester);
@@ -771,22 +771,22 @@ RemotePermissionRequest::RecvGetVisibili
 {
   nsCOMPtr<nsIDocShell> docshell = mWindow->GetDocShell();
   if (!docshell) {
     return false;
   }
 
   bool isActive = false;
   docshell->GetIsActive(&isActive);
-  unused << SendNotifyVisibility(isActive);
+  Unused << SendNotifyVisibility(isActive);
   return true;
 }
 
 NS_IMETHODIMP
 RemotePermissionRequest::NotifyVisibility(bool isVisible)
 {
   if (!mIPCOpen) {
     return NS_OK;
   }
 
-  unused << SendNotifyVisibility(isVisible);
+  Unused << SendNotifyVisibility(isVisible);
   return NS_OK;
 }
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -1118,17 +1118,17 @@ nsFocusManager::EnsureCurrentWidgetFocus
     }
   }
 }
 
 void
 ActivateOrDeactivateChild(TabParent* aParent, void* aArg)
 {
   bool active = static_cast<bool>(aArg);
-  unused << aParent->SendParentActivated(active);
+  Unused << aParent->SendParentActivated(active);
 }
 
 void
 nsFocusManager::ActivateOrDeactivate(nsPIDOMWindow* aWindow, bool aActive)
 {
   if (!aWindow) {
     return;
   }
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -985,18 +985,18 @@ nsFrameLoader::SwapWithOtherRemoteLoader
   ourShell->BackingScaleFactorChanged();
   otherShell->BackingScaleFactorChanged();
 
   ourDoc->FlushPendingNotifications(Flush_Layout);
   otherDoc->FlushPendingNotifications(Flush_Layout);
 
   mInSwap = aOther->mInSwap = false;
 
-  unused << mRemoteBrowser->SendSwappedWithOtherRemoteLoader();
-  unused << aOther->mRemoteBrowser->SendSwappedWithOtherRemoteLoader();
+  Unused << mRemoteBrowser->SendSwappedWithOtherRemoteLoader();
+  Unused << aOther->mRemoteBrowser->SendSwappedWithOtherRemoteLoader();
   return NS_OK;
 }
 
 class MOZ_RAII AutoResetInFrameSwap final
 {
 public:
   AutoResetInFrameSwap(nsFrameLoader* aThisFrameLoader,
                        nsFrameLoader* aOtherFrameLoader,
@@ -2291,17 +2291,17 @@ nsFrameLoader::TryRemoteBrowser()
     rootChromeWin->GetBrowserDOMWindow(getter_AddRefs(browserDOMWin));
     mRemoteBrowser->SetBrowserDOMWindow(browserDOMWin);
   }
 
   if (mOwnerContent->AttrValueIs(kNameSpaceID_None,
                                  nsGkAtoms::mozpasspointerevents,
                                  nsGkAtoms::_true,
                                  eCaseMatters)) {
-    unused << mRemoteBrowser->SendSetUpdateHitRegion(true);
+    Unused << mRemoteBrowser->SendSetUpdateHitRegion(true);
   }
 
   ReallyLoadFrameScripts();
   InitializeBrowserAPI();
 
  return true;
 }
 
@@ -2336,24 +2336,24 @@ nsFrameLoader::DeactivateRemoteFrame() {
     return NS_OK;
   }
   return NS_ERROR_UNEXPECTED;
 }
 
 void
 nsFrameLoader::ActivateUpdateHitRegion() {
   if (mRemoteBrowser) {
-    unused << mRemoteBrowser->SendSetUpdateHitRegion(true);
+    Unused << mRemoteBrowser->SendSetUpdateHitRegion(true);
   }
 }
 
 void
 nsFrameLoader::DeactivateUpdateHitRegion() {
   if (mRemoteBrowser) {
-    unused << mRemoteBrowser->SendSetUpdateHitRegion(false);
+    Unused << mRemoteBrowser->SendSetUpdateHitRegion(false);
   }
 }
 
 NS_IMETHODIMP
 nsFrameLoader::SendCrossProcessMouseEvent(const nsAString& aType,
                                           float aX,
                                           float aY,
                                           int32_t aButton,
@@ -2852,17 +2852,17 @@ nsFrameLoader::ResetPermissionManagerSta
 /**
  * Send the RequestNotifyAfterRemotePaint message to the current Tab.
  */
 NS_IMETHODIMP
 nsFrameLoader::RequestNotifyAfterRemotePaint()
 {
   // If remote browsing (e10s), handle this with the TabParent.
   if (mRemoteBrowser) {
-    unused << mRemoteBrowser->SendRequestNotifyAfterRemotePaint();
+    Unused << mRemoteBrowser->SendRequestNotifyAfterRemotePaint();
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsFrameLoader::RequestNotifyLayerTreeReady()
 {
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -11618,17 +11618,17 @@ nsGlobalWindow::SetTimeoutOrInterval(nsI
     RefPtr<nsTimeout> copy = timeout;
 
     rv = timeout->InitTimer(realInterval);
     if (NS_FAILED(rv)) {
       return rv;
     }
 
     // The timeout is now also held in the timer's closure.
-    unused << copy.forget();
+    Unused << copy.forget();
   } else {
     // If we are frozen, however, then we instead simply set
     // timeout->mTimeRemaining to be the "time remaining" in the timeout (i.e.,
     // the interval itself). We don't create a timer for it, since that will
     // happen when we are thawed and the timeout will then get a timer and run
     // to completion.
 
     timeout->mTimeRemaining = delta;
@@ -12024,17 +12024,17 @@ nsGlobalWindow::RunTimeout(nsTimeout *aT
     bool timeout_was_cleared = RunTimeoutHandler(timeout, scx);
 
     if (timeout_was_cleared) {
       // The running timeout's window was cleared, this means that
       // ClearAllTimeouts() was called from a *nested* call, possibly
       // through a timeout that fired while a modal (to this window)
       // dialog was open or through other non-obvious paths.
       MOZ_ASSERT(dummy_timeout->HasRefCntOne(), "dummy_timeout may leak");
-      unused << timeoutExtraRef.forget().take();
+      Unused << timeoutExtraRef.forget().take();
 
       mTimeoutInsertionPoint = last_insertion_point;
 
       return;
     }
 
     // If we have a regular interval timer, we re-schedule the
     // timeout, accounting for clock drift.
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -30,16 +30,19 @@
 #include "mozilla/dom/DocumentType.h"
 #include "mozilla/dom/RangeBinding.h"
 #include "mozilla/dom/DOMRect.h"
 #include "mozilla/dom/ShadowRoot.h"
 #include "mozilla/dom/Selection.h"
 #include "mozilla/Telemetry.h"
 #include "mozilla/Likely.h"
 #include "nsCSSFrameConstructor.h"
+#include "nsStyleStruct.h"
+#include "nsStyleStructInlines.h"
+#include "nsComputedDOMStyle.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 JSObject*
 nsRange::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return RangeBinding::Wrap(aCx, this, aGivenProto);
@@ -3188,8 +3191,250 @@ nsRange::ExcludeNonSelectableNodes(nsTAr
         }
       }
       if (iter->IsDone()) {
         return;
       }
     }
   }
 }
+
+struct InnerTextAccumulator
+{
+  explicit InnerTextAccumulator(mozilla::dom::DOMString& aValue)
+    : mString(aValue.AsAString()), mRequiredLineBreakCount(0) {}
+  void FlushLineBreaks()
+  {
+    while (mRequiredLineBreakCount > 0) {
+      // Required line breaks at the start of the text are suppressed.
+      if (!mString.IsEmpty()) {
+        mString.Append('\n');
+      }
+      --mRequiredLineBreakCount;
+    }
+  }
+  void Append(char aCh)
+  {
+    Append(nsAutoString(aCh));
+  }
+  void Append(const nsAString& aString)
+  {
+    if (aString.IsEmpty()) {
+      return;
+    }
+    FlushLineBreaks();
+    mString.Append(aString);
+  }
+  void AddRequiredLineBreakCount(int8_t aCount)
+  {
+    mRequiredLineBreakCount = std::max(mRequiredLineBreakCount, aCount);
+  }
+
+  nsAString& mString;
+  int8_t mRequiredLineBreakCount;
+};
+
+static bool
+IsVisibleAndNotInReplacedElement(nsIFrame* aFrame)
+{
+  if (!aFrame || !aFrame->StyleVisibility()->IsVisible()) {
+    return false;
+  }
+  for (nsIFrame* f = aFrame->GetParent(); f; f = f->GetParent()) {
+    if (f->IsFrameOfType(nsIFrame::eReplaced) &&
+        !f->GetContent()->IsHTMLElement(nsGkAtoms::button)) {
+      return false;
+    }
+  }
+  return true;
+}
+
+static bool
+ElementIsVisible(Element* aElement)
+{
+  if (!aElement) {
+    return false;
+  }
+  RefPtr<nsStyleContext> sc = nsComputedDOMStyle::GetStyleContextForElement(
+    aElement, nullptr, nullptr);
+  return sc && sc->StyleVisibility()->IsVisible();
+}
+
+static void
+AppendTransformedText(InnerTextAccumulator& aResult,
+                      nsGenericDOMDataNode* aTextNode,
+                      int32_t aStart, int32_t aEnd)
+{
+  nsIFrame* frame = aTextNode->GetPrimaryFrame();
+  if (!IsVisibleAndNotInReplacedElement(frame)) {
+    return;
+  }
+  nsIFrame::RenderedText text = frame->GetRenderedText(aStart, aEnd);
+  aResult.Append(text.mString);
+}
+
+/**
+ * States for tree traversal. AT_NODE means that we are about to enter
+ * the current DOM node. AFTER_NODE means that we have just finished traversing
+ * the children of the current DOM node and are about to apply any
+ * "after processing the node's children" steps before we finish visiting
+ * the node.
+ */
+enum TreeTraversalState {
+  AT_NODE,
+  AFTER_NODE
+};
+
+static int8_t
+GetRequiredInnerTextLineBreakCount(nsIFrame* aFrame)
+{
+  if (aFrame->GetContent()->IsHTMLElement(nsGkAtoms::p)) {
+    return 2;
+  }
+  const nsStyleDisplay* styleDisplay = aFrame->StyleDisplay();
+  if (styleDisplay->IsBlockOutside(aFrame) ||
+      styleDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_CAPTION) {
+    return 1;
+  }
+  return 0;
+}
+
+static bool
+IsLastCellOfRow(nsIFrame* aFrame)
+{
+  nsIAtom* type = aFrame->GetType();
+  if (type != nsGkAtoms::tableCellFrame &&
+      type != nsGkAtoms::bcTableCellFrame) {
+    return true;
+  }
+  for (nsIFrame* c = aFrame; c; c = c->GetNextContinuation()) {
+    if (c->GetNextSibling()) {
+      return false;
+    }
+  }
+  return true;
+}
+
+static bool
+IsLastRowOfRowGroup(nsIFrame* aFrame)
+{
+  if (aFrame->GetType() != nsGkAtoms::tableRowFrame) {
+    return true;
+  }
+  for (nsIFrame* c = aFrame; c; c = c->GetNextContinuation()) {
+    if (c->GetNextSibling()) {
+      return false;
+    }
+  }
+  return true;
+}
+
+static bool
+IsLastNonemptyRowGroupOfTable(nsIFrame* aFrame)
+{
+  if (aFrame->GetType() != nsGkAtoms::tableRowGroupFrame) {
+    return true;
+  }
+  for (nsIFrame* c = aFrame; c; c = c->GetNextContinuation()) {
+    for (nsIFrame* next = c->GetNextSibling(); next; next = next->GetNextSibling()) {
+      if (next->GetFirstPrincipalChild()) {
+        return false;
+      }
+    }
+  }
+  return true;
+}
+
+void
+nsRange::GetInnerTextNoFlush(DOMString& aValue, ErrorResult& aError,
+                             nsIContent* aStartParent, uint32_t aStartOffset,
+                             nsIContent* aEndParent, uint32_t aEndOffset)
+{
+  InnerTextAccumulator result(aValue);
+  nsIContent* currentNode = aStartParent;
+  TreeTraversalState currentState = AFTER_NODE;
+  if (aStartParent->IsNodeOfType(nsINode::eTEXT)) {
+    auto t = static_cast<nsGenericDOMDataNode*>(aStartParent);
+    if (aStartParent == aEndParent) {
+      AppendTransformedText(result, t, aStartOffset, aEndOffset);
+      return;
+    }
+    AppendTransformedText(result, t, aStartOffset, t->TextLength());
+  } else {
+    if (uint32_t(aStartOffset) < aStartParent->GetChildCount()) {
+      currentNode = aStartParent->GetChildAt(aStartOffset);
+      currentState = AT_NODE;
+    }
+  }
+
+  nsIContent* endNode = aEndParent;
+  TreeTraversalState endState = AFTER_NODE;
+  if (aEndParent->IsNodeOfType(nsINode::eTEXT)) {
+    endState = AT_NODE;
+  } else {
+    if (uint32_t(aEndOffset) < aEndParent->GetChildCount()) {
+      endNode = aEndParent->GetChildAt(aEndOffset);
+      endState = AT_NODE;
+    }
+  }
+
+  while (currentNode != endNode || currentState != endState) {
+    nsIFrame* f = currentNode->GetPrimaryFrame();
+    bool isVisibleAndNotReplaced = IsVisibleAndNotInReplacedElement(f);
+    if (currentState == AT_NODE) {
+      bool isText = currentNode->IsNodeOfType(nsINode::eTEXT);
+      if (isText && currentNode->GetParent()->IsHTMLElement(nsGkAtoms::rp) &&
+          ElementIsVisible(currentNode->GetParent()->AsElement())) {
+        nsAutoString str;
+        currentNode->GetTextContent(str, aError);
+        result.Append(str);
+      } else if (isVisibleAndNotReplaced) {
+        result.AddRequiredLineBreakCount(GetRequiredInnerTextLineBreakCount(f));
+        if (isText) {
+          nsIFrame::RenderedText text = f->GetRenderedText();
+          result.Append(text.mString);
+        }
+      }
+      nsIContent* child = currentNode->GetFirstChild();
+      if (child) {
+        currentNode = child;
+        continue;
+      }
+      currentState = AFTER_NODE;
+    }
+    if (currentNode == endNode && currentState == endState) {
+      break;
+    }
+    if (isVisibleAndNotReplaced) {
+      if (currentNode->IsHTMLElement(nsGkAtoms::br)) {
+        result.Append('\n');
+      }
+      switch (f->StyleDisplay()->mDisplay) {
+      case NS_STYLE_DISPLAY_TABLE_CELL:
+        if (!IsLastCellOfRow(f)) {
+          result.Append('\t');
+        }
+        break;
+      case NS_STYLE_DISPLAY_TABLE_ROW:
+        if (!IsLastRowOfRowGroup(f) ||
+            !IsLastNonemptyRowGroupOfTable(f->GetParent())) {
+          result.Append('\n');
+        }
+        break;
+      }
+      result.AddRequiredLineBreakCount(GetRequiredInnerTextLineBreakCount(f));
+    }
+    nsIContent* next = currentNode->GetNextSibling();
+    if (next) {
+      currentNode = next;
+      currentState = AT_NODE;
+    } else {
+      currentNode = currentNode->GetParent();
+    }
+  }
+
+  if (aEndParent->IsNodeOfType(nsINode::eTEXT)) {
+    nsGenericDOMDataNode* t = static_cast<nsGenericDOMDataNode*>(aEndParent);
+    AppendTransformedText(result, t, 0, aEndOffset);
+  }
+  // Do not flush trailing line breaks! Required breaks at the end of the text
+  // are suppressed.
+}
--- a/dom/base/nsRange.h
+++ b/dom/base/nsRange.h
@@ -207,16 +207,22 @@ public:
   void SetStart(nsINode& aNode, uint32_t aOffset, ErrorResult& aErr);
   void SetStartAfter(nsINode& aNode, ErrorResult& aErr);
   void SetStartBefore(nsINode& aNode, ErrorResult& aErr);
   void SurroundContents(nsINode& aNode, ErrorResult& aErr);
   already_AddRefed<DOMRect> GetBoundingClientRect(bool aClampToEdge = true,
                                                   bool aFlushLayout = true);
   already_AddRefed<DOMRectList> GetClientRects(bool aClampToEdge = true,
                                                bool aFlushLayout = true);
+  static void GetInnerTextNoFlush(mozilla::dom::DOMString& aValue,
+                                  mozilla::ErrorResult& aError,
+                                  nsIContent* aStartParent,
+                                  uint32_t aStartOffset,
+                                  nsIContent* aEndParent,
+                                  uint32_t aEndOffset);
 
   nsINode* GetParentObject() const { return mOwner; }
   virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override final;
 
 private:
   // no copy's or assigns
   nsRange(const nsRange&);
   nsRange& operator=(const nsRange&);
--- a/dom/base/nsScriptLoader.cpp
+++ b/dom/base/nsScriptLoader.cpp
@@ -814,18 +814,18 @@ NotifyOffThreadScriptLoadCompletedRunnab
     nsCOMPtr<nsIThread> mainThread;
     NS_GetMainThread(getter_AddRefs(mainThread));
     if (mainThread) {
       NS_ProxyRelease(mainThread, mRequest);
       NS_ProxyRelease(mainThread, mLoader);
     } else {
       MOZ_ASSERT(false, "We really shouldn't leak!");
       // Better to leak than crash.
-      unused << mRequest.forget();
-      unused << mLoader.forget();
+      Unused << mRequest.forget();
+      Unused << mLoader.forget();
     }
   }
 }
 
 NS_IMETHODIMP
 NotifyOffThreadScriptLoadCompletedRunnable::Run()
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -885,17 +885,17 @@ nsScriptLoader::AttemptAsyncScriptCompil
                             OffThreadScriptLoaderCallback,
                             static_cast<void*>(runnable))) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   mDocument->BlockOnload();
   aRequest->mProgress = nsScriptLoadRequest::Progress_Compiling;
 
-  unused << runnable.forget();
+  Unused << runnable.forget();
   return NS_OK;
 }
 
 nsresult
 nsScriptLoader::CompileOffThreadOrProcessRequest(nsScriptLoadRequest* aRequest,
                                                  bool* oCompiledOffThread)
 {
   NS_ASSERTION(nsContentUtils::IsSafeToRunScript(),
--- a/dom/base/test/mochitest.ini
+++ b/dom/base/test/mochitest.ini
@@ -382,17 +382,17 @@ skip-if = buildapp == 'b2g' # b2g(86 tot
 skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(12 total, 2 failing - .mozSystem == true - got false, expected true + ) b2g-desktop(12 total, 2 failing - .mozSystem == true - got false, expected true + )
 [test_XHR_timeout.html]
 skip-if = buildapp == 'b2g' || (android_version == '18' && debug) # b2g(flaky on B2G, bug 960743) b2g-debug(flaky on B2G, bug 960743) b2g-desktop(flaky on B2G, bug 960743)
 support-files = test_XHR_timeout.js
 [test_base.xhtml]
 [test_blobconstructor.html]
 [test_blob_fragment_and_query.html]
 [test_bug166235.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined)
+skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined)
 [test_bug199959.html]
 [test_bug218236.html]
 [test_bug218277.html]
 [test_bug238409.html]
 [test_bug254337.html]
 [test_bug270145.xhtml]
 [test_bug276037-1.html]
 [test_bug276037-2.xhtml]
@@ -824,17 +824,17 @@ support-files = file_bug503473-frame.sjs
 skip-if = buildapp == 'b2g' || e10s
 support-files = file_bug1011748_redirect.sjs file_bug1011748_OK.sjs
 [test_bug1025933.html]
 [test_bug1037687.html]
 [test_element.matches.html]
 [test_user_select.html]
 skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android'
 [test_bug1081686.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s
+skip-if = buildapp == 'b2g' || toolkit == 'android'
 [test_window_define_nonconfigurable.html]
 skip-if = release_build
 [test_root_iframe.html]
 [test_performance_observer.html]
 [test_performance_user_timing.html]
 [test_bug1126851.html]
 skip-if = buildapp == 'mulet' || buildapp == 'b2g'
 [test_bug1118689.html]
--- a/dom/bindings/crashtests/crashtests.list
+++ b/dom/bindings/crashtests/crashtests.list
@@ -1,12 +1,12 @@
-skip-if(1) load 769464.html # bug 823822 - assert often leaks into other tests
+skip load 769464.html # bug 823822 - assert often leaks into other tests
 load 822340-1.html
 load 822340-2.html
 load 832899.html
+load 860551.html
 load 860591.html
-load 860551.html
+load 862092.html
 load 862610.html
-load 862092.html
 load 869038.html
 load 949940.html
 load 1010658-1.html
 load 1010658-2.html
--- a/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonA2dpInterface.cpp
@@ -60,17 +60,17 @@ BluetoothDaemonA2dpModule::ConnectCmd(
   nsresult rv = PackPDU(aRemoteAddr, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonA2dpModule::DisconnectCmd(
   const BluetoothAddress& aRemoteAddr, BluetoothA2dpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -81,17 +81,17 @@ BluetoothDaemonA2dpModule::DisconnectCmd
   nsresult rv = PackPDU(aRemoteAddr, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 // Responses
 //
 
 void
 BluetoothDaemonA2dpModule::ErrorRsp(
--- a/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonAvrcpInterface.cpp
@@ -63,17 +63,17 @@ BluetoothDaemonAvrcpModule::GetPlayStatu
   nsresult rv = PackPDU(aPlayStatus, aSongLen, aSongPos, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonAvrcpModule::ListPlayerAppAttrRspCmd(
   int aNumAttr, const BluetoothAvrcpPlayerAttribute* aPAttrs,
   BluetoothAvrcpResultHandler* aRes)
 {
@@ -89,17 +89,17 @@ BluetoothDaemonAvrcpModule::ListPlayerAp
     PackArray<BluetoothAvrcpPlayerAttribute>(aPAttrs, aNumAttr), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonAvrcpModule::ListPlayerAppValueRspCmd(
   int aNumVal, uint8_t* aPVals, BluetoothAvrcpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -113,17 +113,17 @@ BluetoothDaemonAvrcpModule::ListPlayerAp
                         PackArray<uint8_t>(aPVals, aNumVal), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonAvrcpModule::GetPlayerAppValueRspCmd(
   uint8_t aNumAttrs, const uint8_t* aIds, const uint8_t* aValues,
   BluetoothAvrcpResultHandler* aRes)
 {
@@ -138,17 +138,17 @@ BluetoothDaemonAvrcpModule::GetPlayerApp
     BluetoothAvrcpAttributeValuePairs(aIds, aValues, aNumAttrs), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonAvrcpModule::GetPlayerAppAttrTextRspCmd(
   int aNumAttr, const uint8_t* aIds, const char** aTexts,
   BluetoothAvrcpResultHandler* aRes)
 {
@@ -162,17 +162,17 @@ BluetoothDaemonAvrcpModule::GetPlayerApp
     BluetoothAvrcpAttributeTextPairs(aIds, aTexts, aNumAttr), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonAvrcpModule::GetPlayerAppValueTextRspCmd(
   int aNumVal, const uint8_t* aIds, const char** aTexts,
   BluetoothAvrcpResultHandler* aRes)
 {
@@ -186,17 +186,17 @@ BluetoothDaemonAvrcpModule::GetPlayerApp
     BluetoothAvrcpAttributeTextPairs(aIds, aTexts, aNumVal), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonAvrcpModule::GetElementAttrRspCmd(
   uint8_t aNumAttr, const BluetoothAvrcpElementAttribute* aAttr,
   BluetoothAvrcpResultHandler* aRes)
 {
@@ -210,17 +210,17 @@ BluetoothDaemonAvrcpModule::GetElementAt
     PackArray<BluetoothAvrcpElementAttribute>(aAttr, aNumAttr), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonAvrcpModule::SetPlayerAppValueRspCmd(
   BluetoothAvrcpStatus aRspStatus, BluetoothAvrcpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -232,17 +232,17 @@ BluetoothDaemonAvrcpModule::SetPlayerApp
   nsresult rv = PackPDU(aRspStatus, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonAvrcpModule::RegisterNotificationRspCmd(
   BluetoothAvrcpEvent aEvent, BluetoothAvrcpNotification aType,
   const BluetoothAvrcpNotificationParam& aParam,
   BluetoothAvrcpResultHandler* aRes)
@@ -261,17 +261,17 @@ BluetoothDaemonAvrcpModule::RegisterNoti
                         data, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonAvrcpModule::SetVolumeCmd(uint8_t aVolume,
                                          BluetoothAvrcpResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -283,17 +283,17 @@ BluetoothDaemonAvrcpModule::SetVolumeCmd
   nsresult rv = PackPDU(aVolume, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 // Responses
 //
 
 void
 BluetoothDaemonAvrcpModule::ErrorRsp(
--- a/dom/bluetooth/bluedroid/BluetoothDaemonCoreInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonCoreInterface.cpp
@@ -60,34 +60,34 @@ BluetoothDaemonCoreModule::EnableCmd(Blu
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_ENABLE,
                         0));
 
   nsresult rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::DisableCmd(BluetoothResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_DISABLE,
                         0));
 
   nsresult rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::GetAdapterPropertiesCmd(
   BluetoothResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -95,17 +95,17 @@ BluetoothDaemonCoreModule::GetAdapterPro
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_GET_ADAPTER_PROPERTIES,
                         0));
 
   nsresult rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::GetAdapterPropertyCmd(BluetoothPropertyType aType,
                                                  BluetoothResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -117,17 +117,17 @@ BluetoothDaemonCoreModule::GetAdapterPro
   nsresult rv = PackPDU(aType, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::SetAdapterPropertyCmd(
   const BluetoothProperty& aProperty, BluetoothResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -139,17 +139,17 @@ BluetoothDaemonCoreModule::SetAdapterPro
   nsresult rv = PackPDU(aProperty, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::GetRemoteDevicePropertiesCmd(
   const BluetoothAddress& aRemoteAddr, BluetoothResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -161,17 +161,17 @@ BluetoothDaemonCoreModule::GetRemoteDevi
   nsresult rv = PackPDU(aRemoteAddr, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::GetRemoteDevicePropertyCmd(
   const BluetoothAddress& aRemoteAddr,
   BluetoothPropertyType aType,
   BluetoothResultHandler* aRes)
@@ -185,17 +185,17 @@ BluetoothDaemonCoreModule::GetRemoteDevi
   nsresult rv = PackPDU(aRemoteAddr, aType, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::SetRemoteDevicePropertyCmd(
   const BluetoothAddress& aRemoteAddr,
   const BluetoothProperty& aProperty,
   BluetoothResultHandler* aRes)
@@ -209,17 +209,17 @@ BluetoothDaemonCoreModule::SetRemoteDevi
   nsresult rv = PackPDU(aRemoteAddr, aProperty, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::GetRemoteServiceRecordCmd(
   const BluetoothAddress& aRemoteAddr, const BluetoothUuid& aUuid,
   BluetoothResultHandler* aRes)
 {
@@ -232,17 +232,17 @@ BluetoothDaemonCoreModule::GetRemoteServ
   nsresult rv = PackPDU(aRemoteAddr, aUuid, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::GetRemoteServicesCmd(
   const BluetoothAddress& aRemoteAddr, BluetoothResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -253,51 +253,51 @@ BluetoothDaemonCoreModule::GetRemoteServ
   nsresult rv = PackPDU(aRemoteAddr, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::StartDiscoveryCmd(BluetoothResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_START_DISCOVERY,
                         0));
 
   nsresult rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::CancelDiscoveryCmd(BluetoothResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   nsAutoPtr<DaemonSocketPDU> pdu(
     new DaemonSocketPDU(SERVICE_ID, OPCODE_CANCEL_DISCOVERY,
                         0));
 
   nsresult rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::CreateBondCmd(const BluetoothAddress& aBdAddr,
                                          BluetoothTransport aTransport,
                                          BluetoothResultHandler* aRes)
 {
@@ -314,17 +314,17 @@ BluetoothDaemonCoreModule::CreateBondCmd
 #endif
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::RemoveBondCmd(const BluetoothAddress& aBdAddr,
                                          BluetoothResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -336,17 +336,17 @@ BluetoothDaemonCoreModule::RemoveBondCmd
   nsresult rv = PackPDU(aBdAddr, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::CancelBondCmd(const BluetoothAddress& aBdAddr,
                                          BluetoothResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -358,17 +358,17 @@ BluetoothDaemonCoreModule::CancelBondCmd
   nsresult rv = PackPDU(aBdAddr, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::PinReplyCmd(const BluetoothAddress& aBdAddr,
                                        bool aAccept,
                                        const BluetoothPinCode& aPinCode,
                                        BluetoothResultHandler* aRes)
@@ -382,17 +382,17 @@ BluetoothDaemonCoreModule::PinReplyCmd(c
   nsresult rv = PackPDU(aBdAddr, aAccept, aPinCode, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::SspReplyCmd(const BluetoothAddress& aBdAddr,
                                        BluetoothSspVariant aVariant,
                                        bool aAccept, uint32_t aPasskey,
                                        BluetoothResultHandler* aRes)
@@ -406,17 +406,17 @@ BluetoothDaemonCoreModule::SspReplyCmd(c
   nsresult rv = PackPDU(aBdAddr, aVariant, aAccept, aPasskey, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::DutModeConfigureCmd(bool aEnable,
                                                BluetoothResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -428,17 +428,17 @@ BluetoothDaemonCoreModule::DutModeConfig
   nsresult rv = PackPDU(aEnable, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::DutModeSendCmd(uint16_t aOpcode,
                                           uint8_t* aBuf, uint8_t aLen,
                                           BluetoothResultHandler* aRes)
 {
@@ -452,17 +452,17 @@ BluetoothDaemonCoreModule::DutModeSendCm
                         *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonCoreModule::LeTestModeCmd(uint16_t aOpcode,
                                          uint8_t* aBuf, uint8_t aLen,
                                          BluetoothResultHandler* aRes)
 {
@@ -476,17 +476,17 @@ BluetoothDaemonCoreModule::LeTestModeCmd
                         *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 // Responses
 //
 
 void
 BluetoothDaemonCoreModule::ErrorRsp(const DaemonSocketPDUHeader& aHeader,
--- a/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonGattInterface.cpp
@@ -62,17 +62,17 @@ BluetoothDaemonGattModule::ClientRegiste
 
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientUnregisterCmd(
   int aClientIf, BluetoothGattResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -84,17 +84,17 @@ BluetoothDaemonGattModule::ClientUnregis
   nsresult rv = PackPDU(aClientIf, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientScanCmd(
   int aClientIf, bool aStart, BluetoothGattResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -108,17 +108,17 @@ BluetoothDaemonGattModule::ClientScanCmd
                         PackConversion<bool, uint8_t>(aStart), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientConnectCmd(
   int aClientIf, const BluetoothAddress& aBdAddr, bool aIsDirect,
   BluetoothTransport aTransport, BluetoothGattResultHandler* aRes)
 {
@@ -138,17 +138,17 @@ BluetoothDaemonGattModule::ClientConnect
     PackConversion<BluetoothTransport, int32_t>(aTransport), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientDisconnectCmd(
   int aClientIf, const BluetoothAddress& aBdAddr, int aConnId,
   BluetoothGattResultHandler* aRes)
 {
@@ -166,17 +166,17 @@ BluetoothDaemonGattModule::ClientDisconn
                PackConversion<int, int32_t>(aConnId), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientListenCmd(
   int aClientIf, bool aIsStart, BluetoothGattResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -191,17 +191,17 @@ BluetoothDaemonGattModule::ClientListenC
                PackConversion<bool, uint8_t>(aIsStart), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientRefreshCmd(
   int aClientIf, const BluetoothAddress& aBdAddr,
   BluetoothGattResultHandler* aRes)
 {
@@ -217,17 +217,17 @@ BluetoothDaemonGattModule::ClientRefresh
                         *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientSearchServiceCmd(
   int aConnId, bool aFiltered, const BluetoothUuid& aUuid,
   BluetoothGattResultHandler* aRes)
 {
@@ -245,17 +245,17 @@ BluetoothDaemonGattModule::ClientSearchS
                         *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientGetIncludedServiceCmd(
   int aConnId, const BluetoothGattServiceId& aServiceId, bool aContinuation,
   const BluetoothGattServiceId& aStartServiceId,
   BluetoothGattResultHandler* aRes)
@@ -274,17 +274,17 @@ BluetoothDaemonGattModule::ClientGetIncl
                         aStartServiceId, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientGetCharacteristicCmd(
   int aConnId, const BluetoothGattServiceId& aServiceId, bool aContinuation,
   const BluetoothGattId& aStartCharId,
   BluetoothGattResultHandler* aRes)
@@ -304,17 +304,17 @@ BluetoothDaemonGattModule::ClientGetChar
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientGetDescriptorCmd(
   int aConnId, const BluetoothGattServiceId& aServiceId,
   const BluetoothGattId& aCharId, bool aContinuation,
   const BluetoothGattId& aStartDescriptorId,
@@ -336,17 +336,17 @@ BluetoothDaemonGattModule::ClientGetDesc
                         aStartDescriptorId, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientReadCharacteristicCmd(
   int aConnId, const BluetoothGattServiceId& aServiceId,
   const BluetoothGattId& aCharId, BluetoothGattAuthReq aAuthReq,
   BluetoothGattResultHandler* aRes)
@@ -364,17 +364,17 @@ BluetoothDaemonGattModule::ClientReadCha
                         aCharId, aAuthReq, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientWriteCharacteristicCmd(
   int aConnId, const BluetoothGattServiceId& aServiceId,
   const BluetoothGattId& aCharId, BluetoothGattWriteType aWriteType,
   int aLength, BluetoothGattAuthReq aAuthReq, char* aValue,
@@ -391,17 +391,17 @@ BluetoothDaemonGattModule::ClientWriteCh
                         PackArray<char>(aValue, aLength), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientReadDescriptorCmd(
   int aConnId, const BluetoothGattServiceId& aServiceId,
   const BluetoothGattId& aCharId, const BluetoothGattId& aDescriptorId,
   BluetoothGattAuthReq aAuthReq, BluetoothGattResultHandler* aRes)
@@ -420,17 +420,17 @@ BluetoothDaemonGattModule::ClientReadDes
                         aCharId, aDescriptorId, aAuthReq, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientWriteDescriptorCmd(
   int aConnId, const BluetoothGattServiceId& aServiceId,
   const BluetoothGattId& aCharId, const BluetoothGattId& aDescriptorId,
   BluetoothGattWriteType aWriteType, int aLength,
@@ -448,17 +448,17 @@ BluetoothDaemonGattModule::ClientWriteDe
                         PackArray<char>(aValue, aLength), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientExecuteWriteCmd(
   int aConnId, int aIsExecute, BluetoothGattResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -472,17 +472,17 @@ BluetoothDaemonGattModule::ClientExecute
                         PackConversion<int, int32_t>(aIsExecute), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientRegisterNotificationCmd(
   int aClientIf, const BluetoothAddress& aBdAddr,
   const BluetoothGattServiceId& aServiceId, const BluetoothGattId& aCharId,
   BluetoothGattResultHandler* aRes)
@@ -500,17 +500,17 @@ BluetoothDaemonGattModule::ClientRegiste
                         aBdAddr, aServiceId, aCharId, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientDeregisterNotificationCmd(
   int aClientIf, const BluetoothAddress& aBdAddr,
   const BluetoothGattServiceId& aServiceId, const BluetoothGattId& aCharId,
   BluetoothGattResultHandler* aRes)
@@ -528,17 +528,17 @@ BluetoothDaemonGattModule::ClientDeregis
                         aBdAddr, aServiceId, aCharId, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientReadRemoteRssiCmd(
   int aClientIf, const BluetoothAddress& aBdAddr,
   BluetoothGattResultHandler* aRes)
 {
@@ -553,17 +553,17 @@ BluetoothDaemonGattModule::ClientReadRem
                         aBdAddr, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientGetDeviceTypeCmd(
   const BluetoothAddress& aBdAddr, BluetoothGattResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -575,17 +575,17 @@ BluetoothDaemonGattModule::ClientGetDevi
   nsresult rv = PackPDU(aBdAddr, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientSetAdvDataCmd(
   int aServerIf, bool aIsScanRsp, bool aIsNameIncluded,
   bool aIsTxPowerIncluded, int aMinInterval, int aMaxInterval, int aApperance,
   uint16_t aManufacturerLen, char* aManufacturerData,
@@ -611,17 +611,17 @@ BluetoothDaemonGattModule::ClientSetAdvD
     aServiceUuidLen, PackArray<char>(aServiceUuid, aServiceUuidLen), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ClientTestCommandCmd(
   int aCommand, const BluetoothGattTestParam& aTestParam,
   BluetoothGattResultHandler* aRes)
 {
@@ -645,17 +645,17 @@ BluetoothDaemonGattModule::ClientTestCom
     aTestParam.mU5, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ServerRegisterCmd(
   const BluetoothUuid& aUuid, BluetoothGattResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -667,17 +667,17 @@ BluetoothDaemonGattModule::ServerRegiste
   nsresult rv = PackPDU(aUuid, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ServerUnregisterCmd(
   int aServerIf, BluetoothGattResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -689,17 +689,17 @@ BluetoothDaemonGattModule::ServerUnregis
   nsresult rv = PackPDU(PackConversion<int, int32_t>(aServerIf), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ServerConnectPeripheralCmd(
   int aServerIf, const BluetoothAddress& aBdAddr, bool aIsDirect,
   BluetoothTransport aTransport, BluetoothGattResultHandler* aRes)
 {
@@ -719,17 +719,17 @@ BluetoothDaemonGattModule::ServerConnect
     PackConversion<BluetoothTransport, int32_t>(aTransport), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ServerDisconnectPeripheralCmd(
   int aServerIf, const BluetoothAddress& aBdAddr, int aConnId,
   BluetoothGattResultHandler* aRes)
 {
@@ -746,17 +746,17 @@ BluetoothDaemonGattModule::ServerDisconn
                         PackConversion<int, int32_t>(aConnId), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ServerAddServiceCmd(
   int aServerIf, const BluetoothGattServiceId& aServiceId, uint16_t aNumHandles,
   BluetoothGattResultHandler* aRes)
 {
@@ -772,17 +772,17 @@ BluetoothDaemonGattModule::ServerAddServ
                         PackConversion<uint16_t, int32_t>(aNumHandles), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ServerAddIncludedServiceCmd(
   int aServerIf, const BluetoothAttributeHandle& aServiceHandle,
   const BluetoothAttributeHandle& aIncludedServiceHandle,
   BluetoothGattResultHandler* aRes)
@@ -799,17 +799,17 @@ BluetoothDaemonGattModule::ServerAddIncl
                         aServiceHandle, aIncludedServiceHandle, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ServerAddCharacteristicCmd(
   int aServerIf, const BluetoothAttributeHandle& aServiceHandle,
   const BluetoothUuid& aUuid, BluetoothGattCharProp aProperties,
   BluetoothGattAttrPerm aPermissions, BluetoothGattResultHandler* aRes)
@@ -830,17 +830,17 @@ BluetoothDaemonGattModule::ServerAddChar
     PackConversion<BluetoothGattAttrPerm, int32_t>(aPermissions), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ServerAddDescriptorCmd(
   int aServerIf, const BluetoothAttributeHandle& aServiceHandle,
   const BluetoothUuid& aUuid, BluetoothGattAttrPerm aPermissions,
   BluetoothGattResultHandler* aRes)
@@ -859,17 +859,17 @@ BluetoothDaemonGattModule::ServerAddDesc
     PackConversion<BluetoothGattAttrPerm, int32_t>(aPermissions), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ServerStartServiceCmd(
   int aServerIf, const BluetoothAttributeHandle& aServiceHandle,
   BluetoothTransport aTransport, BluetoothGattResultHandler* aRes)
 {
@@ -886,17 +886,17 @@ BluetoothDaemonGattModule::ServerStartSe
     PackConversion<BluetoothTransport, int32_t>(aTransport), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ServerStopServiceCmd(
   int aServerIf, const BluetoothAttributeHandle& aServiceHandle,
   BluetoothGattResultHandler* aRes)
 {
@@ -911,17 +911,17 @@ BluetoothDaemonGattModule::ServerStopSer
     PackConversion<int, int32_t>(aServerIf), aServiceHandle, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ServerDeleteServiceCmd(
   int aServerIf, const BluetoothAttributeHandle& aServiceHandle,
   BluetoothGattResultHandler* aRes)
 {
@@ -936,17 +936,17 @@ BluetoothDaemonGattModule::ServerDeleteS
     PackConversion<int, int32_t>(aServerIf), aServiceHandle, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ServerSendIndicationCmd(
   int aServerIf, const BluetoothAttributeHandle& aCharacteristicHandle,
   int aConnId, int aLength, bool aConfirm,
   uint8_t* aValue, BluetoothGattResultHandler* aRes)
@@ -965,17 +965,17 @@ BluetoothDaemonGattModule::ServerSendInd
                         PackArray<uint8_t>(aValue, aLength), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonGattModule::ServerSendResponseCmd(
   int aConnId, int aTransId, uint16_t aStatus,
   const BluetoothGattResponse& aResponse,
   BluetoothGattResultHandler* aRes)
@@ -998,17 +998,17 @@ BluetoothDaemonGattModule::ServerSendRes
 
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 // Responses
 //
 
 void
 BluetoothDaemonGattModule::ErrorRsp(
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHandsfreeInterface.cpp
@@ -66,17 +66,17 @@ BluetoothDaemonHandsfreeModule::ConnectC
   nsresult rv = PackPDU(aRemoteAddr, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::DisconnectCmd(
   const BluetoothAddress& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -88,17 +88,17 @@ BluetoothDaemonHandsfreeModule::Disconne
   nsresult rv = PackPDU(aRemoteAddr, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::ConnectAudioCmd(
   const BluetoothAddress& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -110,17 +110,17 @@ BluetoothDaemonHandsfreeModule::ConnectA
   nsresult rv = PackPDU(aRemoteAddr, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::DisconnectAudioCmd(
   const BluetoothAddress& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -132,17 +132,17 @@ BluetoothDaemonHandsfreeModule::Disconne
   nsresult rv = PackPDU(aRemoteAddr, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::StartVoiceRecognitionCmd(
   const BluetoothAddress& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -157,17 +157,17 @@ BluetoothDaemonHandsfreeModule::StartVoi
   if (NS_FAILED(rv)) {
     return rv;
   }
 #endif
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::StopVoiceRecognitionCmd(
   const BluetoothAddress& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -182,17 +182,17 @@ BluetoothDaemonHandsfreeModule::StopVoic
   if (NS_FAILED(rv)) {
     return rv;
   }
 #endif
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::VolumeControlCmd(
   BluetoothHandsfreeVolumeType aType, int aVolume,
   const BluetoothAddress& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
@@ -212,17 +212,17 @@ BluetoothDaemonHandsfreeModule::VolumeCo
 #endif
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::DeviceStatusNotificationCmd(
   BluetoothHandsfreeNetworkState aNtkState,
   BluetoothHandsfreeServiceType aSvcType, int aSignal, int aBattChg,
   BluetoothHandsfreeResultHandler* aRes)
@@ -241,17 +241,17 @@ BluetoothDaemonHandsfreeModule::DeviceSt
                         PackConversion<int, uint8_t>(aBattChg), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::CopsResponseCmd(
   const char* aCops, const BluetoothAddress& aRemoteAddr,
   BluetoothHandsfreeResultHandler* aRes)
 {
@@ -270,17 +270,17 @@ BluetoothDaemonHandsfreeModule::CopsResp
 #endif
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::CindResponseCmd(
   int aSvc, int aNumActive, int aNumHeld,
   BluetoothHandsfreeCallState aCallSetupState,
   int aSignal, int aRoam, int aBattChg,
@@ -321,17 +321,17 @@ BluetoothDaemonHandsfreeModule::CindResp
 #endif
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::FormattedAtResponseCmd(
   const char* aRsp, const BluetoothAddress& aRemoteAddr,
   BluetoothHandsfreeResultHandler* aRes)
 {
@@ -350,17 +350,17 @@ BluetoothDaemonHandsfreeModule::Formatte
 #endif
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::AtResponseCmd(
   BluetoothHandsfreeAtResponse aResponseCode, int aErrorCode,
   const BluetoothAddress& aRemoteAddr, BluetoothHandsfreeResultHandler* aRes)
 {
@@ -382,17 +382,17 @@ BluetoothDaemonHandsfreeModule::AtRespon
 #endif
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::ClccResponseCmd(
   int aIndex,
   BluetoothHandsfreeCallDirection aDir, BluetoothHandsfreeCallState aState,
   BluetoothHandsfreeCallMode aMode, BluetoothHandsfreeCallMptyType aMpty,
@@ -425,17 +425,17 @@ BluetoothDaemonHandsfreeModule::ClccResp
 #endif
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::PhoneStateChangeCmd(
   int aNumActive, int aNumHeld, BluetoothHandsfreeCallState aCallSetupState,
   const nsAString& aNumber, BluetoothHandsfreeCallAddressType aType,
   BluetoothHandsfreeResultHandler* aRes)
@@ -458,17 +458,17 @@ BluetoothDaemonHandsfreeModule::PhoneSta
                         PackCString0(NS_ConvertUTF16toUTF8(aNumber)), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 nsresult
 BluetoothDaemonHandsfreeModule::ConfigureWbsCmd(
   const BluetoothAddress& aRemoteAddr,
   BluetoothHandsfreeWbsConfig aConfig,
   BluetoothHandsfreeResultHandler* aRes)
@@ -483,17 +483,17 @@ BluetoothDaemonHandsfreeModule::Configur
   nsresult rv = PackPDU(aRemoteAddr, aConfig, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return NS_OK;
 }
 
 // Responses
 //
 
 void
 BluetoothDaemonHandsfreeModule::ErrorRsp(
--- a/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonInterface.cpp
@@ -440,17 +440,17 @@ BluetoothDaemonInterface::Init(
   BluetoothResultHandler* aRes)
 {
 #define BASE_SOCKET_NAME "bluetoothd"
   static unsigned long POSTFIX_LENGTH = 16;
 
   // If we could not cleanup properly before and an old
   // instance of the daemon is still running, we kill it
   // here.
-  unused << NS_WARN_IF(property_set("ctl.stop", "bluetoothd"));
+  Unused << NS_WARN_IF(property_set("ctl.stop", "bluetoothd"));
 
   mResultHandlerQ.AppendElement(aRes);
 
   if (!mProtocol) {
     mProtocol = new BluetoothDaemonProtocol();
   }
   static_cast<BluetoothDaemonCoreModule*>(mProtocol)->SetNotificationHandler(
     aNotificationHandler);
@@ -1001,17 +1001,17 @@ BluetoothDaemonInterface::OnConnectError
   MOZ_ASSERT(!mResultHandlerQ.IsEmpty());
 
   switch (aIndex) {
     case NTF_CHANNEL:
       // Close command channel
       mCmdChannel->Close();
     case CMD_CHANNEL:
       // Stop daemon and close listen socket
-      unused << NS_WARN_IF(property_set("ctl.stop", "bluetoothd"));
+      Unused << NS_WARN_IF(property_set("ctl.stop", "bluetoothd"));
       mListenSocket->Close();
     case LISTEN_SOCKET:
       if (!mResultHandlerQ.IsEmpty()) {
         // Signal error to caller
         RefPtr<BluetoothResultHandler> res = mResultHandlerQ.ElementAt(0);
         mResultHandlerQ.RemoveElementAt(0);
 
         if (res) {
--- a/dom/bluetooth/bluedroid/BluetoothDaemonSetupInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonSetupInterface.cpp
@@ -72,17 +72,17 @@ BluetoothDaemonSetupModule::RegisterModu
 #endif
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonSetupModule::UnregisterModuleCmd(
   BluetoothSetupServiceId aId, BluetoothSetupResultHandler* aRes)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -94,17 +94,17 @@ BluetoothDaemonSetupModule::UnregisterMo
   nsresult rv = PackPDU(aId, *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonSetupModule::ConfigurationCmd(
   const BluetoothConfigurationParameter* aParam, uint8_t aLen,
   BluetoothSetupResultHandler* aRes)
 {
@@ -118,17 +118,17 @@ BluetoothDaemonSetupModule::Configuratio
     aLen, PackArray<BluetoothConfigurationParameter>(aParam, aLen), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 // Responses
 //
 
 void
 BluetoothDaemonSetupModule::ErrorRsp(const DaemonSocketPDUHeader& aHeader,
--- a/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonSocketInterface.cpp
@@ -44,17 +44,17 @@ BluetoothDaemonSocketModule::ListenCmd(B
     SocketFlags(aEncrypt, aAuth), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 nsresult
 BluetoothDaemonSocketModule::ConnectCmd(const BluetoothAddress& aBdAddr,
                                         BluetoothSocketType aType,
                                         const BluetoothUuid& aServiceUuid,
                                         int aChannel, bool aEncrypt,
@@ -75,17 +75,17 @@ BluetoothDaemonSocketModule::ConnectCmd(
     SocketFlags(aEncrypt, aAuth), *pdu);
   if (NS_FAILED(rv)) {
     return rv;
   }
   rv = Send(pdu, aRes);
   if (NS_FAILED(rv)) {
     return rv;
   }
-  unused << pdu.forget();
+  Unused << pdu.forget();
   return rv;
 }
 
 /* |DeleteTask| deletes a class instance on the I/O thread
  */
 template <typename T>
 class DeleteTask final : public Task
 {
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
@@ -2296,17 +2296,17 @@ BluetoothServiceBluedroid::RemoteDeviceP
 
           mGetRemoteServiceRecordArray[i].mManager->OnGetServiceChannel(
             bdAddrStr, uuidStr, p.mServiceRecord.mChannel);
 
           mGetRemoteServiceRecordArray.RemoveElementAt(i);
           break;
         }
       }
-      unused << NS_WARN_IF(i == mGetRemoteServiceRecordArray.Length());
+      Unused << NS_WARN_IF(i == mGetRemoteServiceRecordArray.Length());
     } else if (p.mType == PROPERTY_UNKNOWN) {
       /* Bug 1065999: working around unknown properties */
     } else {
       BT_LOGD("Other non-handled device properties. Type: %d", p.mType);
     }
   }
 
   // The order of operations below is
--- a/dom/bluetooth/bluez/BluetoothDBusService.cpp
+++ b/dom/bluetooth/bluez/BluetoothDBusService.cpp
@@ -1229,17 +1229,17 @@ AppendDeviceName(BluetoothSignal& aSigna
 
   bool success = sDBusConnection->SendWithReply(
     AppendDeviceNameReplyHandler::Callback, handler.get(), 1000,
     BLUEZ_DBUS_BASE_IFC, NS_ConvertUTF16toUTF8(devicePath).get(),
     DBUS_DEVICE_IFACE, "GetProperties", DBUS_TYPE_INVALID);
 
   NS_ENSURE_TRUE_VOID(success);
 
-  unused << handler.forget(); // picked up by callback handler
+  Unused << handler.forget(); // picked up by callback handler
 }
 
 class SetPairingConfirmationTask : public Task
 {
 public:
   SetPairingConfirmationTask(const nsAString& aDeviceAddress,
                              bool aConfirm,
                              BluetoothReplyRunnable* aRunnable)
@@ -1655,17 +1655,17 @@ private:
       NS_ConvertUTF16toUTF8(sAdapterPath).get(),
       DBUS_ADAPTER_IFACE, "RegisterAgent",
       DBUS_TYPE_OBJECT_PATH, &agentPath,
       DBUS_TYPE_STRING, &capabilities,
       DBUS_TYPE_INVALID);
 
     NS_ENSURE_TRUE(success, false);
 
-    unused << handler.forget(); // picked up by callback handler
+    Unused << handler.forget(); // picked up by callback handler
 
     return true;
   }
 };
 
 class AddReservedServiceRecordsTask : public Task
 {
 public:
@@ -1694,17 +1694,17 @@ public:
       BLUEZ_DBUS_BASE_IFC,
       NS_ConvertUTF16toUTF8(sAdapterPath).get(),
       DBUS_ADAPTER_IFACE, "AddReservedServiceRecords",
       DBUS_TYPE_ARRAY, DBUS_TYPE_UINT32,
       &services, ArrayLength(sServices), DBUS_TYPE_INVALID);
 
     NS_ENSURE_TRUE_VOID(success);
 
-    unused << handler.forget(); /* picked up by callback handler */
+    Unused << handler.forget(); /* picked up by callback handler */
   }
 };
 
 class PrepareAdapterRunnable : public nsRunnable
 {
 public:
   PrepareAdapterRunnable()
   { }
@@ -2385,17 +2385,17 @@ protected:
       NS_ConvertUTF16toUTF8(mAdapterPath).get(),
       DBUS_ADAPTER_IFACE, "GetProperties", DBUS_TYPE_INVALID);
 
     if (!success) {
       aReplyError = NS_LITERAL_STRING("SendWithReply failed");
       return false;
     }
 
-    unused << handler.forget(); // picked up by callback handler
+    Unused << handler.forget(); // picked up by callback handler
 
     return true;
   }
 
   bool HandleGetPropertiesReply(DBusMessage* aReply,
                                 nsAutoString& aReplyError)
   {
     BluetoothValue value;
@@ -2445,17 +2445,17 @@ public:
 
     bool success = sDBusConnection->SendWithReply(
       DefaultAdapterPathReplyHandler::Callback,
       handler.get(), 1000, BLUEZ_DBUS_BASE_IFC,
       "/", DBUS_MANAGER_IFACE, "DefaultAdapter",
       DBUS_TYPE_INVALID);
     NS_ENSURE_TRUE_VOID(success);
 
-    unused << handler.forget(); // picked up by callback handler
+    Unused << handler.forget(); // picked up by callback handler
   }
 
 private:
   RefPtr<BluetoothReplyRunnable> mRunnable;
 };
 
 nsresult
 BluetoothDBusService::GetAdaptersInternal(BluetoothReplyRunnable* aRunnable)
@@ -2518,17 +2518,17 @@ public:
       OnSendDiscoveryMessageReply,
       static_cast<void*>(mRunnable.get()), -1,
       BLUEZ_DBUS_BASE_IFC,
       NS_ConvertUTF16toUTF8(sAdapterPath).get(),
       DBUS_ADAPTER_IFACE, mMessageName.get(),
       DBUS_TYPE_INVALID);
     NS_ENSURE_TRUE_VOID(success);
 
-    unused << mRunnable.forget(); // picked up by callback handler
+    Unused << mRunnable.forget(); // picked up by callback handler
   }
 
 private:
   const nsCString mMessageName;
   RefPtr<BluetoothReplyRunnable> mRunnable;
 };
 
 nsresult
@@ -2786,17 +2786,17 @@ protected:
       BluetoothArrayOfDevicePropertiesReplyHandler::Callback,
       handler.get(), 1000, BLUEZ_DBUS_BASE_IFC,
       NS_ConvertUTF16toUTF8(mObjectPath).get(),
       DBUS_DEVICE_IFACE, "GetProperties",
       DBUS_TYPE_INVALID);
 
     NS_ENSURE_TRUE(success, false);
 
-    unused << handler.forget(); // picked up by callback handler
+    Unused << handler.forget(); // picked up by callback handler
 
     return true;
   }
 
 private:
   nsString mObjectPath;
   const nsTArray<nsString> mDeviceAddresses;
   nsTArray<nsString>::size_type mProcessedDeviceAddresses;
@@ -2949,17 +2949,17 @@ public:
 
     // msg is unref'd as part of SendWithReply
     bool success = sDBusConnection->SendWithReply(
       GetVoidCallback,
       static_cast<void*>(mRunnable),
       1000, msg);
     NS_ENSURE_TRUE_VOID(success);
 
-    unused << mRunnable.forget(); // picked up by callback handler
+    Unused << mRunnable.forget(); // picked up by callback handler
   }
 
 private:
   BluetoothObjectType mType;
   const nsCString mName;
   RefPtr<BluetoothReplyRunnable> mRunnable;
 };
 
@@ -3094,17 +3094,17 @@ public:
       DBUS_ADAPTER_IFACE,
       "CreatePairedDevice",
       DBUS_TYPE_STRING, &deviceAddress,
       DBUS_TYPE_OBJECT_PATH, &deviceAgentPath,
       DBUS_TYPE_STRING, &capabilities,
       DBUS_TYPE_INVALID);
     NS_ENSURE_TRUE_VOID(success);
 
-    unused << mRunnable.forget(); // picked up by callback handler
+    Unused << mRunnable.forget(); // picked up by callback handler
 
     /**
      * FIXME: Bug 820274
      *
      * If the user turns off Bluetooth in the middle of pairing process,
      * the callback function GetObjectPathCallback may still be called
      * while enabling next time by dbus daemon. To prevent this from
      * happening, added a flag to distinguish if Bluetooth has been
@@ -3163,17 +3163,17 @@ public:
       OnRemoveDeviceReply, static_cast<void*>(mRunnable.get()), -1,
       BLUEZ_DBUS_BASE_IFC,
       NS_ConvertUTF16toUTF8(sAdapterPath).get(),
       DBUS_ADAPTER_IFACE, "RemoveDevice",
       DBUS_TYPE_OBJECT_PATH, &cstrDeviceObjectPath,
       DBUS_TYPE_INVALID);
     NS_ENSURE_TRUE_VOID(success);
 
-    unused << mRunnable.forget(); // picked up by callback handler
+    Unused << mRunnable.forget(); // picked up by callback handler
   }
 
 protected:
   static void OnRemoveDeviceReply(DBusMessage* aReply, void* aData)
   {
     nsAutoString errorStr;
 
     if (!aReply) {
@@ -3617,17 +3617,17 @@ public:
       BLUEZ_DBUS_BASE_IFC,
       NS_ConvertUTF16toUTF8(objectPath).get(),
       DBUS_DEVICE_IFACE, "GetServiceAttributeValue",
       DBUS_TYPE_STRING, &cstrServiceUUID,
       DBUS_TYPE_UINT16, &sProtocolDescriptorList,
       DBUS_TYPE_INVALID);
     NS_ENSURE_TRUE_VOID(success);
 
-    unused << handler.forget(); // picked up by callback handler
+    Unused << handler.forget(); // picked up by callback handler
   }
 
 private:
   nsString mDeviceAddress;
   nsString mServiceUUID;
   BluetoothProfileManagerBase* mBluetoothProfileManager;
 };
 
@@ -3922,17 +3922,17 @@ public:
       DBUS_TYPE_STRING, &album,
       DBUS_TYPE_STRING, &mediaNumber,
       DBUS_TYPE_STRING, &totalMediaCount,
       DBUS_TYPE_STRING, &duration,
       DBUS_TYPE_STRING, &genre,
       DBUS_TYPE_INVALID);
     NS_ENSURE_TRUE_VOID(success);
 
-    unused << mRunnable.forget(); // picked up by callback handler
+    Unused << mRunnable.forget(); // picked up by callback handler
   }
 
 private:
   const nsString mDeviceAddress;
   const nsCString mTitle;
   const nsCString mArtist;
   const nsCString mAlbum;
   int64_t mMediaNumber;
@@ -4052,17 +4052,17 @@ public:
       objectPath.get(),
       DBUS_CTL_IFACE, "UpdatePlayStatus",
       DBUS_TYPE_UINT32, &mDuration,
       DBUS_TYPE_UINT32, &mPosition,
       DBUS_TYPE_UINT32, &tempPlayStatus,
       DBUS_TYPE_INVALID);
     NS_ENSURE_TRUE_VOID(success);
 
-    unused << mRunnable.forget(); // picked up by callback handler
+    Unused << mRunnable.forget(); // picked up by callback handler
   }
 
 private:
   const nsString mDeviceAddress;
   int64_t mDuration;
   int64_t mPosition;
   ControlPlayStatus mPlayStatus;
   RefPtr<BluetoothReplyRunnable> mRunnable;
--- a/dom/bluetooth/common/BluetoothService.cpp
+++ b/dom/bluetooth/common/BluetoothService.cpp
@@ -449,17 +449,17 @@ void
 BluetoothService::SetEnabled(bool aEnabled)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   AutoInfallibleTArray<BluetoothParent*, 10> childActors;
   GetAllBluetoothActors(childActors);
 
   for (uint32_t index = 0; index < childActors.Length(); index++) {
-    unused << childActors[index]->SendEnabled(aEnabled);
+    Unused << childActors[index]->SendEnabled(aEnabled);
   }
 
   /**
    * mEnabled: real status of bluetooth
    * aEnabled: expected status of bluetooth
    */
   if (mEnabled == aEnabled) {
     BT_WARNING("Bluetooth is already %s, or the toggling failed.",
--- a/dom/bluetooth/ipc/BluetoothParent.cpp
+++ b/dom/bluetooth/ipc/BluetoothParent.cpp
@@ -12,17 +12,17 @@
 #include "mozilla/unused.h"
 #include "nsDebug.h"
 #include "nsISupportsImpl.h"
 #include "nsThreadUtils.h"
 
 #include "BluetoothReplyRunnable.h"
 #include "BluetoothService.h"
 
-using mozilla::unused;
+using mozilla::Unused;
 USING_BLUETOOTH_NAMESPACE
 
 /*******************************************************************************
  * BluetoothRequestParent::ReplyRunnable
  ******************************************************************************/
 
 class BluetoothRequestParent::ReplyRunnable final : public BluetoothReplyRunnable
 {
@@ -94,17 +94,17 @@ BluetoothParent::~BluetoothParent()
   MOZ_ASSERT(mShutdownState == Dead);
 }
 
 void
 BluetoothParent::BeginShutdown()
 {
   // Only do something here if we haven't yet begun the shutdown sequence.
   if (mShutdownState == Running) {
-    unused << SendBeginShutdown();
+    Unused << SendBeginShutdown();
     mShutdownState = SentBeginShutdown;
   }
 }
 
 bool
 BluetoothParent::InitWithService(BluetoothService* aService)
 {
   MOZ_ASSERT(aService);
@@ -352,17 +352,17 @@ BluetoothParent::DeallocPBluetoothReques
 {
   delete aActor;
   return true;
 }
 
 void
 BluetoothParent::Notify(const BluetoothSignal& aSignal)
 {
-  unused << SendNotify(aSignal);
+  Unused << SendNotify(aSignal);
 }
 
 /*******************************************************************************
  * BluetoothRequestParent
  ******************************************************************************/
 
 BluetoothRequestParent::BluetoothRequestParent(BluetoothService* aService)
 : mService(aService)
--- a/dom/broadcastchannel/BroadcastChannelParent.cpp
+++ b/dom/broadcastchannel/BroadcastChannelParent.cpp
@@ -55,17 +55,17 @@ BroadcastChannelParent::RecvClose()
 
   if (NS_WARN_IF(!mService)) {
     return false;
   }
 
   mService->UnregisterActor(this);
   mService = nullptr;
 
-  unused << Send__delete__(this);
+  Unused << Send__delete__(this);
 
   return true;
 }
 
 void
 BroadcastChannelParent::ActorDestroy(ActorDestroyReason aWhy)
 {
   AssertIsOnBackgroundThread();
@@ -100,14 +100,14 @@ BroadcastChannelParent::CheckAndDeliver(
         BackgroundParent::GetOrCreateActorForBlobImpl(Manager(), impl);
       if (!blobParent) {
         return;
       }
 
       newData.blobsParent()[i] = blobParent;
     }
 
-    unused << SendNotify(newData);
+    Unused << SendNotify(newData);
   }
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/broadcastchannel/tests/mochitest.ini
+++ b/dom/broadcastchannel/tests/mochitest.ini
@@ -15,12 +15,12 @@ support-files =
 [test_broadcastchannel_any.html]
 [test_broadcastchannel_basic.html]
 [test_broadcastchannel_close.html]
 [test_broadcastchannel_self.html]
 [test_broadcastchannel_sharedWorker.html]
 [test_broadcastchannel_worker.html]
 [test_broadcastchannel_worker_alive.html]
 [test_broadcastchannel_mozbrowser.html]
-skip-if = e10s || buildapp == 'b2g'
+skip-if = buildapp == 'b2g'
 [test_broadcastchannel_mozbrowser2.html]
-skip-if = e10s || buildapp == 'b2g'
+skip-if = buildapp == 'b2g'
 [test_bfcache.html]
--- a/dom/cache/AutoUtils.cpp
+++ b/dom/cache/AutoUtils.cpp
@@ -19,17 +19,17 @@
 #include "mozilla/ipc/FileDescriptorSetChild.h"
 #include "mozilla/ipc/FileDescriptorSetParent.h"
 #include "mozilla/ipc/PBackgroundParent.h"
 #include "nsCRT.h"
 #include "nsHttp.h"
 
 namespace {
 
-using mozilla::unused;
+using mozilla::Unused;
 using mozilla::dom::cache::CachePushStreamChild;
 using mozilla::dom::cache::CacheReadStream;
 using mozilla::dom::cache::CacheReadStreamOrVoid;
 using mozilla::ipc::FileDescriptor;
 using mozilla::ipc::FileDescriptorSetChild;
 using mozilla::ipc::FileDescriptorSetParent;
 using mozilla::ipc::OptionalFileDescriptorSet;
 
@@ -49,17 +49,17 @@ CleanupChildFds(CacheReadStream& aReadSt
 
   nsAutoTArray<FileDescriptor, 4> fds;
 
   FileDescriptorSetChild* fdSetActor =
     static_cast<FileDescriptorSetChild*>(aReadStream.fds().get_PFileDescriptorSetChild());
   MOZ_ASSERT(fdSetActor);
 
   if (aAction == Delete) {
-    unused << fdSetActor->Send__delete__(fdSetActor);
+    Unused << fdSetActor->Send__delete__(fdSetActor);
   }
 
   // FileDescriptorSet doesn't clear its fds in its ActorDestroy, so we
   // unconditionally forget them here.  The fds themselves are auto-closed in
   // ~FileDescriptor since they originated in this process.
   fdSetActor->ForgetFileDescriptors(fds);
 }
 
@@ -109,17 +109,17 @@ CleanupParentFds(CacheReadStream& aReadS
 
   nsAutoTArray<FileDescriptor, 4> fds;
 
   FileDescriptorSetParent* fdSetActor =
     static_cast<FileDescriptorSetParent*>(aReadStream.fds().get_PFileDescriptorSetParent());
   MOZ_ASSERT(fdSetActor);
 
   if (aAction == Delete) {
-    unused << fdSetActor->Send__delete__(fdSetActor);
+    Unused << fdSetActor->Send__delete__(fdSetActor);
   }
 
   // FileDescriptorSet doesn't clear its fds in its ActorDestroy, so we
   // unconditionally forget them here.  The fds themselves are auto-closed in
   // ~FileDescriptor since they originated in this process.
   fdSetActor->ForgetFileDescriptors(fds);
 }
 
@@ -477,25 +477,25 @@ AutoParentOpResult::~AutoParentOpResult(
       break;
     }
     case CacheOpResult::TStorageOpenResult:
     {
       StorageOpenResult& result = mOpResult.get_StorageOpenResult();
       if (action == Forget || result.actorParent() == nullptr) {
         break;
       }
-      unused << PCacheParent::Send__delete__(result.actorParent());
+      Unused << PCacheParent::Send__delete__(result.actorParent());
     }
     default:
       // other types do not need clean up
       break;
   }
 
   if (action == Delete && mStreamControl) {
-    unused << PCacheStreamControlParent::Send__delete__(mStreamControl);
+    Unused << PCacheStreamControlParent::Send__delete__(mStreamControl);
   }
 }
 
 void
 AutoParentOpResult::Add(CacheId aOpenedCacheId, Manager* aManager)
 {
   MOZ_ASSERT(mOpResult.type() == CacheOpResult::TStorageOpenResult);
   MOZ_ASSERT(mOpResult.get_StorageOpenResult().actorParent() == nullptr);
--- a/dom/cache/CacheChild.cpp
+++ b/dom/cache/CacheChild.cpp
@@ -119,17 +119,17 @@ CacheChild::StartDestroy()
   }
 
   listener->DestroyInternal(this);
 
   // Cache listener should call ClearListener() in DestroyInternal()
   MOZ_ASSERT(!mListener);
 
   // Start actor destruction from parent process
-  unused << SendTeardown();
+  Unused << SendTeardown();
 }
 
 void
 CacheChild::ActorDestroy(ActorDestroyReason aReason)
 {
   NS_ASSERT_OWNINGTHREAD(CacheChild);
   RefPtr<Cache> listener = mListener;
   if (listener) {
--- a/dom/cache/CacheOpParent.cpp
+++ b/dom/cache/CacheOpParent.cpp
@@ -51,17 +51,17 @@ CacheOpParent::Execute(ManagerId* aManag
 {
   NS_ASSERT_OWNINGTHREAD(CacheOpParent);
   MOZ_ASSERT(!mManager);
   MOZ_ASSERT(!mVerifier);
 
   RefPtr<Manager> manager;
   nsresult rv = Manager::GetOrCreate(aManagerId, getter_AddRefs(manager));
   if (NS_WARN_IF(NS_FAILED(rv))) {
-    unused << Send__delete__(this, ErrorResult(rv), void_t());
+    Unused << Send__delete__(this, ErrorResult(rv), void_t());
     return;
   }
 
   Execute(manager);
 }
 
 void
 CacheOpParent::Execute(Manager* aManager)
@@ -139,17 +139,17 @@ void
 CacheOpParent::OnPrincipalVerified(nsresult aRv, ManagerId* aManagerId)
 {
   NS_ASSERT_OWNINGTHREAD(CacheOpParent);
 
   mVerifier->RemoveListener(this);
   mVerifier = nullptr;
 
   if (NS_WARN_IF(NS_FAILED(aRv))) {
-    unused << Send__delete__(this, ErrorResult(aRv), void_t());
+    Unused << Send__delete__(this, ErrorResult(aRv), void_t());
     return;
   }
 
   Execute(aManagerId);
 }
 
 void
 CacheOpParent::OnOpComplete(ErrorResult&& aRv, const CacheOpResult& aResult,
@@ -160,17 +160,17 @@ CacheOpParent::OnOpComplete(ErrorResult&
 {
   NS_ASSERT_OWNINGTHREAD(CacheOpParent);
   MOZ_ASSERT(mIpcManager);
   MOZ_ASSERT(mManager);
 
   // Never send an op-specific result if we have an error.  Instead, send
   // void_t() to ensure that we don't leak actors on the child side.
   if (NS_WARN_IF(aRv.Failed())) {
-    unused << Send__delete__(this, aRv, void_t());
+    Unused << Send__delete__(this, aRv, void_t());
     aRv.SuppressException(); // We serialiazed it, as best we could.
     return;
   }
 
   // The result must contain the appropriate type at this point.  It may
   // or may not contain the additional result data yet.  For types that
   // do not need special processing, it should already be set.  If the
   // result requires actor-specific operations, then we do that below.
@@ -185,17 +185,17 @@ CacheOpParent::OnOpComplete(ErrorResult&
   for (uint32_t i = 0; i < aSavedResponseList.Length(); ++i) {
     result.Add(aSavedResponseList[i], aStreamList);
   }
 
   for (uint32_t i = 0; i < aSavedRequestList.Length(); ++i) {
     result.Add(aSavedRequestList[i], aStreamList);
   }
 
-  unused << Send__delete__(this, aRv, result.SendAsOpResult());
+  Unused << Send__delete__(this, aRv, result.SendAsOpResult());
 }
 
 already_AddRefed<nsIInputStream>
 CacheOpParent::DeserializeCacheStream(const CacheReadStreamOrVoid& aStreamOrVoid)
 {
   if (aStreamOrVoid.type() == CacheReadStreamOrVoid::Tvoid_t) {
     return nullptr;
   }
--- a/dom/cache/CachePushStreamChild.cpp
+++ b/dom/cache/CachePushStreamChild.cpp
@@ -187,17 +187,17 @@ CachePushStreamChild::DoRead()
     buffer.SetLength(expectedBytes);
 
     uint32_t bytesRead = 0;
     rv = mStream->Read(buffer.BeginWriting(), buffer.Length(), &bytesRead);
     buffer.SetLength(bytesRead);
 
     // If we read any data from the stream, send it across.
     if (!buffer.IsEmpty()) {
-      unused << SendBuffer(buffer);
+      Unused << SendBuffer(buffer);
     }
 
     if (rv == NS_BASE_STREAM_WOULD_BLOCK) {
       Wait();
       return;
     }
 
     // Any other error or zero-byte read indicates end-of-stream
@@ -250,14 +250,14 @@ CachePushStreamChild::OnEnd(nsresult aRv
 
   mStream->CloseWithStatus(aRv);
 
   if (aRv == NS_BASE_STREAM_CLOSED) {
     aRv = NS_OK;
   }
 
   // This will trigger an ActorDestroy() from the parent side
-  unused << SendClose(aRv);
+  Unused << SendClose(aRv);
 }
 
 } // namespace cache
 } // namespace dom
 } // namespace mozilla
--- a/dom/cache/CachePushStreamParent.cpp
+++ b/dom/cache/CachePushStreamParent.cpp
@@ -74,17 +74,17 @@ CachePushStreamParent::RecvBuffer(const 
 
   return true;
 }
 
 bool
 CachePushStreamParent::RecvClose(const nsresult& aRv)
 {
   mWriter->CloseWithStatus(aRv);
-  unused << Send__delete__(this);
+  Unused << Send__delete__(this);
   return true;
 }
 
 CachePushStreamParent::CachePushStreamParent(nsIAsyncInputStream* aReader,
                                              nsIAsyncOutputStream* aWriter)
   : mReader(aReader)
   , mWriter(aWriter)
 {
--- a/dom/cache/CacheStorage.cpp
+++ b/dom/cache/CacheStorage.cpp
@@ -27,17 +27,17 @@
 #include "nsIScriptSecurityManager.h"
 #include "nsURLParsers.h"
 #include "WorkerPrivate.h"
 
 namespace mozilla {
 namespace dom {
 namespace cache {
 
-using mozilla::unused;
+using mozilla::Unused;
 using mozilla::ErrorResult;
 using mozilla::dom::workers::WorkerPrivate;
 using mozilla::ipc::BackgroundChild;
 using mozilla::ipc::PBackgroundChild;
 using mozilla::ipc::IProtocol;
 using mozilla::ipc::PrincipalInfo;
 using mozilla::ipc::PrincipalToPrincipalInfo;
 
--- a/dom/cache/CacheStorageChild.cpp
+++ b/dom/cache/CacheStorageChild.cpp
@@ -48,17 +48,17 @@ CacheStorageChild::ClearListener()
   mListener = nullptr;
 }
 
 void
 CacheStorageChild::ExecuteOp(nsIGlobalObject* aGlobal, Promise* aPromise,
                              nsISupports* aParent, const CacheOpArgs& aArgs)
 {
   mNumChildActors += 1;
-  unused << SendPCacheOpConstructor(
+  Unused << SendPCacheOpConstructor(
     new CacheOpChild(GetFeature(), aGlobal, aParent, aPromise), aArgs);
 }
 
 void
 CacheStorageChild::StartDestroyFromListener()
 {
   NS_ASSERT_OWNINGTHREAD(CacheStorageChild);
 
@@ -94,17 +94,17 @@ CacheStorageChild::StartDestroy()
   }
 
   listener->DestroyInternal(this);
 
   // CacheStorage listener should call ClearListener() in DestroyInternal()
   MOZ_ASSERT(!mListener);
 
   // Start actor destruction from parent process
-  unused << SendTeardown();
+  Unused << SendTeardown();
 }
 
 void
 CacheStorageChild::ActorDestroy(ActorDestroyReason aReason)
 {
   NS_ASSERT_OWNINGTHREAD(CacheStorageChild);
   RefPtr<CacheStorage> listener = mListener;
   if (listener) {
--- a/dom/cache/CacheStorageParent.cpp
+++ b/dom/cache/CacheStorageParent.cpp
@@ -96,17 +96,17 @@ CacheStorageParent::RecvPCacheOpConstruc
 
   if (mVerifier) {
     MOZ_ASSERT(!mManagerId);
     actor->WaitForVerification(mVerifier);
     return true;
   }
 
   if (NS_WARN_IF(NS_FAILED(mVerifiedStatus))) {
-    unused << CacheOpParent::Send__delete__(actor, ErrorResult(mVerifiedStatus),
+    Unused << CacheOpParent::Send__delete__(actor, ErrorResult(mVerifiedStatus),
                                             void_t());
     return true;
   }
 
   MOZ_ASSERT(mManagerId);
   actor->Execute(mManagerId);
   return true;
 }
--- a/dom/cache/CacheStreamControlChild.cpp
+++ b/dom/cache/CacheStreamControlChild.cpp
@@ -96,17 +96,17 @@ void
 CacheStreamControlChild::SerializeFds(CacheReadStream* aReadStreamOut,
                                       const nsTArray<FileDescriptor>& aFds)
 {
   NS_ASSERT_OWNINGTHREAD(CacheStreamControlChild);
   PFileDescriptorSetChild* fdSet = nullptr;
   if (!aFds.IsEmpty()) {
     fdSet = Manager()->SendPFileDescriptorSetConstructor(aFds[0]);
     for (uint32_t i = 1; i < aFds.Length(); ++i) {
-      unused << fdSet->SendAddFileDescriptor(aFds[i]);
+      Unused << fdSet->SendAddFileDescriptor(aFds[i]);
     }
   }
 
   if (fdSet) {
     aReadStreamOut->fds() = fdSet;
   } else {
     aReadStreamOut->fds() = void_t();
   }
@@ -123,24 +123,24 @@ CacheStreamControlChild::DeserializeFds(
 
   auto fdSetActor = static_cast<FileDescriptorSetChild*>(
     aReadStream.fds().get_PFileDescriptorSetChild());
   MOZ_ASSERT(fdSetActor);
 
   fdSetActor->ForgetFileDescriptors(aFdsOut);
   MOZ_ASSERT(!aFdsOut.IsEmpty());
 
-  unused << fdSetActor->Send__delete__(fdSetActor);
+  Unused << fdSetActor->Send__delete__(fdSetActor);
 }
 
 void
 CacheStreamControlChild::NoteClosedAfterForget(const nsID& aId)
 {
   NS_ASSERT_OWNINGTHREAD(CacheStreamControlChild);
-  unused << SendNoteClosed(aId);
+  Unused << SendNoteClosed(aId);
 
   // A stream has closed.  If we delayed StartDestry() due to this stream
   // being read, then we should check to see if any of the remaining streams
   // are active.  If none of our other streams have been read, then we can
   // proceed with the shutdown now.
   if (mDestroyDelayed && !HasEverBeenRead()) {
     mDestroyDelayed = false;
     RecvCloseAll();
--- a/dom/cache/CacheStreamControlParent.cpp
+++ b/dom/cache/CacheStreamControlParent.cpp
@@ -56,17 +56,17 @@ void
 CacheStreamControlParent::SerializeFds(CacheReadStream* aReadStreamOut,
                                        const nsTArray<FileDescriptor>& aFds)
 {
   NS_ASSERT_OWNINGTHREAD(CacheStreamControlParent);
   PFileDescriptorSetParent* fdSet = nullptr;
   if (!aFds.IsEmpty()) {
     fdSet = Manager()->SendPFileDescriptorSetConstructor(aFds[0]);
     for (uint32_t i = 1; i < aFds.Length(); ++i) {
-      unused << fdSet->SendAddFileDescriptor(aFds[i]);
+      Unused << fdSet->SendAddFileDescriptor(aFds[i]);
     }
   }
 
   if (fdSet) {
     aReadStreamOut->fds() = fdSet;
   } else {
     aReadStreamOut->fds() = void_t();
   }
@@ -136,25 +136,25 @@ CacheStreamControlParent::SetStreamList(
   mStreamList = aStreamList;
 }
 
 void
 CacheStreamControlParent::Close(const nsID& aId)
 {
   NS_ASSERT_OWNINGTHREAD(CacheStreamControlParent);
   NotifyClose(aId);
-  unused << SendClose(aId);
+  Unused << SendClose(aId);
 }
 
 void
 CacheStreamControlParent::CloseAll()
 {
   NS_ASSERT_OWNINGTHREAD(CacheStreamControlParent);
   NotifyCloseAll();
-  unused << SendCloseAll();
+  Unused << SendCloseAll();
 }
 
 void
 CacheStreamControlParent::Shutdown()
 {
   NS_ASSERT_OWNINGTHREAD(CacheStreamControlParent);
   if (!Send__delete__(this)) {
     // child process is gone, allow actor to be destroyed normally
--- a/dom/cache/FileUtils.cpp
+++ b/dom/cache/FileUtils.cpp
@@ -182,17 +182,17 @@ BodyStartWriteStream(const QuotaInfo& aQ
 // static
 void
 BodyCancelWrite(nsIFile* aBaseDir, nsISupports* aCopyContext)
 {
   MOZ_ASSERT(aBaseDir);
   MOZ_ASSERT(aCopyContext);
 
   nsresult rv = NS_CancelAsyncCopy(aCopyContext, NS_ERROR_ABORT);
-  unused << NS_WARN_IF(NS_FAILED(rv));
+  Unused << NS_WARN_IF(NS_FAILED(rv));
 
   // The partially written file must be cleaned up after the async copy
   // makes its callback.
 }
 
 // static
 nsresult
 BodyFinalizeWrite(nsIFile* aBaseDir, const nsID& aId)
--- a/dom/cache/Manager.cpp
+++ b/dom/cache/Manager.cpp
@@ -133,17 +133,17 @@ public:
 
     rv = dbDir->Append(NS_LITERAL_STRING("cache"));
     if (NS_WARN_IF(NS_FAILED(rv))) {
       aResolver->Resolve(rv);
       return;
     }
 
     rv = BodyDeleteFiles(dbDir, mDeletedBodyIdList);
-    unused << NS_WARN_IF(NS_FAILED(rv));
+    Unused << NS_WARN_IF(NS_FAILED(rv));
 
     aResolver->Resolve(rv);
   }
 
 private:
   nsTArray<nsID> mDeletedBodyIdList;
 };
 
@@ -892,17 +892,17 @@ private:
                         mDeletedBodyIdList);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         DoResolve(rv);
         return;
       }
     }
 
     rv = trans.Commit();
-    unused << NS_WARN_IF(NS_FAILED(rv));
+    Unused << NS_WARN_IF(NS_FAILED(rv));
 
     DoResolve(rv);
   }
 
   virtual void
   CompleteOnInitiatingThread(nsresult aRv) override
   {
     NS_ASSERT_OWNINGTHREAD(Action);
--- a/dom/cache/ReadStream.cpp
+++ b/dom/cache/ReadStream.cpp
@@ -15,17 +15,17 @@
 #include "mozilla/SnappyUncompressInputStream.h"
 #include "nsIAsyncInputStream.h"
 #include "nsTArray.h"
 
 namespace mozilla {
 namespace dom {
 namespace cache {
 
-using mozilla::unused;
+using mozilla::Unused;
 using mozilla::ipc::FileDescriptor;
 
 // ----------------------------------------------------------------------------
 
 // The inner stream class.  This is where all of the real work is done.  As
 // an invariant Inner::Close() must be called before ~Inner().  This is
 // guaranteed by our outer ReadStream class.
 class ReadStream::Inner final : public ReadStream::Controllable
--- a/dom/cache/TypeUtils.cpp
+++ b/dom/cache/TypeUtils.cpp
@@ -73,17 +73,17 @@ SerializeNormalStream(nsIInputStream* aS
   PFileDescriptorSetChild* fdSet = nullptr;
   if (!fds.IsEmpty()) {
     // We should not be serializing until we have an actor ready
     PBackgroundChild* manager = BackgroundChild::GetForCurrentThread();
     MOZ_ASSERT(manager);
 
     fdSet = manager->SendPFileDescriptorSetConstructor(fds[0]);
     for (uint32_t i = 1; i < fds.Length(); ++i) {
-      unused << fdSet->SendAddFileDescriptor(fds[i]);
+      Unused << fdSet->SendAddFileDescriptor(fds[i]);
     }
   }
 
   if (fdSet) {
     aReadStreamOut.fds() = fdSet;
   } else {
     aReadStreamOut.fds() = void_t();
   }
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -1021,17 +1021,17 @@ CanvasRenderingContext2D::ParseColor(con
     nsCOMPtr<nsIPresShell> presShell = GetPresShell();
     RefPtr<nsStyleContext> parentContext;
     if (mCanvasElement && mCanvasElement->IsInDoc()) {
       // Inherit from the canvas element.
       parentContext = nsComputedDOMStyle::GetStyleContextForElement(
         mCanvasElement, nullptr, presShell);
     }
 
-    unused << nsRuleNode::ComputeColor(
+    Unused << nsRuleNode::ComputeColor(
       value, presShell ? presShell->GetPresContext() : nullptr, parentContext,
       *aColor);
   }
   return true;
 }
 
 nsresult
 CanvasRenderingContext2D::Reset()
@@ -4883,17 +4883,17 @@ CanvasRenderingContext2D::DrawWindow(nsG
       return;
     }
 
     thebes = new gfxContext(drawDT);
     thebes->SetMatrix(gfxMatrix::Scaling(matrix._11, matrix._22));
   }
 
   nsCOMPtr<nsIPresShell> shell = presContext->PresShell();
-  unused << shell->RenderDocument(r, renderDocFlags, backgroundColor, thebes);
+  Unused << shell->RenderDocument(r, renderDocFlags, backgroundColor, thebes);
   if (drawDT) {
     RefPtr<SourceSurface> snapshot = drawDT->Snapshot();
     RefPtr<DataSourceSurface> data = snapshot->GetDataSurface();
 
     DataSourceSurface::MappedSurface rawData;
     if (NS_WARN_IF(!data->Map(DataSourceSurface::READ, &rawData))) {
         error.Throw(NS_ERROR_FAILURE);
         return;
--- a/dom/canvas/WebGL2ContextTransformFeedback.cpp
+++ b/dom/canvas/WebGL2ContextTransformFeedback.cpp
@@ -36,17 +36,17 @@ WebGL2Context::DeleteTransformFeedback(W
 
     if (!ValidateObjectAllowDeletedOrNull("deleteTransformFeedback", tf))
         return;
 
     if (!tf || tf->IsDeleted())
         return;
 
     if (mBoundTransformFeedback == tf)
-        BindTransformFeedback(LOCAL_GL_TRANSFORM_FEEDBACK, tf);
+        BindTransformFeedback(LOCAL_GL_TRANSFORM_FEEDBACK, nullptr);
 
     tf->RequestDelete();
 }
 
 bool
 WebGL2Context::IsTransformFeedback(WebGLTransformFeedback* tf)
 {
     if (IsContextLost())
--- a/dom/canvas/crashtests/crashtests.list
+++ b/dom/canvas/crashtests/crashtests.list
@@ -1,28 +1,26 @@
+load 0px-size-font-667225.html
+load 0px-size-font-shadow.html
 load 360293-1.html
 load 421715-1.html
 load 553938-1.html
 load 647480.html
 load 727547.html
-load 0px-size-font-667225.html
-load 0px-size-font-shadow.html
-load texImage2D.html
 load 729116.html
 load 745699-1.html
 load 746813-1.html
-# this test crashes in a bunch places still
-#load 745818-large-source.html
 load 743499-negative-size.html
-skip-if(Android) load 767337-1.html
+skip-if(Android||B2G) load 745818-large-source.html # Bug XXX - Crashes Android/B2G mid-run w/o a stack
+load 767337-1.html
 skip-if(Android||B2G) load 780392-1.html # bug 833371 for B2G
 skip-if(Android||B2G) skip-if(gtkWidget&&isDebugBuild) load 789933-1.html # bug 833371 for B2G, bug 1155252 for linux
 load 794463-1.html
 load 802926-1.html
 load 896047-1.html
 load 896047-2.html
 load 916128-1.html
 load 934939-1.html
 load 1099143-1.html
 load 1161277-1.html
 load 1183363.html
 load 1190705.html
-
+load texImage2D.html
--- a/dom/datastore/DataStoreService.cpp
+++ b/dom/datastore/DataStoreService.cpp
@@ -1321,17 +1321,17 @@ DataStoreService::EnableDataStore(uint32
   }
 
   // Notify the child processes.
   if (XRE_IsParentProcess()) {
     nsTArray<ContentParent*> children;
     ContentParent::GetAll(children);
     for (uint32_t i = 0; i < children.Length(); i++) {
       if (children[i]->NeedsDataStoreInfos()) {
-        unused << children[i]->SendDataStoreNotify(aAppId, nsAutoString(aName),
+        Unused << children[i]->SendDataStoreNotify(aAppId, nsAutoString(aName),
                                                    nsAutoString(aManifestURL));
       }
     }
   }
 
   // Maybe we have some pending request waiting for this DataStore.
   PendingRequests* requests;
   if (!mPendingRequests.Get(aName, &requests)) {
--- a/dom/devicestorage/DeviceStorageRequestParent.cpp
+++ b/dom/devicestorage/DeviceStorageRequestParent.cpp
@@ -410,17 +410,17 @@ DeviceStorageRequestParent::PostFreeSpac
 DeviceStorageRequestParent::PostFreeSpaceResultEvent::
   ~PostFreeSpaceResultEvent() {}
 
 nsresult
 DeviceStorageRequestParent::PostFreeSpaceResultEvent::CancelableRun() {
   MOZ_ASSERT(NS_IsMainThread());
 
   FreeSpaceStorageResponse response(mFreeSpace);
-  unused << mParent->Send__delete__(mParent, response);
+  Unused << mParent->Send__delete__(mParent, response);
   return NS_OK;
 }
 
 DeviceStorageRequestParent::PostUsedSpaceResultEvent::
   PostUsedSpaceResultEvent(DeviceStorageRequestParent* aParent,
                              const nsAString& aType,
                              uint64_t aUsedSpace)
   : CancelableRunnable(aParent)
@@ -432,17 +432,17 @@ DeviceStorageRequestParent::PostUsedSpac
 DeviceStorageRequestParent::PostUsedSpaceResultEvent::
   ~PostUsedSpaceResultEvent() {}
 
 nsresult
 DeviceStorageRequestParent::PostUsedSpaceResultEvent::CancelableRun() {
   MOZ_ASSERT(NS_IsMainThread());
 
   UsedSpaceStorageResponse response(mUsedSpace);
-  unused << mParent->Send__delete__(mParent, response);
+  Unused << mParent->Send__delete__(mParent, response);
   return NS_OK;
 }
 
 DeviceStorageRequestParent::PostErrorEvent::
   PostErrorEvent(DeviceStorageRequestParent* aParent, const char* aError)
   : CancelableRunnable(aParent)
 {
   CopyASCIItoUTF16(aError, mError);
@@ -450,34 +450,34 @@ DeviceStorageRequestParent::PostErrorEve
 
 DeviceStorageRequestParent::PostErrorEvent::~PostErrorEvent() {}
 
 nsresult
 DeviceStorageRequestParent::PostErrorEvent::CancelableRun() {
   MOZ_ASSERT(NS_IsMainThread());
 
   ErrorResponse response(mError);
-  unused << mParent->Send__delete__(mParent, response);
+  Unused << mParent->Send__delete__(mParent, response);
   return NS_OK;
 }
 
 DeviceStorageRequestParent::PostSuccessEvent::
   PostSuccessEvent(DeviceStorageRequestParent* aParent)
   : CancelableRunnable(aParent)
 {
 }
 
 DeviceStorageRequestParent::PostSuccessEvent::~PostSuccessEvent() {}
 
 nsresult
 DeviceStorageRequestParent::PostSuccessEvent::CancelableRun() {
   MOZ_ASSERT(NS_IsMainThread());
 
   SuccessResponse response;
-  unused << mParent->Send__delete__(mParent, response);
+  Unused << mParent->Send__delete__(mParent, response);
   return NS_OK;
 }
 
 DeviceStorageRequestParent::PostBlobSuccessEvent::
   PostBlobSuccessEvent(DeviceStorageRequestParent* aParent,
                        DeviceStorageFile* aFile,
                        uint32_t aLength,
                        nsACString& aMimeType,
@@ -504,24 +504,24 @@ DeviceStorageRequestParent::PostBlobSucc
   RefPtr<BlobImpl> blob =
     new BlobImplFile(fullPath, mime, mLength, mFile->mFile,
                      mLastModificationDate);
 
   ContentParent* cp = static_cast<ContentParent*>(mParent->Manager());
   BlobParent* actor = cp->GetOrCreateActorForBlobImpl(blob);
   if (!actor) {
     ErrorResponse response(NS_LITERAL_STRING(POST_ERROR_EVENT_UNKNOWN));
-    unused << mParent->Send__delete__(mParent, response);
+    Unused << mParent->Send__delete__(mParent, response);
     return NS_OK;
   }
 
   BlobResponse response;
   response.blobParent() = actor;
 
-  unused << mParent->Send__delete__(mParent, response);
+  Unused << mParent->Send__delete__(mParent, response);
   return NS_OK;
 }
 
 DeviceStorageRequestParent::PostEnumerationSuccessEvent::
   PostEnumerationSuccessEvent(DeviceStorageRequestParent* aParent,
                               const nsAString& aStorageType,
                               const nsAString& aRelPath,
                               InfallibleTArray<DeviceStorageFileValue>& aPaths)
@@ -535,17 +535,17 @@ DeviceStorageRequestParent::PostEnumerat
 DeviceStorageRequestParent::PostEnumerationSuccessEvent::
   ~PostEnumerationSuccessEvent() {}
 
 nsresult
 DeviceStorageRequestParent::PostEnumerationSuccessEvent::CancelableRun() {
   MOZ_ASSERT(NS_IsMainThread());
 
   EnumerationResponse response(mStorageType, mRelPath, mPaths);
-  unused << mParent->Send__delete__(mParent, response);
+  Unused << mParent->Send__delete__(mParent, response);
   return NS_OK;
 }
 
 DeviceStorageRequestParent::CreateFdEvent::
   CreateFdEvent(DeviceStorageRequestParent* aParent,
                  DeviceStorageFile* aFile)
   : CancelableRunnable(aParent)
   , mFile(aFile)
@@ -862,17 +862,17 @@ DeviceStorageRequestParent::PostPathResu
 }
 
 nsresult
 DeviceStorageRequestParent::PostPathResultEvent::CancelableRun()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   SuccessResponse response;
-  unused << mParent->Send__delete__(mParent, response);
+  Unused << mParent->Send__delete__(mParent, response);
   return NS_OK;
 }
 
 DeviceStorageRequestParent::PostFileDescriptorResultEvent::
   PostFileDescriptorResultEvent(DeviceStorageRequestParent* aParent,
                                 const FileDescriptor& aFileDescriptor)
   : CancelableRunnable(aParent)
   , mFileDescriptor(aFileDescriptor)
@@ -885,17 +885,17 @@ DeviceStorageRequestParent::PostFileDesc
 }
 
 nsresult
 DeviceStorageRequestParent::PostFileDescriptorResultEvent::CancelableRun()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   FileDescriptorResponse response(mFileDescriptor);
-  unused << mParent->Send__delete__(mParent, response);
+  Unused << mParent->Send__delete__(mParent, response);
   return NS_OK;
 }
 
 DeviceStorageRequestParent::PostFormatResultEvent::
   PostFormatResultEvent(DeviceStorageRequestParent* aParent,
                            DeviceStorageFile* aFile)
   : CancelableRunnable(aParent)
   , mFile(aFile)
@@ -913,17 +913,17 @@ DeviceStorageRequestParent::PostFormatRe
   MOZ_ASSERT(NS_IsMainThread());
 
   nsString state = NS_LITERAL_STRING("unavailable");
   if (mFile) {
     mFile->DoFormat(state);
   }
 
   FormatStorageResponse response(state);
-  unused << mParent->Send__delete__(mParent, response);
+  Unused << mParent->Send__delete__(mParent, response);
   return NS_OK;
 }
 
 DeviceStorageRequestParent::PostMountResultEvent::
   PostMountResultEvent(DeviceStorageRequestParent* aParent,
                            DeviceStorageFile* aFile)
   : CancelableRunnable(aParent)
   , mFile(aFile)
@@ -941,17 +941,17 @@ DeviceStorageRequestParent::PostMountRes
   MOZ_ASSERT(NS_IsMainThread());
 
   nsString state = NS_LITERAL_STRING("unavailable");
   if (mFile) {
     mFile->DoMount(state);
   }
 
   MountStorageResponse response(state);
-  unused << mParent->Send__delete__(mParent, response);
+  Unused << mParent->Send__delete__(mParent, response);
   return NS_OK;
 }
 
 DeviceStorageRequestParent::PostUnmountResultEvent::
   PostUnmountResultEvent(DeviceStorageRequestParent* aParent,
                            DeviceStorageFile* aFile)
   : CancelableRunnable(aParent)
   , mFile(aFile)
@@ -969,15 +969,15 @@ DeviceStorageRequestParent::PostUnmountR
   MOZ_ASSERT(NS_IsMainThread());
 
   nsString state = NS_LITERAL_STRING("unavailable");
   if (mFile) {
     mFile->DoUnmount(state);
   }
 
   UnmountStorageResponse response(state);
-  unused << mParent->Send__delete__(mParent, response);
+  Unused << mParent->Send__delete__(mParent, response);
   return NS_OK;
 }
 
 } // namespace devicestorage
 } // namespace dom
 } // namespace mozilla
--- a/dom/events/EventDispatcher.cpp
+++ b/dom/events/EventDispatcher.cpp
@@ -250,17 +250,17 @@ EventTargetChainItem::EventTargetChainIt
 {
   MOZ_ASSERT(!aTarget || mTarget == aTarget->GetTargetForEventTargetChain());
 }
 
 void
 EventTargetChainItem::PreHandleEvent(EventChainPreVisitor& aVisitor)
 {
   aVisitor.Reset();
-  unused << mTarget->PreHandleEvent(aVisitor);
+  Unused << mTarget->PreHandleEvent(aVisitor);
   SetForceContentDispatch(aVisitor.mForceContentDispatch);
   SetWantsWillHandleEvent(aVisitor.mWantsWillHandleEvent);
   SetMayHaveListenerManager(aVisitor.mMayHaveListenerManager);
   mItemFlags = aVisitor.mItemFlags;
   mItemData = aVisitor.mItemData;
 }
 
 void
--- a/dom/events/IMEStateManager.cpp
+++ b/dom/events/IMEStateManager.cpp
@@ -412,17 +412,17 @@ IMEStateManager::OnChangeFocusInternal(n
     sActiveTabParent ? sActiveTabParent->Manager() : nullptr;
   nsIContentParent* newContentParent =
     newTabParent ? newTabParent->Manager() : nullptr;
   if (sActiveTabParent && currentContentParent != newContentParent) {
     MOZ_LOG(sISMLog, LogLevel::Debug,
       ("ISM:   IMEStateManager::OnChangeFocusInternal(), notifying previous "
        "focused child process of parent process or another child process "
        "getting focus"));
-    unused << sActiveTabParent->SendStopIMEStateManagement();
+    Unused << sActiveTabParent->SendStopIMEStateManagement();
   }
 
   nsCOMPtr<nsIWidget> widget =
     (sPresContext == aPresContext) ? oldWidget.get() :
                                      aPresContext->GetRootWidget();
   if (NS_WARN_IF(!widget)) {
     MOZ_LOG(sISMLog, LogLevel::Error,
       ("ISM:   IMEStateManager::OnChangeFocusInternal(), FAILED due to "
@@ -440,17 +440,17 @@ IMEStateManager::OnChangeFocusInternal(n
 
   if (newTabParent) {
     if (aAction.mFocusChange == InputContextAction::MENU_GOT_PSEUDO_FOCUS ||
         aAction.mFocusChange == InputContextAction::MENU_LOST_PSEUDO_FOCUS) {
       // XXX When menu keyboard listener is being uninstalled, IME state needs
       //     to be restored by the child process asynchronously.  Therefore,
       //     some key events which are fired immediately after closing menu
       //     may not be handled by IME.
-      unused << newTabParent->
+      Unused << newTabParent->
         SendMenuKeyboardListenerInstalled(sInstalledMenuKeyboardListener);
       setIMEState = sInstalledMenuKeyboardListener;
     } else if (focusActuallyChanging) {
       InputContext context = widget->GetInputContext();
       if (context.mIMEState.mEnabled == IMEState::DISABLED) {
         setIMEState = false;
         MOZ_LOG(sISMLog, LogLevel::Debug,
           ("ISM:   IMEStateManager::OnChangeFocusInternal(), doesn't set IME "
--- a/dom/events/TextComposition.cpp
+++ b/dom/events/TextComposition.cpp
@@ -135,17 +135,17 @@ TextComposition::OnCompositionEventDisca
   // Note that this method is never called for synthesized events for emulating
   // commit or cancel composition.
 
   MOZ_ASSERT(aCompositionEvent->mFlags.mIsTrusted,
              "Shouldn't be called with untrusted event");
 
   if (mTabParent) {
     // The composition event should be discarded in the child process too.
-    unused << mTabParent->SendCompositionEvent(*aCompositionEvent);
+    Unused << mTabParent->SendCompositionEvent(*aCompositionEvent);
   }
 
   // XXX If composition events are discarded, should we dispatch them with
   //     runnable event?  However, even if we do so, it might make native IME
   //     confused due to async modification.  Especially when native IME is
   //     TSF.
   if (!aCompositionEvent->CausesDOMCompositionEndEvent()) {
     return;
@@ -213,17 +213,17 @@ TextComposition::DispatchCompositionEven
                    WidgetCompositionEvent* aCompositionEvent,
                    nsEventStatus* aStatus,
                    EventDispatchingCallback* aCallBack,
                    bool aIsSynthesized)
 {
   // If the content is a container of TabParent, composition should be in the
   // remote process.
   if (mTabParent) {
-    unused << mTabParent->SendCompositionEvent(*aCompositionEvent);
+    Unused << mTabParent->SendCompositionEvent(*aCompositionEvent);
     aCompositionEvent->mFlags.mPropagationStopped = true;
     if (aCompositionEvent->CausesDOMTextEvent()) {
       mLastData = aCompositionEvent->mData;
       // Although, the composition event hasn't been actually handled yet,
       // emulate an editor to be handling the composition event.
       EditorWillHandleCompositionChangeEvent(aCompositionEvent);
       EditorDidHandleCompositionChangeEvent();
     }
@@ -381,17 +381,17 @@ TextComposition::DispatchCompositionEven
 void
 TextComposition::HandleSelectionEvent(nsPresContext* aPresContext,
                                       TabParent* aTabParent,
                                       WidgetSelectionEvent* aSelectionEvent)
 {
   // If the content is a container of TabParent, composition should be in the
   // remote process.
   if (aTabParent) {
-    unused << aTabParent->SendSelectionEvent(*aSelectionEvent);
+    Unused << aTabParent->SendSelectionEvent(*aSelectionEvent);
     aSelectionEvent->mFlags.mPropagationStopped = true;
     return;
   }
 
   ContentEventHandler handler(aPresContext);
   AutoRestore<bool> saveHandlingSelectionEvent(sHandlingSelectionEvent);
   sHandlingSelectionEvent = true;
   // XXX During setting selection, a selection listener may change selection
--- a/dom/events/crashtests/crashtests.list
+++ b/dom/events/crashtests/crashtests.list
@@ -3,15 +3,15 @@ load 116206-1.html
 load 135345-1.html
 load 422009-1.xhtml
 load 457776-1.html
 load 496308-1.html
 load 682637-1.html
 load 1033343.html
 load 1035654-1.html
 load 1035654-2.html
+needs-focus load 1072137-1.html
 load 1143972-1.html
 load 1190036-1.html
-needs-focus load 1072137-1.html
 load eventctor-nulldictionary.html
 load eventctor-nullstorage.html
+load recursive-DOMNodeInserted.html
 load recursive-onload.html
-load recursive-DOMNodeInserted.html
--- a/dom/events/test/mochitest.ini
+++ b/dom/events/test/mochitest.ini
@@ -21,34 +21,34 @@ support-files =
 skip-if = buildapp == 'b2g' || buildapp == 'mulet'
 [test_bug238987.html]
 skip-if = buildapp == 'b2g'
 [test_bug288392.html]
 [test_bug299673-1.html]
 [test_bug1037990.html]
 [test_bug299673-2.html]
 [test_bug322588.html]
-skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || e10s #Bug 931116, b2g desktop specific, initial triage
+skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
 [test_bug328885.html]
 [test_bug336682_1.html]
 support-files = test_bug336682.js
 [test_bug367781.html]
 [test_bug368835.html]
 [test_bug379120.html]
 [test_bug391568.xhtml]
 [test_bug402089.html]
 [test_bug405632.html]
 [test_bug409604.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT
 [test_bug412567.html]
 [test_bug418986-3.html]
 # Sometimes fails to finish after tests pass on 'B2G ICS Emulator'.
 skip-if = (os == 'b2g')
 [test_bug422132.html]
-skip-if = buildapp == 'b2g' || e10s # b2g(2 failures out of 8, mousewheel test) b2g-debug(2 failures out of 8, mousewheel test) b2g-desktop(2 failures out of 8, mousewheel test)
+skip-if = buildapp == 'b2g' # b2g(2 failures out of 8, mousewheel test) b2g-debug(2 failures out of 8, mousewheel test) b2g-desktop(2 failures out of 8, mousewheel test)
 [test_bug426082.html]
 skip-if = buildapp == 'mulet' || buildapp == 'b2g' || os == "win" || toolkit == 'android' || e10s # Intermittent failures, bug 921693 # b2g(1 failure out of 6, Moving the mouse down from the label should have unpressed the button) b2g-debug(1 failure out of 6, Moving the mouse down from the label should have unpressed the button) b2g-desktop(1 failure out of 6, Moving the mouse down from the label should have unpressed the button)
 [test_bug427537.html]
 [test_bug428988.html]
 [test_bug432698.html]
 skip-if = buildapp == 'mulet'
 [test_bug443985.html]
 [test_bug447736.html]
@@ -59,17 +59,17 @@ skip-if = buildapp == 'mulet'
 [test_bug457672.html]
 skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' #CRASH_DUMP, RANDOM
 [test_bug489671.html]
 [test_bug493251.html]
 skip-if = buildapp == 'mulet' || (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
 [test_bug502818.html]
 skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM
 [test_bug508479.html]
-skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e10s #CRASH_DUMP, RANDOM # b2g(drag event, also fails on Android) b2g-debug(drag event, also fails on Android) b2g-desktop(drag event, also fails on Android)
+skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' #CRASH_DUMP, RANDOM # b2g(drag event, also fails on Android) b2g-debug(drag event, also fails on Android) b2g-desktop(drag event, also fails on Android)
 [test_bug822898.html]
 [test_bug517851.html]
 [test_bug534833.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' #CRASH_DUMP, RANDOM # b2g(4 failures out of 6, bug 901564,click not fired, also disabled on Android) b2g-debug(4 failures out of 6, bug 901564,click not fired, also disabled on Android) b2g-desktop(4 failures out of 6, bug 901564,click not fired, also disabled on Android)
 [test_bug545268.html]
 skip-if = buildapp == 'mulet' || (buildapp == 'b2g' && toolkit != 'gonk') || toolkit == 'android' #CRASH_DUMP, RANDOM #Bug 931116, b2g desktop specific, initial triage
 [test_bug547996-1.html]
 skip-if = toolkit == 'android' #CRASH_DUMP, RANDOM
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -776,18 +776,18 @@ FetchDriver::AsyncOnChannelRedirect(nsIC
     //
     // Therefore simulate the completion of the channel to produce the
     // opaqueredirect Response and then cancel the original channel.  This
     // will result in OnStartRequest() getting called twice, but the second
     // time will be with an error response (from the Cancel) which will
     // be ignored.
     MOZ_ASSERT(!mFoundOpaqueRedirect);
     mFoundOpaqueRedirect = true;
-    unused << OnStartRequest(aOldChannel, nullptr);
-    unused << OnStopRequest(aOldChannel, nullptr, NS_OK);
+    Unused << OnStartRequest(aOldChannel, nullptr);
+    Unused << OnStopRequest(aOldChannel, nullptr, NS_OK);
 
     aOldChannel->Cancel(NS_BINDING_FAILED);
 
     return NS_BINDING_FAILED;
   }
 
   // The following steps are from HTTP Fetch step 5, "redirect status", step 11
   // which requires the RequestRedirect to be "follow".
--- a/dom/fetch/Request.cpp
+++ b/dom/fetch/Request.cpp
@@ -104,17 +104,17 @@ GetRequestURLFromDocument(nsIDocument* a
   if (NS_WARN_IF(aRv.Failed())) {
     aRv.ThrowTypeError<MSG_INVALID_URL>(&aInput);
     return;
   }
 
   // This fails with URIs with weird protocols, even when they are valid,
   // so we ignore the failure
   nsAutoCString credentials;
-  unused << resolvedURI->GetUserPass(credentials);
+  Unused << resolvedURI->GetUserPass(credentials);
   if (!credentials.IsEmpty()) {
     aRv.ThrowTypeError<MSG_URL_HAS_CREDENTIALS>(&aInput);
     return;
   }
 
   nsCOMPtr<nsIURI> resolvedURIClone;
   // We use CloneIgnoringRef to strip away the fragment even if the original URI
   // is immutable.
@@ -143,17 +143,17 @@ GetRequestURLFromChrome(const nsAString&
   if (NS_WARN_IF(aRv.Failed())) {
     aRv.ThrowTypeError<MSG_INVALID_URL>(&aInput);
     return;
   }
 
   // This fails with URIs with weird protocols, even when they are valid,
   // so we ignore the failure
   nsAutoCString credentials;
-  unused << uri->GetUserPass(credentials);
+  Unused << uri->GetUserPass(credentials);
   if (!credentials.IsEmpty()) {
     aRv.ThrowTypeError<MSG_URL_HAS_CREDENTIALS>(&aInput);
     return;
   }
 
   nsCOMPtr<nsIURI> uriClone;
   // We use CloneIgnoringRef to strip away the fragment even if the original URI
   // is immutable.
--- a/dom/filehandle/ActorsParent.cpp
+++ b/dom/filehandle/ActorsParent.cpp
@@ -998,17 +998,17 @@ FileHandleThreadPool::Cleanup()
     for (uint32_t count = mCompleteCallbacks.Length(), index = 0;
          index < count;
          index++) {
       nsAutoPtr<StoragesCompleteCallback> completeCallback(
         mCompleteCallbacks[index].forget());
       MOZ_ASSERT(completeCallback);
       MOZ_ASSERT(completeCallback->mCallback);
 
-      unused << completeCallback->mCallback->Run();
+      Unused << completeCallback->mCallback->Run();
     }
 
     mCompleteCallbacks.Clear();
 
     // And make sure they get processed.
     nsIThread* currentThread = NS_GetCurrentThread();
     MOZ_ASSERT(currentThread);
 
@@ -1646,17 +1646,17 @@ FileHandle::Invalidate()
 }
 
 void
 FileHandle::SendCompleteNotification(bool aAborted)
 {
   AssertIsOnBackgroundThread();
 
   if (!IsActorDestroyed()) {
-    unused << SendComplete(aAborted);
+    Unused << SendComplete(aAborted);
   }
 }
 
 bool
 FileHandle::VerifyRequestParams(const FileRequestParams& aParams) const
 {
   AssertIsOnBackgroundThread();
   MOZ_ASSERT(aParams.type() != FileRequestParams::T__None);
@@ -2275,17 +2275,17 @@ CopyFileHandleOp::Cleanup()
 }
 
 NS_IMETHODIMP
 CopyFileHandleOp::
 ProgressRunnable::Run()
 {
   AssertIsOnBackgroundThread();
 
-  unused << mCopyFileHandleOp->SendProgress(mProgress, mProgressMax);
+  Unused << mCopyFileHandleOp->SendProgress(mProgress, mProgressMax);
 
   mCopyFileHandleOp = nullptr;
 
   return NS_OK;
 }
 
 GetMetadataOp::GetMetadataOp(FileHandle* aFileHandle,
                              const FileRequestParams& aParams)
--- a/dom/filesystem/FileSystemTaskBase.cpp
+++ b/dom/filesystem/FileSystemTaskBase.cpp
@@ -106,17 +106,17 @@ FileSystemTaskBase::Run()
 void
 FileSystemTaskBase::HandleResult()
 {
   MOZ_ASSERT(NS_IsMainThread(), "Only call on main thread!");
   if (mFileSystem->IsShutdown()) {
     return;
   }
   if (mRequestParent && mRequestParent->IsRunning()) {
-    unused << mRequestParent->Send__delete__(mRequestParent,
+    Unused << mRequestParent->Send__delete__(mRequestParent,
       GetRequestResult());
   } else {
     HandlerCallback();
   }
 }
 
 FileSystemResponseValue
 FileSystemTaskBase::GetRequestResult() const
--- a/dom/fmradio/ipc/FMRadioParent.cpp
+++ b/dom/fmradio/ipc/FMRadioParent.cpp
@@ -93,59 +93,59 @@ FMRadioParent::DeallocPFMRadioRequestPar
   return true;
 }
 
 void
 FMRadioParent::Notify(const FMRadioEventType& aType)
 {
   switch (aType) {
     case FrequencyChanged:
-      unused << SendNotifyFrequencyChanged(
+      Unused << SendNotifyFrequencyChanged(
         IFMRadioService::Singleton()->GetFrequency());
       break;
     case EnabledChanged:
-      unused << SendNotifyEnabledChanged(
+      Unused << SendNotifyEnabledChanged(
         IFMRadioService::Singleton()->IsEnabled(),
         IFMRadioService::Singleton()->GetFrequency());
       break;
     case RDSEnabledChanged:
-      unused << SendNotifyRDSEnabledChanged(
+      Unused << SendNotifyRDSEnabledChanged(
         IFMRadioService::Singleton()->IsRDSEnabled());
       break;
     case PIChanged: {
       Nullable<unsigned short> pi =
         IFMRadioService::Singleton()->GetPi();
-      unused << SendNotifyPIChanged(!pi.IsNull(),
+      Unused << SendNotifyPIChanged(!pi.IsNull(),
                                     pi.IsNull() ? 0 : pi.Value());
       break;
     }
     case PTYChanged: {
       Nullable<uint8_t> pty = IFMRadioService::Singleton()->GetPty();
-      unused << SendNotifyPTYChanged(!pty.IsNull(),
+      Unused << SendNotifyPTYChanged(!pty.IsNull(),
                                      pty.IsNull() ? 0 : pty.Value());
       break;
     }
     case PSChanged: {
       nsAutoString psname;
       IFMRadioService::Singleton()->GetPs(psname);
-      unused << SendNotifyPSChanged(psname);
+      Unused << SendNotifyPSChanged(psname);
       break;
     }
     case RadiotextChanged: {
       nsAutoString radiotext;
       IFMRadioService::Singleton()->GetRt(radiotext);
-      unused << SendNotifyRadiotextChanged(radiotext);
+      Unused << SendNotifyRadiotextChanged(radiotext);
       break;
     }
     case NewRDSGroup: {
       uint64_t group;
       DebugOnly<bool> rdsgroupset =
         IFMRadioService::Singleton()->GetRdsgroup(group);
       MOZ_ASSERT(rdsgroupset);
-      unused << SendNotifyNewRDSGroup(group);
+      Unused << SendNotifyNewRDSGroup(group);
       break;
     }
     default:
       NS_RUNTIMEABORT("not reached");
       break;
   }
 }
 
--- a/dom/fmradio/ipc/FMRadioRequestParent.cpp
+++ b/dom/fmradio/ipc/FMRadioRequestParent.cpp
@@ -29,16 +29,16 @@ FMRadioRequestParent::ActorDestroy(Actor
 }
 
 nsresult
 FMRadioRequestParent::Run()
 {
   MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!");
 
   if (!mActorDestroyed) {
-    unused << Send__delete__(this, mResponseType);
+    Unused << Send__delete__(this, mResponseType);
   }
 
   return NS_OK;
 }
 
 END_FMRADIO_NAMESPACE
 
--- a/dom/gamepad/GamepadFunctions.cpp
+++ b/dom/gamepad/GamepadFunctions.cpp
@@ -24,17 +24,17 @@ void
 NotifyGamepadChange(const T& aInfo)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(XRE_IsParentProcess());
   GamepadChangeEvent e(aInfo);
   nsTArray<ContentParent*> t;
   ContentParent::GetAll(t);
   for(uint32_t i = 0; i < t.Length(); ++i) {
-    unused << t[i]->SendGamepadUpdate(e);
+    Unused << t[i]->SendGamepadUpdate(e);
   }
   // If we have a GamepadService in the main process, send directly to it.
   if (GamepadService::IsServiceRunning()) {
     RefPtr<GamepadService> svc = GamepadService::GetService();
     svc->Update(e);
   }
 }
 
--- a/dom/geolocation/nsGeolocation.cpp
+++ b/dom/geolocation/nsGeolocation.cpp
@@ -58,17 +58,17 @@ class nsIPrincipal;
 
 // Some limit to the number of get or watch geolocation requests
 // that a window can make.
 #define MAX_GEO_REQUESTS_PER_WINDOW  1500
 
 // the geolocation enabled setting
 #define GEO_SETTINGS_ENABLED          "geolocation.enabled"
 
-using mozilla::unused;          // <snicker>
+using mozilla::Unused;          // <snicker>
 using namespace mozilla;
 using namespace mozilla::dom;
 
 class nsGeolocationRequest final
  : public nsIContentPermissionRequest
  , public nsITimerCallback
  , public nsIGeolocationUpdate
 {
@@ -1271,17 +1271,17 @@ Geolocation::HighAccuracyRequested()
 
 void
 Geolocation::RemoveRequest(nsGeolocationRequest* aRequest)
 {
   bool requestWasKnown =
     (mPendingCallbacks.RemoveElement(aRequest) !=
      mWatchingCallbacks.RemoveElement(aRequest));
 
-  unused << requestWasKnown;
+  Unused << requestWasKnown;
 }
 
 NS_IMETHODIMP
 Geolocation::Update(nsIDOMGeoPosition *aSomewhere)
 {
   if (!WindowOwnerStillExists()) {
     Shutdown();
     return NS_OK;
--- a/dom/geolocation/nsGeolocationSettings.cpp
+++ b/dom/geolocation/nsGeolocationSettings.cpp
@@ -32,17 +32,17 @@
 #include "nsJSUtils.h"
 #include "prdtoa.h"
 
 #define GEO_ALA_TYPE_VALUE_PRECISE "precise"
 #define GEO_ALA_TYPE_VALUE_APPROX  "blur"
 #define GEO_ALA_TYPE_VALUE_FIXED   "user-defined"
 #define GEO_ALA_TYPE_VALUE_NONE    "no-location"
 
-using mozilla::unused;
+using mozilla::Unused;
 using namespace mozilla;
 using namespace mozilla::dom;
 
 NS_IMPL_ISUPPORTS(nsGeolocationSettings, nsIObserver)
 
 StaticRefPtr<nsGeolocationSettings> nsGeolocationSettings::sSettings;
 
 already_AddRefed<nsGeolocationSettings>
--- a/dom/html/crashtests/crashtests.list
+++ b/dom/html/crashtests/crashtests.list
@@ -1,8 +1,9 @@
+load 68912-1.html
 load 257818-1.html
 load 285166-1.html
 load 294235-1.html
 load 307616-1.html
 load 324918-1.xhtml
 load 338649-1.xhtml
 load 339501-1.xhtml
 load 339501-2.xhtml
@@ -45,17 +46,16 @@ load 614988-1.html
 load 616401.html
 load 620078-1.html
 load 620078-2.html
 load 631421.html
 load 673853.html
 load 680922-1.xul
 load 682058.xhtml
 load 682460.html
-load 68912-1.html
 load 738744.xhtml
 load 741218.json
 load 741250.xhtml
 load 795221-1.html
 load 795221-2.html
 load 795221-3.html
 load 795221-4.html
 load 795221-5.xml
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -79,16 +79,18 @@
 #include "nsIEditor.h"
 #include "nsIEditorIMESupport.h"
 #include "nsLayoutUtils.h"
 #include "mozAutoDocUpdate.h"
 #include "nsHtml5Module.h"
 #include "nsITextControlElement.h"
 #include "mozilla/dom/Element.h"
 #include "HTMLFieldSetElement.h"
+#include "nsTextNode.h"
+#include "HTMLBRElement.h"
 #include "HTMLMenuElement.h"
 #include "nsDOMMutationObserver.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/FromParser.h"
 #include "mozilla/dom/Link.h"
 #include "mozilla/dom/UndoManager.h"
 #include "mozilla/BloomFilter.h"
 
@@ -99,16 +101,17 @@
 #include "nsTextFragment.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/TouchEvent.h"
 #include "mozilla/ErrorResult.h"
 #include "nsHTMLDocument.h"
 #include "nsGlobalWindow.h"
 #include "mozilla/dom/HTMLBodyElement.h"
 #include "imgIContainer.h"
+#include "nsComputedDOMStyle.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 /**
  * nsAutoFocusEvent is used to dispatch a focus event when a
  * nsGenericHTMLFormElement is binded to the tree with the autofocus attribute
  * enabled.
@@ -3287,8 +3290,82 @@ nsGenericHTMLElement::NewURIFromString(c
     // document. Fail here instead of returning the recursive URI
     // and waiting for the subsequent load to fail.
     NS_RELEASE(*aURI);
     return NS_ERROR_DOM_INVALID_STATE_ERR;
   }
 
   return NS_OK;
 }
+
+void
+nsGenericHTMLElement::GetInnerText(mozilla::dom::DOMString& aValue,
+                                   mozilla::ErrorResult& aError)
+{
+  if (!GetPrimaryFrame(Flush_Layout)) {
+    RefPtr<nsStyleContext> sc =
+      nsComputedDOMStyle::GetStyleContextForElementNoFlush(this, nullptr, nullptr);
+    if (!sc || sc->StyleDisplay()->mDisplay == NS_STYLE_DISPLAY_NONE ||
+        !IsInComposedDoc()) {
+      GetTextContentInternal(aValue, aError);
+      return;
+    }
+  }
+
+  nsRange::GetInnerTextNoFlush(aValue, aError, this, 0, this, GetChildCount());
+}
+
+void
+nsGenericHTMLElement::SetInnerText(const nsAString& aValue)
+{
+  // Fire DOMNodeRemoved mutation events before we do anything else.
+  nsCOMPtr<nsIContent> kungFuDeathGrip;
+
+  // Batch possible DOMSubtreeModified events.
+  mozAutoSubtreeModified subtree(OwnerDoc(), nullptr);
+  FireNodeRemovedForChildren();
+
+  // Might as well stick a batch around this since we're performing several
+  // mutations.
+  mozAutoDocUpdate updateBatch(GetComposedDoc(),
+    UPDATE_CONTENT_MODEL, true);
+  nsAutoMutationBatch mb;
+
+  uint32_t childCount = GetChildCount();
+
+  mb.Init(this, true, false);
+  for (uint32_t i = 0; i < childCount; ++i) {
+    RemoveChildAt(0, true);
+  }
+  mb.RemovalDone();
+
+  nsString str;
+  const char16_t* s = aValue.BeginReading();
+  const char16_t* end = aValue.EndReading();
+  while (true) {
+    if (s != end && *s == '\r' && s + 1 != end && s[1] == '\n') {
+      // a \r\n pair should only generate one <br>, so just skip the \r
+      ++s;
+    }
+    if (s == end || *s == '\r' || *s == '\n') {
+      if (!str.IsEmpty()) {
+        RefPtr<nsTextNode> textContent =
+          new nsTextNode(NodeInfo()->NodeInfoManager());
+        textContent->SetText(str, true);
+        AppendChildTo(textContent, true);
+      }
+      if (s == end) {
+        break;
+      }
+      str.Truncate();
+      already_AddRefed<mozilla::dom::NodeInfo> ni =
+        NodeInfo()->NodeInfoManager()->GetNodeInfo(nsGkAtoms::br,
+          nullptr, kNameSpaceID_XHTML, nsIDOMNode::ELEMENT_NODE);
+      RefPtr<HTMLBRElement> br = new HTMLBRElement(ni);
+      AppendChildTo(br, true);
+    } else {
+      str.Append(*s);
+    }
+    ++s;
+  }
+
+  mb.NodesAdded();
+}
--- a/dom/html/nsGenericHTMLElement.h
+++ b/dom/html/nsGenericHTMLElement.h
@@ -236,16 +236,19 @@ public:
   {
     return mScrollgrab;
   }
   void SetScrollgrab(bool aValue)
   {
     mScrollgrab = aValue;
   }
 
+  void GetInnerText(mozilla::dom::DOMString& aValue, mozilla::ErrorResult& aError);
+  void SetInnerText(const nsAString& aValue);
+
   /**
    * Determine whether an attribute is an event (onclick, etc.)
    * @param aName the attribute
    * @return whether the name is an event handler name
    */
   virtual bool IsEventAttributeName(nsIAtom* aName) override;
 
 #define EVENT(name_, id_, type_, struct_) /* nothing; handled by nsINode */
--- a/dom/html/test/mochitest.ini
+++ b/dom/html/test/mochitest.ini
@@ -530,17 +530,17 @@ skip-if = toolkit == 'android' || (toolk
 [test_ignoreuserfocus.html]
 [test_fragment_form_pointer.html]
 [test_bug1682.html]
 [test_bug1823.html]
 [test_bug57600.html]
 [test_bug196523.html]
 skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
 [test_bug199692.html]
-skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || toolkit == 'android' || e10s #bug 811644 #Bug 931116, b2g desktop specific, initial triage
+skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || toolkit == 'android' #bug 811644 #Bug 931116, b2g desktop specific, initial triage
 [test_bug172261.html]
 [test_bug255820.html]
 [test_bug259332.html]
 [test_bug311681.html]
 [test_bug311681.xhtml]
 [test_bug324378.html]
 [test_bug332848.xhtml]
 [test_bug340017.xhtml]
--- a/dom/identity/nsDOMIdentity.js
+++ b/dom/identity/nsDOMIdentity.js
@@ -23,16 +23,18 @@ Cu.import("resource://gre/modules/Servic
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyModuleGetter(this, "checkDeprecated",
                                   "resource://gre/modules/identity/IdentityUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "checkRenamed",
                                   "resource://gre/modules/identity/IdentityUtils.jsm");
 XPCOMUtils.defineLazyModuleGetter(this, "objectCopy",
                                   "resource://gre/modules/identity/IdentityUtils.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "makeMessageObject",
+                                  "resource://gre/modules/identity/IdentityUtils.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "uuidgen",
                                    "@mozilla.org/uuid-generator;1",
                                    "nsIUUIDGenerator");
 
 // This is the child process corresponding to nsIDOMIdentity
 XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
                                    "@mozilla.org/childprocessmessagemanager;1",
@@ -634,17 +636,17 @@ nsDOMIdentity.prototype = {
       }
     }
 
     // Replace any audience supplied by the RP with one that has been sanitised
     message.audience = _audience;
 
     this._log("DOMIdentityMessage: " + JSON.stringify(message));
 
-    return message;
+    return makeMessageObject(message);
   },
 
  /**
   * Internal methods that are not exposed to content.
   * See dom/webidl/Identity.webidl for the public interface.
   */
   // nsIObserver
   observe: function nsDOMIdentityInternal_observe(aSubject, aTopic, aData) {
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -5308,17 +5308,17 @@ public:
   Dispatch(uint64_t aTransactionId, nsIRunnable* aRunnable);
 
   void
   Finish(uint64_t aTransactionId, FinishCallback* aCallback);
 
   void
   CloseDatabaseWhenIdle(const nsACString& aDatabaseId)
   {
-    unused << CloseDatabaseWhenIdleInternal(aDatabaseId);
+    Unused << CloseDatabaseWhenIdleInternal(aDatabaseId);
   }
 
   void
   WaitForDatabasesToComplete(nsTArray<nsCString>&& aDatabaseIds,
                              nsIRunnable* aCallback);
 
   void
   Shutdown();
@@ -9587,17 +9587,17 @@ RecvPIndexedDBPermissionRequestConstruct
 
   PermissionRequestBase::PermissionValue permission;
   nsresult rv = actor->PromptIfNeeded(&permission);
   if (NS_FAILED(rv)) {
     return false;
   }
 
   if (permission != PermissionRequestBase::kPermissionPrompt) {
-    unused <<
+    Unused <<
       PIndexedDBPermissionRequestParent::Send__delete__(actor, permission);
   }
 
   return true;
 }
 
 bool
 DeallocPIndexedDBPermissionRequestParent(
@@ -9845,17 +9845,17 @@ DatabaseConnection::RollbackWriteTransac
   DatabaseConnection::CachedStatement stmt;
   nsresult rv = GetCachedStatement(NS_LITERAL_CSTRING("ROLLBACK;"), &stmt);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return;
   }
 
   // This may fail if SQLite already rolled back the transaction so ignore any
   // errors.
-  unused << stmt->Execute();
+  Unused << stmt->Execute();
 
   mInWriteTransaction = false;
 }
 
 void
 DatabaseConnection::FinishWriteTransaction()
 {
   AssertIsOnConnectionThread();
@@ -9973,17 +9973,17 @@ DatabaseConnection::RollbackSavepoint()
     NS_LITERAL_CSTRING("ROLLBACK TO " SAVEPOINT_CLAUSE),
     &stmt);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   // This may fail if SQLite already rolled back the savepoint so ignore any
   // errors.
-  unused << stmt->Execute();
+  Unused << stmt->Execute();
 
   return NS_OK;
 }
 
 nsresult
 DatabaseConnection::CheckpointInternal(CheckpointMode aMode)
 {
   AssertIsOnConnectionThread();
@@ -10063,17 +10063,17 @@ DatabaseConnection::DoIdleProcessing(boo
 
     rv = GetCachedStatement(NS_LITERAL_CSTRING("BEGIN;"), &beginStmt);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return;
     }
 
     // Release the connection's normal transaction. It's possible that it could
     // fail, but that isn't a problem here.
-    unused << rollbackStmt->Execute();
+    Unused << rollbackStmt->Execute();
 
     mInReadTransaction = false;
   }
 
   bool freedSomePages = false;
 
   if (freelistCount) {
     rv = ReclaimFreePagesWhileIdle(freelistStmt,
@@ -10088,17 +10088,17 @@ DatabaseConnection::DoIdleProcessing(boo
     // Make sure we didn't leave a transaction running.
     MOZ_ASSERT(!mInReadTransaction);
     MOZ_ASSERT(!mInWriteTransaction);
   }
 
   // Truncate the WAL if we were asked to or if we managed to free some space.
   if (aNeedsCheckpoint || freedSomePages) {
     rv = CheckpointInternal(CheckpointMode::Truncate);
-    unused << NS_WARN_IF(NS_FAILED(rv));
+    Unused << NS_WARN_IF(NS_FAILED(rv));
   }
 
   // Finally try to restart the read transaction if we rolled it back earlier.
   if (beginStmt) {
     rv = beginStmt->Execute();
     if (NS_SUCCEEDED(rv)) {
       mInReadTransaction = true;
     } else {
@@ -10214,17 +10214,17 @@ DatabaseConnection::ReclaimFreePagesWhil
       NS_WARNING("Failed to commit!");
     }
   }
 
   if (NS_FAILED(rv)) {
     MOZ_ASSERT(mInWriteTransaction);
 
     // Something failed, make sure we roll everything back.
-    unused << aRollbackStatement->Execute();
+    Unused << aRollbackStatement->Execute();
 
     mInWriteTransaction = false;
 
     return rv;
   }
 
   *aFreedSomePages = freedSomePages;
   return NS_OK;
@@ -11182,17 +11182,17 @@ ConnectionPool::Start(const nsID& aBackg
       blockInfo->mLastBlockingReads = transactionInfo;
       blockInfo->mLastBlockingWrites.Clear();
     } else {
       blockInfo->mLastBlockingWrites.AppendElement(transactionInfo);
     }
   }
 
   if (!transactionInfo->mBlockedOn.Count()) {
-    unused << ScheduleTransaction(transactionInfo,
+    Unused << ScheduleTransaction(transactionInfo,
                                   /* aFromQueuedTransactions */ false);
   }
 
   if (!databaseInfoIsNew && mIdleDatabases.RemoveElement(dbInfo)) {
     AdjustIdleTimer();
   }
 
   return transactionId;
@@ -11275,17 +11275,17 @@ ConnectionPool::WaitForDatabasesToComple
     MOZ_ASSERT(!databaseId.IsEmpty());
 
     if (CloseDatabaseWhenIdleInternal(databaseId)) {
       mayRunCallbackImmediately = false;
     }
   }
 
   if (mayRunCallbackImmediately) {
-    unused << aCallback->Run();
+    Unused << aCallback->Run();
     return;
   }
 
   nsAutoPtr<DatabasesCompleteCallback> callback(
     new DatabasesCompleteCallback(Move(aDatabaseIds), aCallback));
   mCompleteCallbacks.AppendElement(callback.forget());
 }
 
@@ -11347,17 +11347,17 @@ ConnectionPool::Cleanup()
     for (uint32_t count = mCompleteCallbacks.Length(), index = 0;
          index < count;
          index++) {
       nsAutoPtr<DatabasesCompleteCallback> completeCallback(
         mCompleteCallbacks[index].forget());
       MOZ_ASSERT(completeCallback);
       MOZ_ASSERT(completeCallback->mCallback);
 
-      unused << completeCallback->mCallback->Run();
+      Unused << completeCallback->mCallback->Run();
     }
 
     mCompleteCallbacks.Clear();
 
     // And make sure they get processed.
     nsIThread* currentThread = NS_GetCurrentThread();
     MOZ_ASSERT(currentThread);
 
@@ -11873,17 +11873,17 @@ ConnectionPool::NoteClosedDatabase(Datab
     nsTArray<TransactionInfo*>& scheduledTransactions =
       aDatabaseInfo->mTransactionsScheduledDuringClose;
 
     MOZ_ASSERT(!scheduledTransactions.IsEmpty());
 
     for (uint32_t index = 0, count = scheduledTransactions.Length();
          index < count;
          index++) {
-      unused << ScheduleTransaction(scheduledTransactions[index],
+      Unused << ScheduleTransaction(scheduledTransactions[index],
                                     /* aFromQueuedTransactions */ false);
     }
 
     scheduledTransactions.Clear();
 
     return;
   }
 
@@ -11938,17 +11938,17 @@ ConnectionPool::MaybeFireCallback(Databa
     const nsCString& databaseId = aCallback->mDatabaseIds[index];
     MOZ_ASSERT(!databaseId.IsEmpty());
 
     if (mDatabases.Get(databaseId)) {
       return false;
     }
   }
 
-  unused << aCallback->mCallback->Run();
+  Unused << aCallback->mCallback->Run();
   return true;
 }
 
 void
 ConnectionPool::PerformIdleDatabaseMaintenance(DatabaseInfo* aDatabaseInfo)
 {
   AssertIsOnOwningThread();
   MOZ_ASSERT(aDatabaseInfo);
@@ -12217,17 +12217,17 @@ FinishCallbackWrapper::Run()
                  "ConnectionPool::FinishCallbackWrapper::Run",
                  js::ProfileEntry::Category::STORAGE);
 
   if (!mHasRunOnce) {
     MOZ_ASSERT(!IsOnBackgroundThread());
 
     mHasRunOnce = true;
 
-    unused << mCallback->Run();
+    Unused << mCallback->Run();
 
     MOZ_ALWAYS_TRUE(NS_SUCCEEDED(
       mOwningThread->Dispatch(this, NS_DISPATCH_NORMAL)));
 
     return NS_OK;
   }
 
   mConnectionPool->AssertIsOnOwningThread();
@@ -12515,17 +12515,17 @@ TransactionInfo::Schedule()
 {
   AssertIsOnBackgroundThread();
   MOZ_ASSERT(mDatabaseInfo);
 
   ConnectionPool* connectionPool = mDatabaseInfo->mConnectionPool;
   MOZ_ASSERT(connectionPool);
   connectionPool->AssertIsOnOwningThread();
 
-  unused <<
+  Unused <<
     connectionPool->ScheduleTransaction(this,
                                         /* aFromQueuedTransactions */ false);
 }
 
 ConnectionPool::
 TransactionInfoPair::TransactionInfoPair()
   : mLastBlockingReads(nullptr)
 {
@@ -12905,17 +12905,17 @@ Factory::DeallocPBackgroundIDBDatabasePa
  * WaitForTransactionsHelper
  ******************************************************************************/
 
 void
 WaitForTransactionsHelper::WaitForTransactions()
 {
   MOZ_ASSERT(mState == State::Initial);
 
-  unused << this->Run();
+  Unused << this->Run();
 }
 
 void
 WaitForTransactionsHelper::MaybeWaitForTransactions()
 {
   AssertIsOnBackgroundThread();
   MOZ_ASSERT(mState == State::Initial);
 
@@ -13137,17 +13137,17 @@ Database::Invalidate()
 
   if (mInvalidated) {
     return;
   }
 
   mInvalidated = true;
 
   if (mActorWasAlive && !mActorDestroyed) {
-    unused << SendInvalidate();
+    Unused << SendInvalidate();
   }
 
   if (!Helper::InvalidateTransactions(mTransactions)) {
     NS_WARNING("Failed to abort all transactions!");
   }
 
   if (!Helper::InvalidateMutableFiles(mMutableFiles)) {
     NS_WARNING("Failed to abort all mutable files!");
@@ -14743,17 +14743,17 @@ NormalTransaction::IsSameProcessActor()
 }
 
 void
 NormalTransaction::SendCompleteNotification(nsresult aResult)
 {
   AssertIsOnBackgroundThread();
 
   if (!IsActorDestroyed()) {
-    unused << SendComplete(aResult);
+    Unused << SendComplete(aResult);
   }
 }
 
 void
 NormalTransaction::ActorDestroy(ActorDestroyReason aWhy)
 {
   AssertIsOnBackgroundThread();
 
@@ -15042,17 +15042,17 @@ VersionChangeTransaction::SendCompleteNo
 
   if (NS_FAILED(aResult) && NS_SUCCEEDED(openDatabaseOp->mResultCode)) {
     openDatabaseOp->mResultCode = aResult;
   }
 
   openDatabaseOp->mState = OpenDatabaseOp::State::SendingResults;
 
   if (!IsActorDestroyed()) {
-    unused << SendComplete(aResult);
+    Unused << SendComplete(aResult);
   }
 
   MOZ_ALWAYS_TRUE(NS_SUCCEEDED(openDatabaseOp->Run()));
 }
 
 void
 VersionChangeTransaction::ActorDestroy(ActorDestroyReason aWhy)
 {
@@ -16838,17 +16838,17 @@ QuotaClient::PerformIdleMaintenance()
   // for low disk space mode.
   IndexedDatabaseManager* mgr = IndexedDatabaseManager::GetOrCreate();
   if (NS_WARN_IF(!mgr)) {
     return;
   }
 
   if (kRunningXPCShellTests) {
     // We don't want user activity to impact this code if we're running tests.
-    unused << Observe(nullptr, OBSERVER_TOPIC_IDLE, nullptr);
+    Unused << Observe(nullptr, OBSERVER_TOPIC_IDLE, nullptr);
   } else if (!mIdleObserverRegistered) {
     nsCOMPtr<nsIIdleService> idleService =
       do_GetService(kIdleServiceContractId);
     MOZ_ASSERT(idleService);
 
     MOZ_ALWAYS_TRUE(NS_SUCCEEDED(
       idleService->AddIdleObserver(this, kIdleObserverTimeSec)));
 
@@ -18004,17 +18004,17 @@ QuotaClient::
 AutoProgressHandler::Unregister()
 {
   MOZ_ASSERT(!NS_IsMainThread());
   MOZ_ASSERT(!IsOnBackgroundThread());
   MOZ_ASSERT(mConnection);
 
   nsCOMPtr<mozIStorageProgressHandler> oldHandler;
   nsresult rv = mConnection->RemoveProgressHandler(getter_AddRefs(oldHandler));
-  unused << NS_WARN_IF(NS_FAILED(rv));
+  Unused << NS_WARN_IF(NS_FAILED(rv));
 
   MOZ_ASSERT_IF(NS_SUCCEEDED(rv), oldHandler == this);
 }
 
 NS_IMETHODIMP_(MozExternalRefCountType)
 QuotaClient::
 AutoProgressHandler::AddRef()
 {
@@ -20927,17 +20927,17 @@ OpenDatabaseOp::NoteDatabaseClosed(Datab
 
 void
 OpenDatabaseOp::SendBlockedNotification()
 {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mState == State::WaitingForOtherDatabasesToClose);
 
   if (!IsActorDestroyed()) {
-    unused << SendBlocked(mMetadata->mCommonMetadata.version());
+    Unused << SendBlocked(mMetadata->mCommonMetadata.version());
   }
 }
 
 nsresult
 OpenDatabaseOp::DispatchToWorkThread()
 {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mState == State::WaitingForTransactionsToComplete);
@@ -21090,17 +21090,17 @@ OpenDatabaseOp::SendResults()
       // If something failed then our metadata pointer is now bad. No one should
       // ever touch it again though so just null it out in DEBUG builds to make
       // sure we find such cases.
       mMetadata = nullptr;
 #endif
       response = ClampResultCode(mResultCode);
     }
 
-    unused <<
+    Unused <<
       PBackgroundIDBFactoryRequestParent::Send__delete__(this, response);
   }
 
   if (mDatabase) {
     MOZ_ASSERT(!mDirectoryLock);
 
     if (NS_FAILED(mResultCode)) {
       mDatabase->Invalidate();
@@ -21816,17 +21816,17 @@ DeleteDatabaseOp::NoteDatabaseClosed(Dat
 
 void
 DeleteDatabaseOp::SendBlockedNotification()
 {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mState == State::WaitingForOtherDatabasesToClose);
 
   if (!IsActorDestroyed()) {
-    unused << SendBlocked(0);
+    Unused << SendBlocked(0);
   }
 }
 
 void
 DeleteDatabaseOp::SendResults()
 {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mState == State::SendingResults);
@@ -21835,17 +21835,17 @@ DeleteDatabaseOp::SendResults()
     FactoryRequestResponse response;
 
     if (NS_SUCCEEDED(mResultCode)) {
       response = DeleteDatabaseRequestResponse(mPreviousVersion);
     } else {
       response = ClampResultCode(mResultCode);
     }
 
-    unused <<
+    Unused <<
       PBackgroundIDBFactoryRequestParent::Send__delete__(this, response);
   }
 
   if (mDirectoryLock) {
     RefPtr<UnlockDirectoryRunnable> runnable =
       new UnlockDirectoryRunnable(mDirectoryLock.forget());
 
     MOZ_ALWAYS_TRUE(NS_SUCCEEDED(NS_DispatchToMainThread(runnable)));
@@ -22909,17 +22909,17 @@ CreateFileOp::SendResults()
 #ifdef DEBUG
         mResultCode = response.get_nsresult();
 #endif
       }
     } else {
       response = ClampResultCode(mResultCode);
     }
 
-    unused <<
+    Unused <<
       PBackgroundIDBDatabaseRequestParent::Send__delete__(this, response);
   }
 
   mState = State::Completed;
 }
 
 nsresult
 VersionChangeTransactionOp::SendSuccessResult()
@@ -27267,17 +27267,17 @@ ContinueOp::SendSuccessResult()
 }
 
 void
 PermissionRequestHelper::OnPromptComplete(PermissionValue aPermissionValue)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!mActorDestroyed) {
-    unused <<
+    Unused <<
       PIndexedDBPermissionRequestParent::Send__delete__(this, aPermissionValue);
   }
 }
 
 void
 PermissionRequestHelper::ActorDestroy(ActorDestroyReason aWhy)
 {
   MOZ_ASSERT(NS_IsMainThread());
--- a/dom/ipc/Blob.cpp
+++ b/dom/ipc/Blob.cpp
@@ -268,17 +268,17 @@ CancelableRunnableWrapper::Cancel()
   MOZ_ASSERT(mDEBUGEventTarget);
   MOZ_ASSERT(NS_SUCCEEDED(mDEBUGEventTarget->IsOnCurrentThread(&onTarget)));
   MOZ_ASSERT(onTarget);
 
   if (NS_WARN_IF(!mRunnable)) {
     return NS_ERROR_UNEXPECTED;
   }
 
-  unused << Run();
+  Unused << Run();
   MOZ_ASSERT(!mRunnable);
 
   return NS_OK;
 }
 
 // Ensure that a nsCOMPtr/nsRefPtr is released on the target thread.
 template <template <class> class SmartPtr, class T>
 void
@@ -4103,17 +4103,17 @@ BlobParent::NoteDyingRemoteBlobImpl()
     return;
   }
 
   // Must do this before calling Send__delete__ or we'll crash there trying to
   // access a dangling pointer.
   mBlobImpl = nullptr;
   mRemoteBlobImpl = nullptr;
 
-  unused << PBlobParent::Send__delete__(this);
+  Unused << PBlobParent::Send__delete__(this);
 }
 
 void
 BlobParent::NoteRunnableCompleted(OpenStreamRunnable* aRunnable)
 {
   AssertIsOnOwningThread();
   MOZ_ASSERT(aRunnable);
 
--- a/dom/ipc/ColorPickerParent.cpp
+++ b/dom/ipc/ColorPickerParent.cpp
@@ -7,36 +7,36 @@
 #include "ColorPickerParent.h"
 #include "nsComponentManagerUtils.h"
 #include "nsIDocument.h"
 #include "nsIDOMWindow.h"
 #include "mozilla/unused.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/TabParent.h"
 
-using mozilla::unused;
+using mozilla::Unused;
 using namespace mozilla::dom;
 
 NS_IMPL_ISUPPORTS(ColorPickerParent::ColorPickerShownCallback,
                   nsIColorPickerShownCallback);
 
 NS_IMETHODIMP
 ColorPickerParent::ColorPickerShownCallback::Update(const nsAString& aColor)
 {
   if (mColorPickerParent) {
-    unused << mColorPickerParent->SendUpdate(nsString(aColor));
+    Unused << mColorPickerParent->SendUpdate(nsString(aColor));
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 ColorPickerParent::ColorPickerShownCallback::Done(const nsAString& aColor)
 {
   if (mColorPickerParent) {
-    unused << mColorPickerParent->Send__delete__(mColorPickerParent,
+    Unused << mColorPickerParent->Send__delete__(mColorPickerParent,
                                                  nsString(aColor));
   }
   return NS_OK;
 }
 
 void
 ColorPickerParent::ColorPickerShownCallback::Destroy()
 {
@@ -63,17 +63,17 @@ ColorPickerParent::CreateColorPicker()
 
   return NS_SUCCEEDED(mPicker->Init(window, mTitle, mInitialColor));
 }
 
 bool
 ColorPickerParent::RecvOpen()
 {
   if (!CreateColorPicker()) {
-    unused << Send__delete__(this, mInitialColor);
+    Unused << Send__delete__(this, mInitialColor);
     return true;
   }
 
   mCallback = new ColorPickerShownCallback(this);
 
   mPicker->Open(mCallback);
   return true;
 };
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -344,17 +344,17 @@ private:
             mGCLog = nullptr;
         }
         if (mCCLog) {
             fclose(mCCLog);
             mCCLog = nullptr;
         }
         // The XPCOM refcount drives the IPC lifecycle; see also
         // DeallocPCycleCollectWithLogsChild.
-        unused << Send__delete__(this);
+        Unused << Send__delete__(this);
     }
 
     nsresult UnimplementedProperty()
     {
         MOZ_ASSERT(false, "This object is a remote GC/CC logger;"
                    " this property isn't meaningful.");
         return NS_ERROR_UNEXPECTED;
     }
@@ -808,17 +808,17 @@ ContentChild::ProvideWindowCommon(TabChi
         return NS_ERROR_ABORT;
     }
 
     if (aTabOpener) {
         MOZ_ASSERT(ipcContext->type() == IPCTabContext::TPopupIPCTabContext);
         ipcContext->get_PopupIPCTabContext().opener() = aTabOpener;
     }
 
-    unused << SendPBrowserConstructor(
+    Unused << SendPBrowserConstructor(
         // We release this ref in DeallocPBrowserChild
         RefPtr<TabChild>(newChild).forget().take(),
         tabId, *ipcContext, aChromeFlags,
         GetID(), IsForApp(), IsForBrowser());
 
     nsAutoCString url;
     if (aURI) {
         aURI->GetSpec(url);
@@ -2474,17 +2474,17 @@ OnFinishNuwaPreparation()
     // guarantees the ordering is safe for PBackground.
     while (!BackgroundChild::GetForCurrentThread()) {
         if (NS_WARN_IF(!NS_ProcessNextEvent())) {
             return;
         }
     }
 
     // This will create the actor.
-    unused << mozilla::dom::NuwaChild::GetSingleton();
+    Unused << mozilla::dom::NuwaChild::GetSingleton();
 
     MakeNuwaProcess();
 }
 #endif
 
 static void
 PreloadSlowThings()
 {
@@ -2599,42 +2599,42 @@ ContentChild::RecvFileSystemUpdate(const
                                              aIsUnmounting, aIsRemovable, aIsHotSwappable);
 
     RefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
     if (vs) {
         vs->UpdateVolume(volume);
     }
 #else
     // Remove warnings about unused arguments
-    unused << aFsName;
-    unused << aVolumeName;
-    unused << aState;
-    unused << aMountGeneration;
-    unused << aIsMediaPresent;
-    unused << aIsSharing;
-    unused << aIsFormatting;
-    unused << aIsFake;
-    unused << aIsUnmounting;
-    unused << aIsRemovable;
-    unused << aIsHotSwappable;
+    Unused << aFsName;
+    Unused << aVolumeName;
+    Unused << aState;
+    Unused << aMountGeneration;
+    Unused << aIsMediaPresent;
+    Unused << aIsSharing;
+    Unused << aIsFormatting;
+    Unused << aIsFake;
+    Unused << aIsUnmounting;
+    Unused << aIsRemovable;
+    Unused << aIsHotSwappable;
 #endif
     return true;
 }
 
 bool
 ContentChild::RecvVolumeRemoved(const nsString& aFsName)
 {
 #ifdef MOZ_WIDGET_GONK
     RefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
     if (vs) {
         vs->RemoveVolumeByName(aFsName);
     }
 #else
     // Remove warnings about unused arguments
-    unused << aFsName;
+    Unused << aFsName;
 #endif
     return true;
 }
 
 bool
 ContentChild::RecvNotifyProcessPriorityChanged(
     const hal::ProcessPriority& aPriority)
 {
@@ -2816,17 +2816,17 @@ ContentChild::RecvGatherProfile()
     nsCString profileCString;
     UniquePtr<char[]> profile = profiler_get_profile();
     if (profile) {
         profileCString = nsCString(profile.get(), strlen(profile.get()));
     } else {
         profileCString = EmptyCString();
     }
 
-    unused << SendProfile(profileCString);
+    Unused << SendProfile(profileCString);
     return true;
 }
 
 bool
 ContentChild::RecvLoadPluginResult(const uint32_t& aPluginId, const bool& aResult)
 {
     nsresult rv;
     bool finalResult = aResult &&
@@ -2927,17 +2927,17 @@ ContentChild::RecvShutdown()
         os->NotifyObservers(static_cast<nsIContentChild*>(this),
                             "content-child-shutdown", nullptr);
     }
 
     GetIPCChannel()->SetAbortOnError(false);
 
     // Ignore errors here. If this fails, the parent will kill us after a
     // timeout.
-    unused << SendFinishShutdown();
+    Unused << SendFinishShutdown();
     return true;
 }
 
 PBrowserOrId
 ContentChild::GetBrowserOrId(TabChild* aTabChild)
 {
     if (!aTabChild ||
         this == aTabChild->Manager()) {
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -533,34 +533,34 @@ public:
                                                  aDumpAllTraces,
                                                  FILEToFileDescriptor(gcLog),
                                                  FILEToFileDescriptor(ccLog));
     }
 
 private:
     virtual bool RecvCloseGCLog() override
     {
-        unused << mSink->CloseGCLog();
+        Unused << mSink->CloseGCLog();
         return true;
     }
 
     virtual bool RecvCloseCCLog() override
     {
-        unused << mSink->CloseCCLog();
+        Unused << mSink->CloseCCLog();
         return true;
     }
 
     virtual bool Recv__delete__() override
     {
         // Report completion to mCallback only on successful
         // completion of the protocol.
         nsCOMPtr<nsIFile> gcLog, ccLog;
         mSink->GetGcLog(getter_AddRefs(gcLog));
         mSink->GetCcLog(getter_AddRefs(ccLog));
-        unused << mCallback->OnDump(gcLog, ccLog, /* parent = */ false);
+        Unused << mCallback->OnDump(gcLog, ccLog, /* parent = */ false);
         return true;
     }
 
     virtual void ActorDestroy(ActorDestroyReason aReason) override
     {
         // If the actor is unexpectedly destroyed, we deliberately
         // don't call Close[GC]CLog on the sink, because the logs may
         // be incomplete.  See also the nsCycleCollectorLogSinkToFile
@@ -1529,34 +1529,34 @@ ContentParent::Init()
         cpId.AppendInt(static_cast<uint64_t>(this->ChildID()));
         obs->NotifyObservers(static_cast<nsIObserver*>(this), "ipc:content-created", cpId.get());
     }
 
 #ifdef ACCESSIBILITY
     // If accessibility is running in chrome process then start it in content
     // process.
     if (nsIPresShell::IsAccessibilityActive()) {
-        unused << SendActivateA11y();
+        Unused << SendActivateA11y();
     }
 #endif
 }
 
 void
 ContentParent::ForwardKnownInfo()
 {
     MOZ_ASSERT(mMetamorphosed);
     if (!mMetamorphosed) {
         return;
     }
 #ifdef MOZ_WIDGET_GONK
     InfallibleTArray<VolumeInfo> volumeInfo;
     RefPtr<nsVolumeService> vs = nsVolumeService::GetSingleton();
     if (vs && !mIsForBrowser) {
         vs->GetVolumesForIPC(&volumeInfo);
-        unused << SendVolumes(volumeInfo);
+        Unused << SendVolumes(volumeInfo);
     }
 #endif /* MOZ_WIDGET_GONK */
 
     nsCOMPtr<nsISystemMessagesInternal> systemMessenger =
         do_GetService("@mozilla.org/system-message-internal;1");
     if (systemMessenger && !mIsForBrowser) {
         nsCOMPtr<nsIURI> manifestURI;
         nsresult rv = NS_NewURI(getter_AddRefs(manifestURI), mAppManifestURL);
@@ -2247,17 +2247,17 @@ ContentParent::NotifyTabDestroyed(const 
     }
 
     nsTArray<PContentPermissionRequestParent*> parentArray =
         nsContentPermissionUtils::GetContentPermissionRequestParentById(aTabId);
 
     // Need to close undeleted ContentPermissionRequestParents before tab is closed.
     for (auto& permissionRequestParent : parentArray) {
         nsTArray<PermissionChoice> emptyChoices;
-        unused << PContentPermissionRequestParent::Send__delete__(permissionRequestParent,
+        Unused << PContentPermissionRequestParent::Send__delete__(permissionRequestParent,
                                                                   false,
                                                                   emptyChoices);
     }
 
     // There can be more than one PBrowser for a given app process
     // because of popup windows.  When the last one closes, shut
     // us down.
     ContentProcessManager* cpm = ContentProcessManager::GetSingleton();
@@ -2528,17 +2528,17 @@ ContentParent::InitInternal(ProcessPrior
         nsCString version(gAppData->version);
         nsCString buildID(gAppData->buildID);
         nsCString name(gAppData->name);
         nsCString UAName(gAppData->UAName);
         nsCString ID(gAppData->ID);
         nsCString vendor(gAppData->vendor);
 
         // Sending all information to content process.
-        unused << SendAppInfo(version, buildID, name, UAName, ID, vendor);
+        Unused << SendAppInfo(version, buildID, name, UAName, ID, vendor);
     }
 
     // Initialize the message manager (and load delayed scripts) now that we
     // have established communications with the child.
     mMessageManager->InitWithCallback(this);
 
     // Set the subprocess's priority.  We do this early on because we're likely
     // /lowering/ the process's CPU and memory priority, which it has inherited
@@ -2568,43 +2568,43 @@ ContentParent::InitInternal(ProcessPrior
 #ifdef MOZ_WIDGET_GONK
         DebugOnly<bool> opened = PSharedBufferManager::Open(this);
         MOZ_ASSERT(opened);
 #endif
     }
 
     if (gAppData) {
         // Sending all information to content process.
-        unused << SendAppInit();
+        Unused << SendAppInit();
     }
 
     nsStyleSheetService *sheetService = nsStyleSheetService::GetInstance();
     if (sheetService) {
         // This looks like a lot of work, but in a normal browser session we just
         // send two loads.
 
         nsCOMArray<nsIStyleSheet>& agentSheets = *sheetService->AgentStyleSheets();
         for (uint32_t i = 0; i < agentSheets.Length(); i++) {
             URIParams uri;
             SerializeURI(agentSheets[i]->GetSheetURI(), uri);
-            unused << SendLoadAndRegisterSheet(uri, nsIStyleSheetService::AGENT_SHEET);
+            Unused << SendLoadAndRegisterSheet(uri, nsIStyleSheetService::AGENT_SHEET);
         }
 
         nsCOMArray<nsIStyleSheet>& userSheets = *sheetService->UserStyleSheets();
         for (uint32_t i = 0; i < userSheets.Length(); i++) {
             URIParams uri;
             SerializeURI(userSheets[i]->GetSheetURI(), uri);
-            unused << SendLoadAndRegisterSheet(uri, nsIStyleSheetService::USER_SHEET);
+            Unused << SendLoadAndRegisterSheet(uri, nsIStyleSheetService::USER_SHEET);
         }
 
         nsCOMArray<nsIStyleSheet>& authorSheets = *sheetService->AuthorStyleSheets();
         for (uint32_t i = 0; i < authorSheets.Length(); i++) {
             URIParams uri;
             SerializeURI(authorSheets[i]->GetSheetURI(), uri);
-            unused << SendLoadAndRegisterSheet(uri, nsIStyleSheetService::AUTHOR_SHEET);
+            Unused << SendLoadAndRegisterSheet(uri, nsIStyleSheetService::AUTHOR_SHEET);
         }
     }
 
 #ifdef MOZ_CONTENT_SANDBOX
     bool shouldSandbox = true;
 #ifdef MOZ_NUWA_PROCESS
     if (IsNuwaProcess()) {
         shouldSandbox = false;
@@ -3066,32 +3066,32 @@ ContentParent::OnNewProcessCreated(uint3
                                 aPid,
                                 Move(*aFds.get()));
     content->Init();
 
     size_t numNuwaPrefUpdates = sNuwaPrefUpdates ?
                                 sNuwaPrefUpdates->Length() : 0;
     // Resend pref updates to the forked child.
     for (size_t i = 0; i < numNuwaPrefUpdates; i++) {
-        mozilla::unused << content->SendPreferenceUpdate(sNuwaPrefUpdates->ElementAt(i));
+        mozilla::Unused << content->SendPreferenceUpdate(sNuwaPrefUpdates->ElementAt(i));
     }
 
     // Update offline settings.
     bool isOffline, isLangRTL;
     bool isConnected;
     InfallibleTArray<nsString> unusedDictionaries;
     ClipboardCapabilities clipboardCaps;
     DomainPolicyClone domainPolicy;
     StructuredCloneData initialData;
 
     RecvGetXPCOMProcessAttributes(&isOffline, &isConnected,
                                   &isLangRTL, &unusedDictionaries,
                                   &clipboardCaps, &domainPolicy, &initialData);
-    mozilla::unused << content->SendSetOffline(isOffline);
-    mozilla::unused << content->SendSetConnectivity(isConnected);
+    mozilla::Unused << content->SendSetOffline(isOffline);
+    mozilla::Unused << content->SendSetConnectivity(isConnected);
     MOZ_ASSERT(!clipboardCaps.supportsSelectionClipboard() &&
                !clipboardCaps.supportsFindClipboard(),
                "Unexpected values");
 
     PreallocatedProcessManager::PublishSpareProcess(content);
     return;
 #else
     NS_ERROR("ContentParent::OnNewProcessCreated() not implemented!");
@@ -3145,17 +3145,17 @@ ContentParent::Observe(nsISupports* aSub
     // 1.2 The topic doesn't send an IPC message (e.g. "xpcom-shutdown").
     // 2. The topic needs special handling (e.g. nsPref:Changed),
     // add the topic to sNuwaSafeObserverTopics and then handle it if necessary.
 
     // listening for memory pressure event
     if (!strcmp(aTopic, "memory-pressure") &&
         !StringEndsWith(nsDependentString(aData),
                         NS_LITERAL_STRING("-no-forward"))) {
-        unused << SendFlushMemory(nsDependentString(aData));
+        Unused << SendFlushMemory(nsDependentString(aData));
     }
     // listening for remotePrefs...
     else if (!strcmp(aTopic, "nsPref:changed")) {
         // We know prefs are ASCII here.
         NS_LossyConvertUTF16toASCII strData(aData);
 
         PrefSetting pref(strData, null_t(), null_t());
         Preferences::GetPreference(&pref);
@@ -3194,32 +3194,32 @@ ContentParent::Observe(nsISupports* aSub
              !strcmp(aTopic, "alertshow") ||
              !strcmp(aTopic, "alertdisablecallback") ||
              !strcmp(aTopic, "alertsettingscallback")) {
         if (!SendNotifyAlertsObserver(nsDependentCString(aTopic),
                                       nsDependentString(aData)))
             return NS_ERROR_NOT_AVAILABLE;
     }
     else if (!strcmp(aTopic, "child-gc-request")){
-        unused << SendGarbageCollect();
+        Unused << SendGarbageCollect();
     }
     else if (!strcmp(aTopic, "child-cc-request")){
-        unused << SendCycleCollect();
+        Unused << SendCycleCollect();
     }
     else if (!strcmp(aTopic, "child-mmu-request")){
-        unused << SendMinimizeMemoryUsage();
+        Unused << SendMinimizeMemoryUsage();
     }
     else if (!strcmp(aTopic, "last-pb-context-exited")) {
-        unused << SendLastPrivateDocShellDestroyed();
+        Unused << SendLastPrivateDocShellDestroyed();
     }
     else if (!strcmp(aTopic, "file-watcher-update")) {
         nsCString creason;
         CopyUTF16toUTF8(aData, creason);
         DeviceStorageFile* file = static_cast<DeviceStorageFile*>(aSubject);
-        unused << SendFilePathUpdate(file->mStorageType, file->mStorageName, file->mPath, creason);
+        Unused << SendFilePathUpdate(file->mStorageType, file->mStorageName, file->mPath, creason);
     }
 #ifdef MOZ_WIDGET_GONK
     else if(!strcmp(aTopic, NS_VOLUME_STATE_CHANGED)) {
         nsCOMPtr<nsIVolume> vol = do_QueryInterface(aSubject);
         if (!vol) {
             return NS_ERROR_NOT_AVAILABLE;
         }
 
@@ -3242,77 +3242,77 @@ ContentParent::Observe(nsISupports* aSub
         vol->GetIsMediaPresent(&isMediaPresent);
         vol->GetIsSharing(&isSharing);
         vol->GetIsFormatting(&isFormatting);
         vol->GetIsFake(&isFake);
         vol->GetIsUnmounting(&isUnmounting);
         vol->GetIsRemovable(&isRemovable);
         vol->GetIsHotSwappable(&isHotSwappable);
 
-        unused << SendFileSystemUpdate(volName, mountPoint, state,
+        Unused << SendFileSystemUpdate(volName, mountPoint, state,
                                        mountGeneration, isMediaPresent,
                                        isSharing, isFormatting, isFake,
                                        isUnmounting, isRemovable, isHotSwappable);
     } else if (!strcmp(aTopic, "phone-state-changed")) {
         nsString state(aData);
-        unused << SendNotifyPhoneStateChange(state);
+        Unused << SendNotifyPhoneStateChange(state);
     }
     else if(!strcmp(aTopic, NS_VOLUME_REMOVED)) {
         nsString volName(aData);
-        unused << SendVolumeRemoved(volName);
+        Unused << SendVolumeRemoved(volName);
     }
 #endif
 #ifdef ACCESSIBILITY
     // Make sure accessibility is running in content process when accessibility
     // gets initiated in chrome process.
     else if (aData && (*aData == '1') &&
              !strcmp(aTopic, "a11y-init-or-shutdown")) {
-        unused << SendActivateA11y();
+        Unused << SendActivateA11y();
     }
 #endif
     else if (!strcmp(aTopic, "app-theme-changed")) {
-        unused << SendOnAppThemeChanged();
+        Unused << SendOnAppThemeChanged();
     }
 #ifdef MOZ_ENABLE_PROFILER_SPS
     else if (!strcmp(aTopic, "profiler-started")) {
         nsCOMPtr<nsIProfilerStartParams> params(do_QueryInterface(aSubject));
         uint32_t entries;
         double interval;
         params->GetEntries(&entries);
         params->GetInterval(&interval);
         const nsTArray<nsCString>& features = params->GetFeatures();
         const nsTArray<nsCString>& threadFilterNames = params->GetThreadFilterNames();
-        unused << SendStartProfiler(entries, interval, features, threadFilterNames);
+        Unused << SendStartProfiler(entries, interval, features, threadFilterNames);
     }
     else if (!strcmp(aTopic, "profiler-stopped")) {
-        unused << SendStopProfiler();
+        Unused << SendStopProfiler();
     }
     else if (!strcmp(aTopic, "profiler-paused")) {
-        unused << SendPauseProfiler(true);
+        Unused << SendPauseProfiler(true);
     }
     else if (!strcmp(aTopic, "profiler-resumed")) {
-        unused << SendPauseProfiler(false);
+        Unused << SendPauseProfiler(false);
     }
     else if (!strcmp(aTopic, "profiler-subprocess-gather")) {
         mGatherer = static_cast<ProfileGatherer*>(aSubject);
         mGatherer->WillGatherOOPProfile();
-        unused << SendGatherProfile();
+        Unused << SendGatherProfile();
     }
     else if (!strcmp(aTopic, "profiler-subprocess")) {
         nsCOMPtr<nsIProfileSaveEvent> pse = do_QueryInterface(aSubject);
         if (pse) {
             if (!mProfile.IsEmpty()) {
                 pse->AddSubProfile(mProfile.get());
                 mProfile.Truncate();
             }
         }
     }
 #endif
     else if (!strcmp(aTopic, "gmp-changed")) {
-      unused << SendNotifyGMPsChanged();
+      Unused << SendNotifyGMPsChanged();
     }
     return NS_OK;
 }
 
 PGMPServiceParent*
 ContentParent::AllocPGMPServiceParent(mozilla::ipc::Transport* aTransport,
                                       base::ProcessId aOtherProcess)
 {
@@ -4224,17 +4224,17 @@ bool
 ContentParent::RecvGetSystemMemory(const uint64_t& aGetterId)
 {
     uint32_t memoryTotal = 0;
 
 #if defined(XP_LINUX)
     memoryTotal = mozilla::hal::GetTotalSystemMemoryLevel();
 #endif
 
-    unused << SendSystemMemoryAvailable(aGetterId, memoryTotal);
+    Unused << SendSystemMemoryAvailable(aGetterId, memoryTotal);
 
     return true;
 }
 
 bool
 ContentParent::RecvGetLookAndFeelCache(nsTArray<LookAndFeelInt>* aLookAndFeelIntCache)
 {
     *aLookAndFeelIntCache = LookAndFeel::GetIntCache();
@@ -4336,26 +4336,26 @@ ContentParent::RecvCloseAlert(const nsSt
 
     return true;
 }
 
 bool
 ContentParent::RecvDisableNotifications(const IPC::Principal& aPrincipal)
 {
     if (HasNotificationPermission(aPrincipal)) {
-        unused << Notification::RemovePermission(aPrincipal);
+        Unused << Notification::RemovePermission(aPrincipal);
     }
     return true;
 }
 
 bool
 ContentParent::RecvOpenNotificationSettings(const IPC::Principal& aPrincipal)
 {
     if (HasNotificationPermission(aPrincipal)) {
-        unused << Notification::OpenSettings(aPrincipal);
+        Unused << Notification::OpenSettings(aPrincipal);
     }
     return true;
 }
 
 bool
 ContentParent::RecvSyncMessage(const nsString& aMsg,
                                const ClonedMessageData& aData,
                                InfallibleTArray<CpowEntry>&& aCpows,
@@ -4499,28 +4499,28 @@ ContentParent::RecvSetGeolocationHigherA
         }
     }
     return true;
 }
 
 NS_IMETHODIMP
 ContentParent::HandleEvent(nsIDOMGeoPosition* postion)
 {
-    unused << SendGeolocationUpdate(GeoPosition(postion));
+    Unused << SendGeolocationUpdate(GeoPosition(postion));
     return NS_OK;
 }
 
 NS_IMETHODIMP
 ContentParent::HandleEvent(nsIDOMGeoPositionError* postionError)
 {
     int16_t errorCode;
     nsresult rv;
     rv = postionError->GetCode(&errorCode);
     NS_ENSURE_SUCCESS(rv,rv);
-    unused << SendGeolocationError(errorCode);
+    Unused << SendGeolocationError(errorCode);
     return NS_OK;
 }
 
 nsConsoleService *
 ContentParent::GetConsoleService()
 {
     if (mConsoleService) {
         return mConsoleService.get();
@@ -5079,17 +5079,17 @@ ContentParent::NotifyUpdatedDictionaries
 
     nsCOMPtr<nsISpellChecker> spellChecker(do_GetService(NS_SPELLCHECKER_CONTRACTID));
     MOZ_ASSERT(spellChecker, "No spell checker?");
 
     InfallibleTArray<nsString> dictionaries;
     spellChecker->GetDictionaryList(&dictionaries);
 
     for (size_t i = 0; i < processes.Length(); ++i) {
-        unused << processes[i]->SendUpdateDictionaryList(dictionaries);
+        Unused << processes[i]->SendUpdateDictionaryList(dictionaries);
     }
 }
 
 /*static*/ TabId
 ContentParent::AllocateTabId(const TabId& aOpenerTabId,
                              const IPCTabContext& aContext,
                              const ContentParentId& aCpId)
 {
@@ -5205,17 +5205,17 @@ ContentParent::RecvPOfflineCacheUpdateCo
     MOZ_ASSERT(aActor);
 
     RefPtr<mozilla::docshell::OfflineCacheUpdateParent> update =
         static_cast<mozilla::docshell::OfflineCacheUpdateParent*>(aActor);
 
     nsresult rv = update->Schedule(aManifestURI, aDocumentURI, aLoadingPrincipal, aStickDocument);
     if (NS_FAILED(rv) && IsAlive()) {
         // Inform the child of failure.
-        unused << update->SendFinish(false, false);
+        Unused << update->SendFinish(false, false);
     }
 
     return true;
 }
 
 bool
 ContentParent::DeallocPOfflineCacheUpdateParent(POfflineCacheUpdateParent* aActor)
 {
@@ -5284,17 +5284,17 @@ ContentParent::MaybeInvokeDragSession(Ta
         transfer->GetTransferables(lc);
       nsContentUtils::TransferablesToIPCTransferables(transferables,
                                                       dataTransfers,
                                                       false,
                                                       nullptr,
                                                       this);
       uint32_t action;
       session->GetDragAction(&action);
-      mozilla::unused << SendInvokeDragSession(dataTransfers, action);
+      mozilla::Unused << SendInvokeDragSession(dataTransfers, action);
     }
   }
 }
 
 bool
 ContentParent::RecvUpdateDropEffect(const uint32_t& aDragAction,
                                     const uint32_t& aDropEffect)
 {
@@ -5741,17 +5741,17 @@ ContentParent::RecvGetDeviceStorageLocat
 
 } // namespace dom
 } // namespace mozilla
 
 NS_IMPL_ISUPPORTS(ParentIdleListener, nsIObserver)
 
 NS_IMETHODIMP
 ParentIdleListener::Observe(nsISupports*, const char* aTopic, const char16_t* aData) {
-    mozilla::unused << mParent->SendNotifyIdleObserver(mObserver,
+    mozilla::Unused << mParent->SendNotifyIdleObserver(mObserver,
                                                        nsDependentCString(aTopic),
                                                        nsDependentString(aData));
     return NS_OK;
 }
 
 bool
 ContentParent::HandleWindowsMessages(const Message& aMsg) const
 {
--- a/dom/ipc/ContentProcess.cpp
+++ b/dom/ipc/ContentProcess.cpp
@@ -53,17 +53,17 @@ SetUpSandboxEnvironment()
   // Append our profile specific temp name.
   rv = lowIntegrityTemp->Append(NS_LITERAL_STRING("Temp-") + tempDirSuffix);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return;
   }
 
   // Change the gecko defined temp directory to our low integrity one.
   // Undefine returns a failure if the property is not already set.
-  unused << nsDirectoryService::gService->Undefine(NS_OS_TEMP_DIR);
+  Unused << nsDirectoryService::gService->Undefine(NS_OS_TEMP_DIR);
   rv = nsDirectoryService::gService->Set(NS_OS_TEMP_DIR, lowIntegrityTemp);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return;
   }
 }
 #endif
 
 void
--- a/dom/ipc/FilePickerParent.cpp
+++ b/dom/ipc/FilePickerParent.cpp
@@ -13,17 +13,17 @@
 #include "nsISimpleEnumerator.h"
 #include "mozilla/unused.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/Element.h"
 #include "mozilla/dom/TabParent.h"
 #include "mozilla/dom/ipc/BlobParent.h"
 
-using mozilla::unused;
+using mozilla::Unused;
 using namespace mozilla::dom;
 
 NS_IMPL_ISUPPORTS(FilePickerParent::FilePickerShownCallback,
                   nsIFilePickerShownCallback);
 
 NS_IMETHODIMP
 FilePickerParent::FilePickerShownCallback::Done(int16_t aResult)
 {
@@ -120,26 +120,26 @@ FilePickerParent::SendFiles(const nsTArr
     BlobParent* blobParent = parent->GetOrCreateActorForBlobImpl(aBlobs[i]);
     if (blobParent) {
       blobs.AppendElement(blobParent);
     }
   }
 
   InputFiles inblobs;
   inblobs.blobsParent().SwapElements(blobs);
-  unused << Send__delete__(this, inblobs, mResult);
+  Unused << Send__delete__(this, inblobs, mResult);
 }
 
 void
 FilePickerParent::Done(int16_t aResult)
 {
   mResult = aResult;
 
   if (mResult != nsIFilePicker::returnOK) {
-    unused << Send__delete__(this, void_t(), mResult);
+    Unused << Send__delete__(this, void_t(), mResult);
     return;
   }
 
   nsTArray<RefPtr<BlobImpl>> blobs;
   if (mMode == nsIFilePicker::modeOpenMultiple) {
     nsCOMPtr<nsISimpleEnumerator> iter;
     NS_ENSURE_SUCCESS_VOID(mFilePicker->GetFiles(getter_AddRefs(iter)));
 
@@ -162,17 +162,17 @@ FilePickerParent::Done(int16_t aResult)
       blobs.AppendElement(blobimpl);
     }
   }
 
   MOZ_ASSERT(!mRunnable);
   mRunnable = new FileSizeAndDateRunnable(this, blobs);
   // Dispatch to background thread to do I/O:
   if (!mRunnable->Dispatch()) {
-    unused << Send__delete__(this, void_t(), nsIFilePicker::returnCancel);
+    Unused << Send__delete__(this, void_t(), nsIFilePicker::returnCancel);
   }
 }
 
 bool
 FilePickerParent::CreateFilePicker()
 {
   mFilePicker = do_CreateInstance("@mozilla.org/filepicker;1");
   if (!mFilePicker) {
@@ -197,17 +197,17 @@ FilePickerParent::RecvOpen(const int16_t
                            const bool& aAddToRecentDocs,
                            const nsString& aDefaultFile,
                            const nsString& aDefaultExtension,
                            InfallibleTArray<nsString>&& aFilters,
                            InfallibleTArray<nsString>&& aFilterNames,
                            const nsString& aDisplayDirectory)
 {
   if (!CreateFilePicker()) {
-    unused << Send__delete__(this, void_t(), nsIFilePicker::returnCancel);
+    Unused << Send__delete__(this, void_t(), nsIFilePicker::returnCancel);
     return true;
   }
 
   mFilePicker->SetAddToRecentDocs(aAddToRecentDocs);
 
   for (uint32_t i = 0; i < aFilters.Length(); ++i) {
     mFilePicker->AppendFilter(aFilterNames[i], aFilters[i]);
   }
--- a/dom/ipc/NuwaChild.cpp
+++ b/dom/ipc/NuwaChild.cpp
@@ -234,17 +234,17 @@ AddNewIPCProcess(pid_t aPid, NuwaProtoFd
 }
 
 NS_EXPORT void
 OnNuwaProcessReady()
 {
   NuwaChild* nuwaChild = NuwaChild::GetSingleton();
   MOZ_ASSERT(nuwaChild);
 
-  mozilla::unused << nuwaChild->SendNotifyReady();
+  mozilla::Unused << nuwaChild->SendNotifyReady();
 }
 
 NS_EXPORT void
 AfterNuwaFork()
 {
   SetCurrentProcessPrivileges(base::PRIVILEGES_DEFAULT);
 #if defined(XP_LINUX) && defined(MOZ_SANDBOX)
   mozilla::SandboxEarlyInit(XRE_GetProcessType(), /* isNuwa: */ false);
--- a/dom/ipc/NuwaParent.cpp
+++ b/dom/ipc/NuwaParent.cpp
@@ -120,17 +120,17 @@ NuwaParent::CloneProtocol(Channel* aChan
     nsCOMPtr<nsIRunnable> nested = NS_NewRunnableFunction([actor] () -> void
     {
       AssertIsOnBackgroundThread();
 
       // Call NuwaParent::ActorConstructed() on the worker thread.
       actor->ActorConstructed();
 
       // The actor can finally be deleted after fully constructed.
-      mozilla::unused << actor->Send__delete__(actor);
+      mozilla::Unused << actor->Send__delete__(actor);
     });
     MOZ_ASSERT(nested);
     MOZ_ALWAYS_TRUE(NS_SUCCEEDED(
       actor->mWorkerThread->Dispatch(nested, NS_DISPATCH_NORMAL)));
   });
 
   MOZ_ASSERT(runnable);
   MOZ_ALWAYS_TRUE(NS_SUCCEEDED(NS_DispatchToMainThread(runnable)));
@@ -227,17 +227,17 @@ NuwaParent::ForkNewProcess(uint32_t& aPi
   MOZ_ASSERT(mWorkerThread);
   MOZ_ASSERT(NS_IsMainThread());
 
   mNewProcessFds = Move(aFds);
 
   RefPtr<NuwaParent> self = this;
   nsCOMPtr<nsIRunnable> runnable = NS_NewRunnableFunction([self] () -> void
   {
-    mozilla::unused << self->SendFork();
+    mozilla::Unused << self->SendFork();
   });
   MOZ_ASSERT(runnable);
   MOZ_ALWAYS_TRUE(NS_SUCCEEDED(mWorkerThread->Dispatch(runnable,
                                                        NS_DISPATCH_NORMAL)));
   if (!aBlocking) {
     return false;
   }
 
--- a/dom/ipc/PreallocatedProcessManager.cpp
+++ b/dom/ipc/PreallocatedProcessManager.cpp
@@ -314,17 +314,17 @@ SendTestOnlyNotification(const char* aMe
 
   AutoSafeJSContext cx;
   nsString message;
   message.AppendPrintf("%s", aMessage);
 
   nsCOMPtr<nsIMessageBroadcaster> ppmm =
     do_GetService("@mozilla.org/parentprocessmessagemanager;1");
 
-  mozilla::unused << ppmm->BroadcastAsyncMessage(
+  mozilla::Unused << ppmm->BroadcastAsyncMessage(
       message, JS::NullHandleValue, JS::NullHandleValue, cx, 1);
 }
 
 static void
 KillOrCloseProcess(ContentParent* aProcess)
 {
   if (TestCaseEnabled()) {
     // KillHard() the process because we don't want the process to abort when we
--- a/dom/ipc/ProcessHangMonitor.cpp
+++ b/dom/ipc/ProcessHangMonitor.cpp
@@ -345,17 +345,17 @@ HangMonitorChild::Open(Transport* aTrans
 }
 
 void
 HangMonitorChild::NotifySlowScriptAsync(TabId aTabId,
                                         const nsCString& aFileName,
                                         unsigned aLineNo)
 {
   if (mIPCOpen) {
-    unused << SendHangEvidence(SlowScriptData(aTabId, aFileName, aLineNo));
+    Unused << SendHangEvidence(SlowScriptData(aTabId, aFileName, aLineNo));
   }
 }
 
 HangMonitorChild::SlowScriptAction
 HangMonitorChild::NotifySlowScript(nsITabChild* aTabChild,
                                    const char* aFileName,
                                    unsigned aLineNo)
 {
@@ -424,17 +424,17 @@ HangMonitorChild::NotifyPluginHang(uint3
 
 void
 HangMonitorChild::NotifyPluginHangAsync(uint32_t aPluginId)
 {
   MOZ_RELEASE_ASSERT(MessageLoop::current() == MonitorLoop());
 
   // bounce back to parent on background thread
   if (mIPCOpen) {
-    unused << SendHangEvidence(PluginHangData(aPluginId));
+    Unused << SendHangEvidence(PluginHangData(aPluginId));
   }
 }
 
 void
 HangMonitorChild::ClearHang()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -618,37 +618,37 @@ HangMonitorParent::RecvHangEvidence(cons
 }
 
 void
 HangMonitorParent::TerminateScript()
 {
   MOZ_RELEASE_ASSERT(MessageLoop::current() == MonitorLoop());
 
   if (mIPCOpen) {
-    unused << SendTerminateScript();
+    Unused << SendTerminateScript();
   }
 }
 
 void
 HangMonitorParent::BeginStartingDebugger()
 {
   MOZ_RELEASE_ASSERT(MessageLoop::current() == MonitorLoop());
 
   if (mIPCOpen) {
-    unused << SendBeginStartingDebugger();
+    Unused << SendBeginStartingDebugger();
   }
 }
 
 void
 HangMonitorParent::EndStartingDebugger()
 {
   MOZ_RELEASE_ASSERT(MessageLoop::current() == MonitorLoop());
 
   if (mIPCOpen) {
-    unused << SendEndStartingDebugger();
+    Unused << SendEndStartingDebugger();
   }
 }
 
 void
 HangMonitorParent::CleanupPluginHang(uint32_t aPluginId, bool aRemoveFiles)
 {
   MutexAutoLock lock(mBrowserCrashDumpHashLock);
   nsAutoString crashId;
--- a/dom/ipc/ProcessPriorityManager.cpp
+++ b/dom/ipc/ProcessPriorityManager.cpp
@@ -1154,21 +1154,21 @@ ParticularProcessPriorityManager::SetPri
 
   mPriority = aPriority;
   hal::SetProcessPriority(Pid(), mPriority);
 
   if (oldPriority != mPriority) {
     ProcessPriorityManagerImpl::GetSingleton()->
       NotifyProcessPriorityChanged(this, oldPriority);
 
-    unused << mContentParent->SendNotifyProcessPriorityChanged(mPriority);
+    Unused << mContentParent->SendNotifyProcessPriorityChanged(mPriority);
   }
 
   if (aPriority < PROCESS_PRIORITY_FOREGROUND) {
-    unused << mContentParent->SendFlushMemory(NS_LITERAL_STRING("lowering-priority"));
+    Unused << mContentParent->SendFlushMemory(NS_LITERAL_STRING("lowering-priority"));
   }
 
   FireTestOnlyObserverNotification("process-priority-set",
     ProcessPriorityToString(mPriority));
 }
 
 void
 ParticularProcessPriorityManager::Freeze()
@@ -1372,17 +1372,17 @@ ProcessLRUPool::CalculateLRULevel(uint32
   // Priority+1: LRU2, LRU3
   // Priority+2: LRU4, LRU5, LRU6, LRU7
   // Priority+3: LRU8, LRU9, LRU10, LRU11, LRU12, LRU12, LRU13, LRU14, LRU15
   // ...
   // Priority+L-1: 2^(number of LRU pool levels - 1)
   // (End of buffer)
 
   int exp;
-  unused << frexp(static_cast<double>(aLRU), &exp);
+  Unused << frexp(static_cast<double>(aLRU), &exp);
   uint32_t level = std::max(exp - 1, 0);
 
   return std::min(mLRUPoolLevels - 1, level);
 }
 
 void
 ProcessLRUPool::Remove(ParticularProcessPriorityManager* aParticularManager)
 {
--- a/dom/ipc/ScreenManagerParent.cpp
+++ b/dom/ipc/ScreenManagerParent.cpp
@@ -21,17 +21,17 @@ ScreenManagerParent::ScreenManagerParent
                                          float* aSystemDefaultScale,
                                          bool* aSuccess)
 {
   mScreenMgr = do_GetService(sScreenManagerContractID);
   if (!mScreenMgr) {
     MOZ_CRASH("Couldn't get nsIScreenManager from ScreenManagerParent.");
   }
 
-  unused << RecvRefresh(aNumberOfScreens, aSystemDefaultScale, aSuccess);
+  Unused << RecvRefresh(aNumberOfScreens, aSystemDefaultScale, aSuccess);
 }
 
 bool
 ScreenManagerParent::RecvRefresh(uint32_t* aNumberOfScreens,
                                  float* aSystemDefaultScale,
                                  bool* aSuccess)
 {
   *aSuccess = false;
@@ -59,17 +59,17 @@ ScreenManagerParent::RecvScreenRefresh(c
 
   nsCOMPtr<nsIScreen> screen;
   nsresult rv = mScreenMgr->ScreenForId(aId, getter_AddRefs(screen));
   if (NS_FAILED(rv)) {
     return true;
   }
 
   ScreenDetails details;
-  unused << ExtractScreenDetails(screen, details);
+  Unused << ExtractScreenDetails(screen, details);
 
   *aRetVal = details;
   *aSuccess = true;
   return true;
 }
 
 bool
 ScreenManagerParent::RecvGetPrimaryScreen(ScreenDetails* aRetVal,
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -390,17 +390,17 @@ private:
     NS_IMETHOD
     Run()
     {
         MOZ_ASSERT(NS_IsMainThread());
         MOZ_ASSERT(mTabChild);
 
         // Check in case ActorDestroy was called after RecvDestroy message.
         if (mTabChild->IPCOpen()) {
-            unused << PBrowserChild::Send__delete__(mTabChild);
+            Unused << PBrowserChild::Send__delete__(mTabChild);
         }
 
         mTabChild = nullptr;
         return NS_OK;
     }
 };
 
 namespace {
@@ -694,17 +694,17 @@ TabChild::Observe(nsISupports *aSubject,
     if (window->WindowID() != windowID) {
       return NS_OK;
     }
 
     nsAutoString activeStr(aData);
     bool active = activeStr.EqualsLiteral("active");
     if (active != mAudioChannelsActive[audioChannel]) {
       mAudioChannelsActive[audioChannel] = active;
-      unused << SendAudioChannelActivityNotification(audioChannel, active);
+      Unused << SendAudioChannelActivityNotification(audioChannel, active);
     }
   }
 
   return NS_OK;
 }
 
 bool
 TabChild::DoUpdateZoomConstraints(const uint32_t& aPresShellId,
@@ -938,17 +938,17 @@ TabChild::SetStatusWithContext(uint32_t 
     SendSetStatus(aStatusType, nsString(aStatusText));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TabChild::SetDimensions(uint32_t aFlags, int32_t aX, int32_t aY,
                              int32_t aCx, int32_t aCy)
 {
-  unused << PBrowserChild::SendSetDimensions(aFlags, aX, aY, aCx, aCy);
+  Unused << PBrowserChild::SendSetDimensions(aFlags, aX, aY, aCx, aCy);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TabChild::GetDimensions(uint32_t aFlags, int32_t* aX,
                              int32_t* aY, int32_t* aCx, int32_t* aCy)
 {
@@ -1987,27 +1987,27 @@ TabChild::RecvKeyEvent(const nsString& a
 }
 
 bool
 TabChild::RecvCompositionEvent(const WidgetCompositionEvent& event)
 {
   WidgetCompositionEvent localEvent(event);
   localEvent.widget = mPuppetWidget;
   APZCCallbackHelper::DispatchWidgetEvent(localEvent);
-  unused << SendOnEventNeedingAckHandled(event.mMessage);
+  Unused << SendOnEventNeedingAckHandled(event.mMessage);
   return true;
 }
 
 bool
 TabChild::RecvSelectionEvent(const WidgetSelectionEvent& event)
 {
   WidgetSelectionEvent localEvent(event);
   localEvent.widget = mPuppetWidget;
   APZCCallbackHelper::DispatchWidgetEvent(localEvent);
-  unused << SendOnEventNeedingAckHandled(event.mMessage);
+  Unused << SendOnEventNeedingAckHandled(event.mMessage);
   return true;
 }
 
 a11y::PDocAccessibleChild*
 TabChild::AllocPDocAccessibleChild(PDocAccessibleChild*, const uint64_t&)
 {
   MOZ_ASSERT(false, "should never call this!");
   return nullptr;
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -179,17 +179,17 @@ private:
             FileDescriptor::PlatformHandleType handle =
                 FileDescriptor::PlatformHandleType(PR_FileDesc2NativeHandle(mFD));
             fd = FileDescriptor(handle);
         }
 
         // Our TabParent may have been destroyed already.  If so, don't send any
         // fds over, just go back to the IO thread and close them.
         if (!tabParent->IsDestroyed()) {
-            mozilla::unused << tabParent->SendCacheFileDescriptor(mPath, fd);
+            mozilla::Unused << tabParent->SendCacheFileDescriptor(mPath, fd);
         }
 
         if (!mFD) {
             return;
         }
 
         nsCOMPtr<nsIEventTarget> eventTarget;
         mEventTarget.swap(eventTarget);
@@ -227,17 +227,17 @@ private:
         OpenBlobImpl();
 
         if (NS_FAILED(NS_DispatchToMainThread(this))) {
             NS_WARNING("Failed to dispatch to main thread!");
 
             // Intentionally leak the runnable (but not the fd) rather
             // than crash when trying to release a main thread object
             // off the main thread.
-            mozilla::unused << mTabParent.forget();
+            mozilla::Unused << mTabParent.forget();
             CloseFile();
         }
     }
 
     void CloseFile()
     {
         // It's possible for this to happen on the main thread if the dispatch
         // to the stream service fails after we've already opened the file so
@@ -544,17 +544,17 @@ TabParent::DestroyInternal()
 {
   IMEStateManager::OnTabParentDestroying(this);
 
   RemoveWindowListeners();
 
   // If this fails, it's most likely due to a content-process crash,
   // and auto-cleanup will kick in.  Otherwise, the child side will
   // destroy itself and send back __delete__().
-  unused << SendDestroy();
+  Unused << SendDestroy();
 
   if (RenderFrameParent* frame = GetRenderFrame()) {
     RemoveTabParentFromTable(frame->GetLayersId());
     frame->Destroy();
   }
 
   // Let all PluginWidgets know we are tearing down. Prevents
   // these objects from sending async events after the child side
@@ -764,27 +764,27 @@ TabParent::LoadURL(nsIURI* aURI)
         mDelayedURL = spec;
         return;
     }
 
     uint32_t appId = OwnOrContainingAppId();
     if (mSendOfflineStatus && NS_IsAppOffline(appId)) {
       // If the app is offline in the parent process
       // pass that state to the child process as well
-      unused << SendAppOfflineStatus(appId, true);
+      Unused << SendAppOfflineStatus(appId, true);
     }
     mSendOfflineStatus = false;
 
     // This object contains the configuration for this new app.
     BrowserConfiguration configuration;
     if (NS_WARN_IF(!InitBrowserConfiguration(spec, configuration))) {
       return;
     }
 
-    unused << SendLoadURL(spec, configuration, GetShowInfo());
+    Unused << SendLoadURL(spec, configuration, GetShowInfo());
 
     // If this app is a packaged app then we can speed startup by sending over
     // the file descriptor for the "application.zip" file that it will
     // invariably request. Only do this once.
     if (!mAppPackageFileDescriptorSent) {
         mAppPackageFileDescriptorSent = true;
 
         nsCOMPtr<mozIApplication> app = GetOwnOrContainingApp();
@@ -819,17 +819,17 @@ TabParent::LoadURL(nsIURI* aURI)
 
 #ifndef XP_WIN
                 PRFileDesc* cachedFd = nullptr;
                 gJarHandler->JarCache()->GetFd(packageFile, &cachedFd);
 
                 if (cachedFd) {
                     FileDescriptor::PlatformHandleType handle =
                         FileDescriptor::PlatformHandleType(PR_FileDesc2NativeHandle(cachedFd));
-                    unused << SendCacheFileDescriptor(path, FileDescriptor(handle));
+                    Unused << SendCacheFileDescriptor(path, FileDescriptor(handle));
                 } else
 #endif
                 {
                     RefPtr<OpenFileAndSendFDRunnable> openFileRunnable =
                         new OpenFileAndSendFDRunnable(path, this);
                     openFileRunnable->Dispatch();
                 }
             }
@@ -858,21 +858,21 @@ TabParent::Show(const ScreenIntSize& siz
         if (frameLoader) {
           renderFrame =
               new RenderFrameParent(frameLoader,
                                     &textureFactoryIdentifier,
                                     &layersId,
                                     &success);
           MOZ_ASSERT(success);
           AddTabParentToTable(layersId, this);
-          unused << SendPRenderFrameConstructor(renderFrame);
+          Unused << SendPRenderFrameConstructor(renderFrame);
         }
     }
 
-    unused << SendShow(size, GetShowInfo(), textureFactoryIdentifier,
+    Unused << SendShow(size, GetShowInfo(), textureFactoryIdentifier,
                        layersId, renderFrame, aParentIsActive);
 }
 
 bool
 TabParent::RecvSetDimensions(const uint32_t& aFlags,
                              const int32_t& aX, const int32_t& aY,
                              const int32_t& aCx, const int32_t& aCy)
 {
@@ -957,152 +957,152 @@ TabParent::UpdateDimensions(const nsIntR
       ViewAs<LayoutDevicePixel>(mRect,
                                 PixelCastJustification::LayoutDeviceIsScreenForTabDims);
     LayoutDeviceIntSize devicePixelSize =
       ViewAs<LayoutDevicePixel>(mDimensions.ToUnknownSize(),
                                 PixelCastJustification::LayoutDeviceIsScreenForTabDims);
 
     CSSRect unscaledRect = devicePixelRect / widgetScale;
     CSSSize unscaledSize = devicePixelSize / widgetScale;
-    unused << SendUpdateDimensions(unscaledRect, unscaledSize,
+    Unused << SendUpdateDimensions(unscaledRect, unscaledSize,
                                    widget->SizeMode(),
                                    orientation, chromeOffset);
   }
 }
 
 void
 TabParent::UpdateFrame(const FrameMetrics& aFrameMetrics)
 {
   if (!mIsDestroyed) {
-    unused << SendUpdateFrame(aFrameMetrics);
+    Unused << SendUpdateFrame(aFrameMetrics);
   }
 }
 
 void
 TabParent::UIResolutionChanged()
 {
   if (!mIsDestroyed) {
     // TryCacheDPIAndScale()'s cache is keyed off of
     // mDPI being greater than 0, so this invalidates it.
     mDPI = -1;
     TryCacheDPIAndScale();
     // If mDPI was set to -1 to invalidate it and then TryCacheDPIAndScale
     // fails to cache the values, then mDefaultScale.scale might be invalid.
     // We don't want to send that value to content. Just send -1 for it too in
     // that case.
-    unused << SendUIResolutionChanged(mDPI, mDPI < 0 ? -1.0 : mDefaultScale.scale);
+    Unused << SendUIResolutionChanged(mDPI, mDPI < 0 ? -1.0 : mDefaultScale.scale);
   }
 }
 
 void
 TabParent::ThemeChanged()
 {
   if (!mIsDestroyed) {
     // The theme has changed, and any cached values we had sent down
     // to the child have been invalidated. When this method is called,
     // LookAndFeel should have the up-to-date values, which we now
     // send down to the child. We do this for every remote tab for now,
     // but bug 1156934 has been filed to do it once per content process.
-    unused << SendThemeChanged(LookAndFeel::GetIntCache());
+    Unused << SendThemeChanged(LookAndFeel::GetIntCache());
   }
 }
 
 void
 TabParent::HandleAccessKey(nsTArray<uint32_t>& aCharCodes,
                            const bool& aIsTrusted,
                            const int32_t& aModifierMask)
 {
   if (!mIsDestroyed) {
-    unused << SendHandleAccessKey(aCharCodes, aIsTrusted, aModifierMask);
+    Unused << SendHandleAccessKey(aCharCodes, aIsTrusted, aModifierMask);
   }
 }
 
 void
 TabParent::RequestFlingSnap(const FrameMetrics::ViewID& aScrollId,
                             const mozilla::CSSPoint& aDestination)
 {
   if (!mIsDestroyed) {
-    unused << SendRequestFlingSnap(aScrollId, aDestination);
+    Unused << SendRequestFlingSnap(aScrollId, aDestination);
   }
 }
 
 void
 TabParent::AcknowledgeScrollUpdate(const ViewID& aScrollId, const uint32_t& aScrollGeneration)
 {
   if (!mIsDestroyed) {
-    unused << SendAcknowledgeScrollUpdate(aScrollId, aScrollGeneration);
+    Unused << SendAcknowledgeScrollUpdate(aScrollId, aScrollGeneration);
   }
 }
 
 void TabParent::HandleDoubleTap(const CSSPoint& aPoint,
                                 Modifiers aModifiers,
                                 const ScrollableLayerGuid &aGuid)
 {
   if (!mIsDestroyed) {
-    unused << SendHandleDoubleTap(aPoint, aModifiers, aGuid);
+    Unused << SendHandleDoubleTap(aPoint, aModifiers, aGuid);
   }
 }
 
 void TabParent::HandleSingleTap(const CSSPoint& aPoint,
                                 Modifiers aModifiers,
                                 const ScrollableLayerGuid &aGuid)
 {
   if (!mIsDestroyed) {
-    unused << SendHandleSingleTap(aPoint, aModifiers, aGuid);
+    Unused << SendHandleSingleTap(aPoint, aModifiers, aGuid);
   }
 }
 
 void TabParent::HandleLongTap(const CSSPoint& aPoint,
                               Modifiers aModifiers,
                               const ScrollableLayerGuid &aGuid,
                               uint64_t aInputBlockId)
 {
   if (!mIsDestroyed) {
-    unused << SendHandleLongTap(aPoint, aModifiers, aGuid, aInputBlockId);
+    Unused << SendHandleLongTap(aPoint, aModifiers, aGuid, aInputBlockId);
   }
 }
 
 void TabParent::NotifyAPZStateChange(ViewID aViewId,
                                      APZStateChange aChange,
                                      int aArg)
 {
   if (!mIsDestroyed) {
-    unused << SendNotifyAPZStateChange(aViewId, aChange, aArg);
+    Unused << SendNotifyAPZStateChange(aViewId, aChange, aArg);
   }
 }
 
 void
 TabParent::NotifyMouseScrollTestEvent(const ViewID& aScrollId, const nsString& aEvent)
 {
   if (!mIsDestroyed) {
-    unused << SendMouseScrollTestEvent(aScrollId, aEvent);
+    Unused << SendMouseScrollTestEvent(aScrollId, aEvent);
   }
 }
 
 void
 TabParent::NotifyFlushComplete()
 {
   if (!mIsDestroyed) {
-    unused << SendNotifyFlushComplete();
+    Unused << SendNotifyFlushComplete();
   }
 }
 
 void
 TabParent::Activate()
 {
   if (!mIsDestroyed) {
-    unused << SendActivate();
+    Unused << SendActivate();
   }
 }
 
 void
 TabParent::Deactivate()
 {
   if (!mIsDestroyed) {
-    unused << SendDeactivate();
+    Unused << SendDeactivate();
   }
 }
 
 NS_IMETHODIMP
 TabParent::Init(nsIDOMWindow *window)
 {
   return NS_OK;
 }
@@ -1283,31 +1283,31 @@ TabParent::DeallocPIndexedDBPermissionRe
 }
 
 void
 TabParent::SendMouseEvent(const nsAString& aType, float aX, float aY,
                           int32_t aButton, int32_t aClickCount,
                           int32_t aModifiers, bool aIgnoreRootScrollFrame)
 {
   if (!mIsDestroyed) {
-    unused << PBrowserParent::SendMouseEvent(nsString(aType), aX, aY,
+    Unused << PBrowserParent::SendMouseEvent(nsString(aType), aX, aY,
                                              aButton, aClickCount,
                                              aModifiers, aIgnoreRootScrollFrame);
   }
 }
 
 void
 TabParent::SendKeyEvent(const nsAString& aType,
                         int32_t aKeyCode,
                         int32_t aCharCode,
                         int32_t aModifiers,
                         bool aPreventDefault)
 {
   if (!mIsDestroyed) {
-    unused << PBrowserParent::SendKeyEvent(nsString(aType), aKeyCode, aCharCode,
+    Unused << PBrowserParent::SendKeyEvent(nsString(aType), aKeyCode, aCharCode,
                                            aModifiers, aPreventDefault);
   }
 }
 
 bool TabParent::SendRealMouseEvent(WidgetMouseEvent& event)
 {
   if (mIsDestroyed) {
     return false;
@@ -2904,17 +2904,17 @@ TabParent::GetUseAsyncPanZoom(bool* useA
   return NS_OK;
 }
 
 // defined in nsITabParent
 NS_IMETHODIMP
 TabParent::SetDocShellIsActive(bool isActive)
 {
   mDocShellIsActive = isActive;
-  unused << SendSetDocShellIsActive(isActive);
+  Unused << SendSetDocShellIsActive(isActive);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TabParent::GetDocShellIsActive(bool* aIsActive)
 {
   *aIsActive = mDocShellIsActive;
   return NS_OK;
@@ -2930,17 +2930,17 @@ TabParent::SuppressDisplayport(bool aEna
   if (aEnabled) {
     mActiveSupressDisplayportCount++;
   } else {
     mActiveSupressDisplayportCount--;
   }
 
   MOZ_ASSERT(mActiveSupressDisplayportCount >= 0);
 
-  unused << SendSuppressDisplayport(aEnabled);
+  Unused << SendSuppressDisplayport(aEnabled);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 TabParent::GetTabId(uint64_t* aId)
 {
   *aId = GetTabId();
   return NS_OK;
@@ -2957,17 +2957,17 @@ void
 TabParent::SetHasContentOpener(bool aHasContentOpener)
 {
   mHasContentOpener = aHasContentOpener;
 }
 
 NS_IMETHODIMP
 TabParent::NavigateByKey(bool aForward, bool aForDocumentNavigation)
 {
-  unused << SendNavigateByKey(aForward, aForDocumentNavigation);
+  Unused << SendNavigateByKey(aForward, aForDocumentNavigation);
   return NS_OK;
 }
 
 class LayerTreeUpdateRunnable final
   : public nsRunnable
 {
   uint64_t mLayersId;
   bool mActive;
@@ -3246,17 +3246,17 @@ TabParent::RecvInvokeDragSession(nsTArra
                                  const uint32_t& aWidth, const uint32_t& aHeight,
                                  const uint32_t& aStride, const uint8_t& aFormat,
                                  const int32_t& aDragAreaX, const int32_t& aDragAreaY)
 {
   mInitialDataTransferItems.Clear();
   nsIPresShell* shell = mFrameElement->OwnerDoc()->GetShell();
   if (!shell) {
     if (Manager()->IsContentParent()) {
-      unused << Manager()->AsContentParent()->SendEndDragSession(true, true);
+      Unused << Manager()->AsContentParent()->SendEndDragSession(true, true);
     }
     return true;
   }
 
   EventStateManager* esm = shell->GetPresContext()->EventStateManager();
   for (uint32_t i = 0; i < aTransfers.Length(); ++i) {
     auto& items = aTransfers[i].items();
     nsTArray<DataTransferItem>* itemArray = mInitialDataTransferItems.AppendElement();
--- a/dom/ipc/nsIContentParent.cpp
+++ b/dom/ipc/nsIContentParent.cpp
@@ -117,19 +117,19 @@ nsIContentParent::CanOpenBrowser(const I
 PBrowserParent*
 nsIContentParent::AllocPBrowserParent(const TabId& aTabId,
                                       const IPCTabContext& aContext,
                                       const uint32_t& aChromeFlags,
                                       const ContentParentId& aCpId,
                                       const bool& aIsForApp,
                                       const bool& aIsForBrowser)
 {
-  unused << aCpId;
-  unused << aIsForApp;
-  unused << aIsForBrowser;
+  Unused << aCpId;
+  Unused << aIsForApp;
+  Unused << aIsForBrowser;
 
   if (!CanOpenBrowser(aContext)) {
     return nullptr;
   }
 
   uint32_t chromeFlags = aChromeFlags;
   if (aContext.type() == IPCTabContext::TPopupIPCTabContext) {
     // CanOpenBrowser has ensured that the IPCTabContext is of
--- a/dom/locales/en-US/chrome/dom/dom.properties
+++ b/dom/locales/en-US/chrome/dom/dom.properties
@@ -181,8 +181,10 @@ InterceptedErrorResponseWithURL=Failed t
 # LOCALIZATION NOTE: Do not translate "ServiceWorker", "Response", "FetchEvent.respondWith()", or "Response.clone()". %S is a URL.
 InterceptedUsedResponseWithURL=Failed to load '%S'. A ServiceWorker passed a used Response to FetchEvent.respondWith(). The body of a Response may only be read once. Use Response.clone() to access the body multiple times.
 # LOCALIZATION NOTE: Do not translate "ServiceWorker", "opaqueredirect", "Response", "FetchEvent.respondWith()", or "FetchEvent". %s is a URL.
 BadOpaqueRedirectInterceptionWithURL=Failed to load '%S'. A ServiceWorker passed an opaqueredirect Response to FetchEvent.respondWith() while handling a non-navigation FetchEvent.
 # LOCALIZATION NOTE: Do not translate "ServiceWorker" or "FetchEvent.preventDefault()". %S is a URL.
 InterceptionCanceledWithURL=Failed to load '%S'. A ServiceWorker canceled the load by calling FetchEvent.preventDefault().
 # LOCALIZATION NOTE: Do not translate "ServiceWorker", "promise", or "FetchEvent.respondWith()". %1$S is a URL. %2$S is an error string.
 InterceptionRejectedResponseWithURL=Failed to load '%1$S'. A ServiceWorker passed a promise to FetchEvent.respondWith() that rejected with '%2$S'.
+# LOCALIZATION NOTE: Do not translate "ServiceWorker", "promise", "FetchEvent.respondWith()", or "Response". %1$S is a URL. %2$S is an error string.
+InterceptedNonResponseWithURL=Failed to load '%1$S'. A ServiceWorker passed a promise to FetchEvent.respondWith() that resolved with non-Response value '%2$S'.
--- a/dom/media/AbstractMediaDecoder.h
+++ b/dom/media/AbstractMediaDecoder.h
@@ -47,18 +47,16 @@ enum class MediaDecoderEventVisibility :
  */
 class AbstractMediaDecoder : public nsIObserver
 {
 public:
   // A special version of the above for the ogg decoder that is allowed to be
   // called cross-thread.
   virtual bool IsOggDecoderShutdown() { return false; }
 
-  virtual bool OnStateMachineTaskQueue() const = 0;
-
   // Get the current MediaResource being used. Its URI will be returned
   // by currentSrc. Returns what was passed to Load(), if Load() has been called.
   virtual MediaResource* GetResource() const = 0;
 
   // Called by the decode thread to keep track of the number of bytes read
   // from the resource.
   virtual void NotifyBytesConsumed(int64_t aBytes, int64_t aOffset) = 0;
 
--- a/dom/media/DOMMediaStream.cpp
+++ b/dom/media/DOMMediaStream.cpp
@@ -693,18 +693,19 @@ DOMMediaStream::CreateAudioCaptureStream
   RefPtr<DOMMediaStream> stream = new DOMMediaStream();
   stream->InitAudioCaptureStream(aWindow, aGraph);
   return stream.forget();
 }
 
 void
 DOMMediaStream::SetTrackEnabled(TrackID aTrackID, bool aEnabled)
 {
-  if (mOwnedStream) {
-    mOwnedStream->SetTrackEnabled(aTrackID, aEnabled);
+  // XXX Bug 1208371 - This enables/disables the track across clones.
+  if (mInputStream) {
+    mInputStream->SetTrackEnabled(aTrackID, aEnabled);
   }
 }
 
 void
 DOMMediaStream::StopTrack(TrackID aTrackID)
 {
   if (mInputStream && mInputStream->AsSourceStream()) {
     mInputStream->AsSourceStream()->EndTrack(aTrackID);
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -1227,22 +1227,16 @@ void
 MediaDecoder::SetLoadInBackground(bool aLoadInBackground)
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (mResource) {
     mResource->SetLoadInBackground(aLoadInBackground);
   }
 }
 
-bool
-MediaDecoder::OnStateMachineTaskQueue() const
-{
-  return mDecoderStateMachine->OnTaskQueue();
-}
-
 void
 MediaDecoder::SetPlaybackRate(double aPlaybackRate)
 {
   MOZ_ASSERT(NS_IsMainThread());
   mPlaybackRate = aPlaybackRate;
   if (mPlaybackRate == 0.0) {
     mPausedForPlaybackRateNull = true;
     Pause();
--- a/dom/media/MediaDecoder.h
+++ b/dom/media/MediaDecoder.h
@@ -507,18 +507,16 @@ public:
   // delaying the load event. This also determines whether any new loads
   // initiated (for example to seek) will be in the background.  This calls
   // SetLoadInBackground() on mResource.
   void SetLoadInBackground(bool aLoadInBackground);
 
   // Returns a weak reference to the media decoder owner.
   MediaDecoderOwner* GetMediaOwner() const override;
 
-  bool OnStateMachineTaskQueue() const override;
-
   MediaDecoderStateMachine* GetStateMachine() const;
   void SetStateMachine(MediaDecoderStateMachine* aStateMachine);
 
   // Constructs the time ranges representing what segments of the media
   // are buffered and playable.
   virtual media::TimeIntervals GetBuffered();
 
   // Returns the size, in bytes, of the heap memory used by the currently
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -227,35 +227,35 @@ public:
 
   TimedMetadataEventSource& TimedMetadataEvent() {
     return mMetadataManager.TimedMetadataEvent();
   }
 
   // Immutable after construction - may be called on any thread.
   bool IsRealTime() const { return mRealTime; }
 
-  // Functions used by assertions to ensure we're calling things
-  // on the appropriate threads.
-  bool OnTaskQueue() const;
-
   size_t SizeOfVideoQueue() {
     if (mReader) {
       return mReader->SizeOfVideoQueueInBytes();
     }
     return 0;
   }
 
   size_t SizeOfAudioQueue() {
     if (mReader) {
       return mReader->SizeOfAudioQueueInBytes();
     }
     return 0;
   }
 
 private:
+  // Functions used by assertions to ensure we're calling things
+  // on the appropriate threads.
+  bool OnTaskQueue() const;
+
   // Initialization that needs to happen on the task queue. This is the first
   // task that gets run on the task queue, and is dispatched from the MDSM
   // constructor immediately after the task queue is created.
   void InitializationTask();
 
   void SetDormant(bool aDormant);
 
   void SetAudioCaptured(bool aCaptured);
--- a/dom/media/MediaEventSource.h
+++ b/dom/media/MediaEventSource.h
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MediaEventSource_h_
 #define MediaEventSource_h_
 
 #include "mozilla/AbstractThread.h"
 #include "mozilla/Atomics.h"
 #include "mozilla/Mutex.h"
+#include "mozilla/Tuple.h"
 #include "mozilla/TypeTraits.h"
 #include "mozilla/UniquePtr.h"
 
 #include "nsISupportsImpl.h"
 #include "nsTArray.h"
 #include "nsThreadUtils.h"
 
 namespace mozilla {
@@ -125,87 +126,95 @@ private:
  * A helper class to pass event data to the listeners. Optimized to save
  * copy when Move is possible or |Function| takes no arguments.
  */
 template<typename Target, typename Function>
 class ListenerHelper {
   // Define our custom runnable to minimize copy of the event data.
   // NS_NewRunnableFunction will result in 2 copies of the event data.
   // One is captured by the lambda and the other is the copy of the lambda.
-  template <typename T>
+  template <typename... Ts>
   class R : public nsRunnable {
-    typedef typename RemoveCV<typename RemoveReference<T>::Type>::Type ArgType;
   public:
-    template <typename U>
-    R(RevocableToken* aToken, const Function& aFunction, U&& aEvent)
-      : mToken(aToken), mFunction(aFunction), mEvent(Forward<U>(aEvent)) {}
+    template <typename... Us>
+    R(RevocableToken* aToken, const Function& aFunction, Us&&... aEvents)
+      : mToken(aToken)
+      , mFunction(aFunction)
+      , mEvents(Forward<Us>(aEvents)...) {}
+
+    template <typename... Vs, size_t... Is>
+    void Invoke(Tuple<Vs...>& aEvents, IndexSequence<Is...>) {
+      // Enable move whenever possible since mEvent won't be used anymore.
+      mFunction(Move(Get<Is>(aEvents))...);
+    }
 
     NS_IMETHOD Run() override {
       // Don't call the listener if it is disconnected.
       if (!mToken->IsRevoked()) {
-        // Enable move whenever possible since mEvent won't be used anymore.
-        mFunction(Move(mEvent));
+        Invoke(mEvents, typename IndexSequenceFor<Ts...>::Type());
       }
       return NS_OK;
     }
 
   private:
     RefPtr<RevocableToken> mToken;
     Function mFunction;
-    ArgType mEvent;
+
+    template <typename T>
+    using ArgType = typename RemoveCV<typename RemoveReference<T>::Type>::Type;
+    Tuple<ArgType<Ts>...> mEvents;
   };
 
 public:
   ListenerHelper(RevocableToken* aToken, Target* aTarget, const Function& aFunc)
     : mToken(aToken), mTarget(aTarget), mFunction(aFunc) {}
 
-  // |F| takes one argument.
-  template <typename F, typename T>
+  // |F| takes one or more arguments.
+  template <typename F, typename... Ts>
   typename EnableIf<TakeArgs<F>::value, void>::Type
-  Dispatch(const F& aFunc, T&& aEvent) {
-    nsCOMPtr<nsIRunnable> r = new R<T>(mToken, aFunc, Forward<T>(aEvent));
+  DispatchHelper(const F& aFunc, Ts&&... aEvents) {
+    nsCOMPtr<nsIRunnable> r =
+      new R<Ts...>(mToken, aFunc, Forward<Ts>(aEvents)...);
     EventTarget<Target>::Dispatch(mTarget.get(), r.forget());
   }
 
   // |F| takes no arguments. Don't bother passing aEvent.
-  template <typename F, typename T>
+  template <typename F, typename... Ts>
   typename EnableIf<!TakeArgs<F>::value, void>::Type
-  Dispatch(const F& aFunc, T&&) {
+  DispatchHelper(const F& aFunc, Ts&&...) {
     const RefPtr<RevocableToken>& token = mToken;
     nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([=] () {
       // Don't call the listener if it is disconnected.
       if (!token->IsRevoked()) {
         aFunc();
       }
     });
     EventTarget<Target>::Dispatch(mTarget.get(), r.forget());
   }
 
-  template <typename T>
-  void Dispatch(T&& aEvent) {
-    Dispatch(mFunction, Forward<T>(aEvent));
+  template <typename... Ts>
+  void Dispatch(Ts&&... aEvents) {
+    DispatchHelper(mFunction, Forward<Ts>(aEvents)...);
   }
 
 private:
   RefPtr<RevocableToken> mToken;
   const RefPtr<Target> mTarget;
   Function mFunction;
 };
 
 /**
  * Define whether an event data should be copied or moved to the listeners.
  *
  * @Copy Data will always be copied. Each listener gets a copy.
  * @Move Data will always be moved.
- * @Both Data will be moved when possible or copied when necessary.
  */
 enum class EventPassMode : int8_t {
   Copy,
-  Move,
-  Both
+  Move
 };
 
 class ListenerBase {
 public:
   ListenerBase() : mToken(new RevocableToken()) {}
   ~ListenerBase() {
     MOZ_ASSERT(Token()->IsRevoked(), "Must disconnect the listener.");
   }
@@ -216,116 +225,102 @@ private:
   const RefPtr<RevocableToken> mToken;
 };
 
 /**
  * Stored by MediaEventSource to send notifications to the listener.
  * Since virtual methods can not be templated, this class is specialized
  * to provide different Dispatch() overloads depending on EventPassMode.
  */
-template <typename ArgType, EventPassMode Mode = EventPassMode::Copy>
+template <EventPassMode Mode, typename... As>
 class Listener : public ListenerBase {
 public:
   virtual ~Listener() {}
-  virtual void Dispatch(const ArgType& aEvent) = 0;
+  virtual void Dispatch(const As&... aEvents) = 0;
 };
 
-template <typename ArgType>
-class Listener<ArgType, EventPassMode::Both> : public ListenerBase {
+template <typename... As>
+class Listener<EventPassMode::Move, As...> : public ListenerBase {
 public:
   virtual ~Listener() {}
-  virtual void Dispatch(const ArgType& aEvent) = 0;
-  virtual void Dispatch(ArgType&& aEvent) = 0;
-};
-
-template <typename ArgType>
-class Listener<ArgType, EventPassMode::Move> : public ListenerBase {
-public:
-  virtual ~Listener() {}
-  virtual void Dispatch(ArgType&& aEvent) = 0;
+  virtual void Dispatch(As&&... aEvents) = 0;
 };
 
 /**
  * Store the registered target thread and function so it knows where and to
  * whom to send the event data.
  */
-template <typename Target, typename Function, typename ArgType, EventPassMode>
-class ListenerImpl : public Listener<ArgType, EventPassMode::Copy> {
+template <typename Target, typename Function, EventPassMode, typename... As>
+class ListenerImpl : public Listener<EventPassMode::Copy, As...> {
 public:
   ListenerImpl(Target* aTarget, const Function& aFunction)
     : mHelper(ListenerBase::Token(), aTarget, aFunction) {}
-  void Dispatch(const ArgType& aEvent) override {
-    mHelper.Dispatch(aEvent);
+  void Dispatch(const As&... aEvents) override {
+    mHelper.Dispatch(aEvents...);
   }
 private:
   ListenerHelper<Target, Function> mHelper;
 };
 
-template <typename Target, typename Function, typename ArgType>
-class ListenerImpl<Target, Function, ArgType, EventPassMode::Both>
-  : public Listener<ArgType, EventPassMode::Both> {
+template <typename Target, typename Function, typename... As>
+class ListenerImpl<Target, Function, EventPassMode::Move, As...>
+  : public Listener<EventPassMode::Move, As...> {
 public:
   ListenerImpl(Target* aTarget, const Function& aFunction)
     : mHelper(ListenerBase::Token(), aTarget, aFunction) {}
-  void Dispatch(const ArgType& aEvent) override {
-    mHelper.Dispatch(aEvent);
-  }
-  void Dispatch(ArgType&& aEvent) override {
-    mHelper.Dispatch(Move(aEvent));
-  }
-private:
-  ListenerHelper<Target, Function> mHelper;
-};
-
-template <typename Target, typename Function, typename ArgType>
-class ListenerImpl<Target, Function, ArgType, EventPassMode::Move>
-  : public Listener<ArgType, EventPassMode::Move> {
-public:
-  ListenerImpl(Target* aTarget, const Function& aFunction)
-    : mHelper(ListenerBase::Token(), aTarget, aFunction) {}
-  void Dispatch(ArgType&& aEvent) override {
-    mHelper.Dispatch(Move(aEvent));
+  void Dispatch(As&&... aEvents) override {
+    mHelper.Dispatch(Move(aEvents)...);
   }
 private:
   ListenerHelper<Target, Function> mHelper;
 };
 
 /**
- * Select EventPassMode based on ListenerMode and if the type is copyable.
+ * Select EventPassMode based on ListenerMode.
  *
  * @Copy Selected when ListenerMode is NonExclusive because each listener
  * must get a copy.
  *
- * @Move Selected when ListenerMode is Exclusive and the type is move-only.
- *
- * @Both Selected when ListenerMode is Exclusive and the type is copyable.
- * The data will be moved when possible and copied when necessary.
+ * @Move Selected when ListenerMode is Exclusive. All types passed to
+ * MediaEventProducer::Notify() must be movable.
  */
-template <typename ArgType, ListenerMode Mode>
+template <ListenerMode Mode>
 struct PassModePicker {
-  // TODO: pick EventPassMode::Both when we can detect if a type is
-  // copy-constructible to allow copy-only types in Exclusive mode.
   static const EventPassMode Value =
     Mode == ListenerMode::NonExclusive ?
     EventPassMode::Copy : EventPassMode::Move;
 };
 
+/**
+ * Return true if any type is a reference type.
+ */
+template <typename Head, typename... Tails>
+struct IsAnyReference {
+  static const bool value = IsReference<Head>::value ||
+                            IsAnyReference<Tails...>::value;
+};
+
+template <typename T>
+struct IsAnyReference<T> {
+  static const bool value = IsReference<T>::value;
+};
+
 } // namespace detail
 
-template <typename T, ListenerMode> class MediaEventSource;
+template <ListenerMode, typename... Ts> class MediaEventSourceImpl;
 
 /**
  * Not thread-safe since this is not meant to be shared and therefore only
  * move constructor is provided. Used to hold the result of
  * MediaEventSource<T>::Connect() and call Disconnect() to disconnect the
  * listener from an event source.
  */
 class MediaEventListener {
-  template <typename T, ListenerMode>
-  friend class MediaEventSource;
+  template <ListenerMode, typename... Ts>
+  friend class MediaEventSourceImpl;
 
 public:
   MediaEventListener() {}
 
   MediaEventListener(MediaEventListener&& aOther)
     : mToken(Move(aOther.mToken)) {}
 
   MediaEventListener& operator=(MediaEventListener&& aOther) {
@@ -354,47 +349,53 @@ private:
   // listeners can be disconnected in a controlled manner.
   explicit MediaEventListener(RevocableToken* aToken) : mToken(aToken) {}
   RefPtr<RevocableToken> mToken;
 };
 
 /**
  * A generic and thread-safe class to implement the observer pattern.
  */
-template <typename EventType, ListenerMode Mode = ListenerMode::NonExclusive>
-class MediaEventSource {
-  static_assert(!IsReference<EventType>::value, "Ref-type not supported!");
-  typedef typename detail::EventTypeTraits<EventType>::ArgType ArgType;
-  static const detail::EventPassMode PassMode
-    = detail::PassModePicker<ArgType, Mode>::Value;
-  typedef detail::Listener<ArgType, PassMode> Listener;
+template <ListenerMode Mode, typename... Es>
+class MediaEventSourceImpl {
+  static_assert(!detail::IsAnyReference<Es...>::value,
+                "Ref-type not supported!");
+
+  template <typename T>
+  using ArgType = typename detail::EventTypeTraits<T>::ArgType;
+
+  static const detail::EventPassMode PassMode =
+    detail::PassModePicker<Mode>::Value;
+
+  typedef detail::Listener<PassMode, ArgType<Es>...> Listener;
 
   template<typename Target, typename Func>
-  using ListenerImpl = detail::ListenerImpl<Target, Func, ArgType, PassMode>;
+  using ListenerImpl =
+    detail::ListenerImpl<Target, Func, PassMode, ArgType<Es>...>;
 
   template <typename Method>
   using TakeArgs = detail::TakeArgs<Method>;
 
   template<typename Target, typename Function>
   MediaEventListener
   ConnectInternal(Target* aTarget, const Function& aFunction) {
     MutexAutoLock lock(mMutex);
     MOZ_ASSERT(Mode == ListenerMode::NonExclusive || mListeners.IsEmpty());
     auto l = mListeners.AppendElement();
     l->reset(new ListenerImpl<Target, Function>(aTarget, aFunction));
     return MediaEventListener((*l)->Token());
   }
 
-  // |Method| takes one argument.
+  // |Method| takes one or more arguments.
   template <typename Target, typename This, typename Method>
   typename EnableIf<TakeArgs<Method>::value, MediaEventListener>::Type
   ConnectInternal(Target* aTarget, This* aThis, Method aMethod) {
     detail::RawPtr<This> thiz(aThis);
-    auto f = [=] (ArgType&& aEvent) {
-      (thiz.get()->*aMethod)(Move(aEvent));
+    auto f = [=] (ArgType<Es>&&... aEvents) {
+      (thiz.get()->*aMethod)(Move(aEvents)...);
     };
     return ConnectInternal(aTarget, f);
   }
 
   // |Method| takes no arguments. Don't bother passing the event data.
   template <typename Target, typename This, typename Method>
   typename EnableIf<!TakeArgs<Method>::value, MediaEventListener>::Type
   ConnectInternal(Target* aTarget, This* aThis, Method aMethod) {
@@ -445,59 +446,79 @@ public:
 
   template <typename This, typename Method>
   MediaEventListener
   Connect(nsIEventTarget* aTarget, This* aThis, Method aMethod) {
     return ConnectInternal(aTarget, aThis, aMethod);
   }
 
 protected:
-  MediaEventSource() : mMutex("MediaEventSource::mMutex") {}
+  MediaEventSourceImpl() : mMutex("MediaEventSourceImpl::mMutex") {}
 
-  template <typename T>
-  void NotifyInternal(T&& aEvent) {
+  template <typename... Ts>
+  void NotifyInternal(Ts&&... aEvents) {
     MutexAutoLock lock(mMutex);
     for (int32_t i = mListeners.Length() - 1; i >= 0; --i) {
       auto&& l = mListeners[i];
       // Remove disconnected listeners.
       // It is not optimal but is simple and works well.
       if (l->Token()->IsRevoked()) {
         mListeners.RemoveElementAt(i);
         continue;
       }
-      l->Dispatch(Forward<T>(aEvent));
+      l->Dispatch(Forward<Ts>(aEvents)...);
     }
   }
 
 private:
   Mutex mMutex;
   nsTArray<UniquePtr<Listener>> mListeners;
 };
 
+template <typename... Es>
+using MediaEventSource =
+  MediaEventSourceImpl<ListenerMode::NonExclusive, Es...>;
+
+template <typename... Es>
+using MediaEventSourceExc =
+  MediaEventSourceImpl<ListenerMode::Exclusive, Es...>;
+
 /**
  * A class to separate the interface of event subject (MediaEventSource)
  * and event publisher. Mostly used as a member variable to publish events
  * to the listeners.
  */
-template <typename EventType, ListenerMode Mode = ListenerMode::NonExclusive>
-class MediaEventProducer : public MediaEventSource<EventType, Mode> {
+template <typename... Es>
+class MediaEventProducer : public MediaEventSource<Es...> {
 public:
-  template <typename T>
-  void Notify(T&& aEvent) {
-    this->NotifyInternal(Forward<T>(aEvent));
+  template <typename... Ts>
+  void Notify(Ts&&... aEvents) {
+    this->NotifyInternal(Forward<Ts>(aEvents)...);
   }
 };
 
 /**
  * Specialization for void type. A dummy bool is passed to NotifyInternal
  * since there is no way to pass a void value.
  */
 template <>
 class MediaEventProducer<void> : public MediaEventSource<void> {
 public:
   void Notify() {
     this->NotifyInternal(true /* dummy */);
   }
 };
 
+/**
+ * A producer with Exclusive mode.
+ */
+template <typename... Es>
+class MediaEventProducerExc : public MediaEventSourceExc<Es...> {
+public:
+  template <typename... Ts>
+  void Notify(Ts&&... aEvents) {
+    this->NotifyInternal(Forward<Ts>(aEvents)...);
+  }
+};
+
 } // namespace mozilla
 
 #endif //MediaEventSource_h_
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -1686,17 +1686,17 @@ MediaManager::NotifyRecordingStatusChang
 
   obs->NotifyObservers(static_cast<nsIPropertyBag2*>(props),
                        "recording-device-events",
                        aMsg.get());
 
   // Forward recording events to parent process.
   // The events are gathered in chrome process and used for recording indicator
   if (!XRE_IsParentProcess()) {
-    unused <<
+    Unused <<
       dom::ContentChild::GetSingleton()->SendRecordingDeviceEvents(aMsg,
                                                                    requestURL,
                                                                    aIsAudio,
                                                                    aIsVideo);
   }
 
   return NS_OK;
 }
--- a/dom/media/MediaManager.h
+++ b/dom/media/MediaManager.h
@@ -129,17 +129,17 @@ public:
     , mStopped(false)
     , mFinished(false)
     , mRemoved(false)
     , mAudioStopped(false)
     , mVideoStopped(false) {}
 
   ~GetUserMediaCallbackMediaStreamListener()
   {
-    unused << mMediaThread;
+    Unused << mMediaThread;
     // It's OK to release mStream on any thread; they have thread-safe
     // refcounts.
   }
 
   void Activate(already_AddRefed<SourceMediaStream> aStream,
                 AudioDevice* aAudioDevice,
                 VideoDevice* aVideoDevice)
   {
--- a/dom/media/MediaMetadataManager.h
+++ b/dom/media/MediaMetadataManager.h
@@ -14,20 +14,18 @@
 #include "AbstractMediaDecoder.h"
 #include "MediaEventSource.h"
 #include "TimeUnits.h"
 #include "VideoUtils.h"
 
 namespace mozilla {
 
 class TimedMetadata;
-typedef MediaEventProducer<TimedMetadata, ListenerMode::Exclusive>
-        TimedMetadataEventProducer;
-typedef MediaEventSource<TimedMetadata, ListenerMode::Exclusive>
-        TimedMetadataEventSource;
+typedef MediaEventProducerExc<TimedMetadata> TimedMetadataEventProducer;
+typedef MediaEventSourceExc<TimedMetadata> TimedMetadataEventSource;
 
 // A struct that contains the metadata of a media, and the time at which those
 // metadata should start to be reported.
 class TimedMetadata : public LinkedListElement<TimedMetadata> {
 public:
   TimedMetadata(const media::TimeUnit& aPublishTime,
                 nsAutoPtr<MetadataTags>&& aTags,
                 nsAutoPtr<MediaInfo>&& aInfo)
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -2505,17 +2505,17 @@ ProcessedMediaStream::AllocateInputPort(
     explicit Message(MediaInputPort* aPort)
       : ControlMessage(aPort->GetDestination()),
         mPort(aPort) {}
     virtual void Run()
     {
       mPort->Init();
       // The graph holds its reference implicitly
       mPort->GraphImpl()->SetStreamOrderDirty();
-      unused << mPort.forget();
+      Unused << mPort.forget();
     }
     virtual void RunDuringShutdown()
     {
       Run();
     }
     RefPtr<MediaInputPort> mPort;
   };
 
--- a/dom/media/MediaStreamGraphImpl.h
+++ b/dom/media/MediaStreamGraphImpl.h
@@ -181,23 +181,16 @@ public:
   bool OneIteration(GraphTime aStateEnd);
 
   bool Running() const
   {
     mMonitor.AssertCurrentThreadOwns();
     return mLifecycleState == LIFECYCLE_RUNNING;
   }
 
-  // Get the message queue, from the current GraphDriver thread.
-  nsTArray<MessageBlock>& MessageQueue()
-  {
-    mMonitor.AssertCurrentThreadOwns();
-    return mFrontMessageQueue;
-  }
-
   /* This is the end of the current iteration, that is, the current time of the
    * graph. */
   GraphTime IterationEnd() const;
 
   /**
    * Ensure there is an event posted to the main thread to run RunInStableState.
    * mMonitor must be held.
    * See EnsureRunInStableState
@@ -227,39 +220,32 @@ public:
   /**
    * Process graph message for this iteration, update stream processing order,
    * and recompute stream blocking until aEndBlockingDecisions.
    */
   void UpdateGraph(GraphTime aEndBlockingDecisions);
 
   void SwapMessageQueues()
   {
+    MOZ_ASSERT(CurrentDriver()->OnThread());
+    MOZ_ASSERT(mFrontMessageQueue.IsEmpty());
     mMonitor.AssertCurrentThreadOwns();
     mFrontMessageQueue.SwapElements(mBackMessageQueue);
   }
   /**
    * Do all the processing and play the audio and video, from
    * mProcessedTime to mStateComputedTime.
    */
   void Process();
   /**
-   * Update the consumption state of aStream to reflect whether its data
-   * is needed or not.
-   */
-  void UpdateConsumptionState(SourceMediaStream* aStream);
-  /**
    * Extract any state updates pending in aStream, and apply them.
    */
   void ExtractPendingInput(SourceMediaStream* aStream,
                            GraphTime aDesiredUpToTime,
                            bool* aEnsureNextIteration);
-  /**
-   * Update "have enough data" flags in aStream.
-   */
-  void UpdateBufferSufficiencyState(SourceMediaStream* aStream);
 
   /**
    * Called when a suspend/resume/close operation has been completed, on the
    * graph thread.
    */
   void AudioContextOperationCompleted(MediaStream* aStream,
                                       void* aPromise,
                                       dom::AudioContextOperation aOperation);
@@ -596,19 +582,25 @@ public:
   /**
    * Runnables to run after the next update to main thread state.
    */
   nsTArray<nsCOMPtr<nsIRunnable> > mUpdateRunnables;
   /**
    * A list of batches of messages to process. Each batch is processed
    * as an atomic unit.
    */
-  /* Message queue processed by the MSG thread during an iteration. */
+  /*
+   * Message queue processed by the MSG thread during an iteration.
+   * Accessed on graph thread only.
+   */
   nsTArray<MessageBlock> mFrontMessageQueue;
-  /* Message queue in which the main thread appends messages. */
+  /*
+   * Message queue in which the main thread appends messages.
+   * Access guarded by mMonitor.
+   */
   nsTArray<MessageBlock> mBackMessageQueue;
 
   /* True if there will messages to process if we swap the message queues. */
   bool MessagesQueued() const
   {
     mMonitor.AssertCurrentThreadOwns();
     return !mBackMessageQueue.IsEmpty();
   }
--- a/dom/media/gmp/GMPAudioDecoderChild.cpp
+++ b/dom/media/gmp/GMPAudioDecoderChild.cpp
@@ -47,51 +47,51 @@ GMPAudioDecoderChild::Decoded(GMPAudioSa
 
   GMPAudioDecodedSampleData samples;
   samples.mData().AppendElements((int16_t*)aDecodedSamples->Buffer(),
                                  aDecodedSamples->Size() / sizeof(int16_t));
   samples.mTimeStamp() = aDecodedSamples->TimeStamp();
   samples.mChannelCount() = aDecodedSamples->Channels();
   samples.mSamplesPerSecond() = aDecodedSamples->Rate();
 
-  unused << SendDecoded(samples);
+  Unused << SendDecoded(samples);
 
   aDecodedSamples->Destroy();
 }
 
 void
 GMPAudioDecoderChild::InputDataExhausted()
 {
   MOZ_ASSERT(mPlugin->GMPMessageLoop() == MessageLoop::current());
 
-  unused << SendInputDataExhausted();
+  Unused << SendInputDataExhausted();
 }
 
 void
 GMPAudioDecoderChild::DrainComplete()
 {
   MOZ_ASSERT(mPlugin->GMPMessageLoop() == MessageLoop::current());
 
-  unused << SendDrainComplete();
+  Unused << SendDrainComplete();
 }
 
 void
 GMPAudioDecoderChild::ResetComplete()
 {
   MOZ_ASSERT(mPlugin->GMPMessageLoop() == MessageLoop::current());
 
-  unused << SendResetComplete();
+  Unused << SendResetComplete();
 }
 
 void
 GMPAudioDecoderChild::Error(GMPErr aError)
 {
   MOZ_ASSERT(mPlugin->GMPMessageLoop() == MessageLoop::current());
 
-  unused << SendError(aError);
+  Unused << SendError(aError);
 }
 
 bool
 GMPAudioDecoderChild::RecvInitDecode(const GMPAudioCodecData& a)
 {
   MOZ_ASSERT(mAudioDecoder);
   if (!mAudioDecoder) {
     return false;
@@ -158,15 +158,15 @@ GMPAudioDecoderChild::RecvDecodingComple
   if (mAudioDecoder) {
     // Ignore any return code. It is OK for this to fail without killing the process.
     mAudioDecoder->DecodingComplete();
     mAudioDecoder = nullptr;
   }
 
   mPlugin = nullptr;
 
-  unused << Send__delete__(this);
+  Unused << Send__delete__(this);
 
   return true;
 }
 
 } // namespace gmp
 } // namespace mozilla
--- a/dom/media/gmp/GMPAudioDecoderParent.cpp
+++ b/dom/media/gmp/GMPAudioDecoderParent.cpp
@@ -191,17 +191,17 @@ GMPAudioDecoderParent::Shutdown()
   // Notify client we're gone!  Won't occur after Close()
   if (mCallback) {
     mCallback->Terminated();
     mCallback = nullptr;
   }
 
   mIsOpen = false;
   if (!mActorDestroyed) {
-    unused << SendDecodingComplete();
+    Unused << SendDecodingComplete();
   }
 
   return NS_OK;
 }
 
 // Note: Keep this sync'd up with DecodingComplete
 void
 GMPAudioDecoderParent::ActorDestroy(ActorDestroyReason aWhy)
--- a/dom/media/gmp/GMPContentParent.cpp
+++ b/dom/media/gmp/GMPContentParent.cpp
@@ -90,27 +90,27 @@ GMPContentParent::AudioDecoderDestroyed(
 }
 
 void
 GMPContentParent::VideoDecoderDestroyed(GMPVideoDecoderParent* aDecoder)
 {
   MOZ_ASSERT(GMPThread() == NS_GetCurrentThread());
 
   // If the constructor fails, we'll get called before it's added
-  unused << NS_WARN_IF(!mVideoDecoders.RemoveElement(aDecoder));
+  Unused << NS_WARN_IF(!mVideoDecoders.RemoveElement(aDecoder));
   CloseIfUnused();
 }
 
 void
 GMPContentParent::VideoEncoderDestroyed(GMPVideoEncoderParent* aEncoder)
 {
   MOZ_ASSERT(GMPThread() == NS_GetCurrentThread());
 
   // If the constructor fails, we'll get called before it's added
-  unused << NS_WARN_IF(!mVideoEncoders.RemoveElement(aEncoder));
+  Unused << NS_WARN_IF(!mVideoEncoders.RemoveElement(aEncoder));
   CloseIfUnused();
 }
 
 void
 GMPContentParent::DecryptorDestroyed(GMPDecryptorParent* aSession)
 {
   MOZ_ASSERT(GMPThread() == NS_GetCurrentThread());
 
--- a/dom/media/gmp/GMPDecryptorChild.cpp
+++ b/dom/media/gmp/GMPDecryptorChild.cpp
@@ -355,17 +355,17 @@ GMPDecryptorChild::RecvDecryptingComplet
   mSession = nullptr;
 
   if (!session) {
     return false;
   }
 
   session->DecryptingComplete();
 
-  unused << Send__delete__(this);
+  Unused << Send__delete__(this);
 
   return true;
 }
 
 } // namespace gmp
 } // namespace mozilla
 
 // avoid redefined macro in unified build
--- a/dom/media/gmp/GMPDecryptorParent.cpp
+++ b/dom/media/gmp/GMPDecryptorParent.cpp
@@ -68,97 +68,97 @@ GMPDecryptorParent::CreateSession(uint32
         this, aCreateSessionToken, aPromiseId, ToBase64(aInitData).get()));
 
   if (!mIsOpen) {
     NS_WARNING("Trying to use a dead GMP decrypter!");
     return;
   }
   // Caller should ensure parameters passed in from JS are valid.
   MOZ_ASSERT(!aInitDataType.IsEmpty() && !aInitData.IsEmpty());
-  unused << SendCreateSession(aCreateSessionToken, aPromiseId, aInitDataType, aInitData, aSessionType);
+  Unused << SendCreateSession(aCreateSessionToken, aPromiseId, aInitDataType, aInitData, aSessionType);
 }
 
 void
 GMPDecryptorParent::LoadSession(uint32_t aPromiseId,
                                 const nsCString& aSessionId)
 {
   LOGD(("GMPDecryptorParent[%p]::LoadSession(sessionId='%s', promiseId=%u)",
         this, aSessionId.get(), aPromiseId));
   if (!mIsOpen) {
     NS_WARNING("Trying to use a dead GMP decrypter!");
     return;
   }
   // Caller should ensure parameters passed in from JS are valid.
   MOZ_ASSERT(!aSessionId.IsEmpty());
-  unused << SendLoadSession(aPromiseId, aSessionId);
+  Unused << SendLoadSession(aPromiseId, aSessionId);
 }
 
 void
 GMPDecryptorParent::UpdateSession(uint32_t aPromiseId,
                                   const nsCString& aSessionId,
                                   const nsTArray<uint8_t>& aResponse)
 {
   LOGD(("GMPDecryptorParent[%p]::UpdateSession(sessionId='%s', promiseId=%u response='%s')",
         this, aSessionId.get(), aPromiseId, ToBase64(aResponse).get()));
 
   if (!mIsOpen) {
     NS_WARNING("Trying to use a dead GMP decrypter!");
     return;
   }
   // Caller should ensure parameters passed in from JS are valid.
   MOZ_ASSERT(!aSessionId.IsEmpty() && !aResponse.IsEmpty());
-  unused << SendUpdateSession(aPromiseId, aSessionId, aResponse);
+  Unused << SendUpdateSession(aPromiseId, aSessionId, aResponse);
 }
 
 void
 GMPDecryptorParent::CloseSession(uint32_t aPromiseId,
                                  const nsCString& aSessionId)
 {
   LOGD(("GMPDecryptorParent[%p]::CloseSession(sessionId='%s', promiseId=%u)",
          this, aSessionId.get(), aPromiseId));
 
   if (!mIsOpen) {
     NS_WARNING("Trying to use a dead GMP decrypter!");
     return;
   }
   // Caller should ensure parameters passed in from JS are valid.
   MOZ_ASSERT(!aSessionId.IsEmpty());
-  unused << SendCloseSession(aPromiseId, aSessionId);
+  Unused << SendCloseSession(aPromiseId, aSessionId);
 }
 
 void
 GMPDecryptorParent::RemoveSession(uint32_t aPromiseId,
                                   const nsCString& aSessionId)
 {
   LOGD(("GMPDecryptorParent[%p]::RemoveSession(sessionId='%s', promiseId=%u)",
         this, aSessionId.get(), aPromiseId));
 
   if (!mIsOpen) {
     NS_WARNING("Trying to use a dead GMP decrypter!");
     return;
   }
   // Caller should ensure parameters passed in from JS are valid.
   MOZ_ASSERT(!aSessionId.IsEmpty());
-  unused << SendRemoveSession(aPromiseId, aSessionId);
+  Unused << SendRemoveSession(aPromiseId, aSessionId);
 }
 
 void
 GMPDecryptorParent::SetServerCertificate(uint32_t aPromiseId,
                                          const nsTArray<uint8_t>& aServerCert)
 {
   LOGD(("GMPDecryptorParent[%p]::SetServerCertificate(promiseId=%u)",
         this, aPromiseId));
 
   if (!mIsOpen) {
     NS_WARNING("Trying to use a dead GMP decrypter!");
     return;
   }
   // Caller should ensure parameters passed in from JS are valid.
   MOZ_ASSERT(!aServerCert.IsEmpty());
-  unused << SendSetServerCertificate(aPromiseId, aServerCert);
+  Unused << SendSetServerCertificate(aPromiseId, aServerCert);
 }
 
 void
 GMPDecryptorParent::Decrypt(uint32_t aId,
                             const CryptoSample& aCrypto,
                             const nsTArray<uint8_t>& aBuffer)
 {
   LOGV(("GMPDecryptorParent[%p]::Decrypt(id=%d)", this, aId));
@@ -172,17 +172,17 @@ GMPDecryptorParent::Decrypt(uint32_t aId
   MOZ_ASSERT(!aBuffer.IsEmpty() && aCrypto.mValid);
 
   GMPDecryptionData data(aCrypto.mKeyId,
                          aCrypto.mIV,
                          aCrypto.mPlainSizes,
                          aCrypto.mEncryptedSizes,
                          aCrypto.mSessionIds);
 
-  unused << SendDecrypt(aId, aBuffer, data);
+  Unused << SendDecrypt(aId, aBuffer, data);
 }
 
 bool
 GMPDecryptorParent::RecvSetSessionId(const uint32_t& aCreateSessionId,
                                      const nsCString& aSessionId)
 {
   LOGD(("GMPDecryptorParent[%p]::RecvSetSessionId(token=%u, sessionId='%s')",
         this, aCreateSessionId, aSessionId.get()));
@@ -408,17 +408,17 @@ GMPDecryptorParent::Shutdown()
   // Notify client we're gone!  Won't occur after Close()
   if (mCallback) {
     mCallback->Terminated();
     mCallback = nullptr;
   }
 
   mIsOpen = false;
   if (!mActorDestroyed) {
-    unused << SendDecryptingComplete();
+    Unused << SendDecryptingComplete();
   }
 }
 
 // Note: Keep this sync'd up with Shutdown
 void
 GMPDecryptorParent::ActorDestroy(ActorDestroyReason aWhy)
 {
   LOGD(("GMPDecryptorParent[%p]::ActorDestroy(reason=%d)", this, aWhy));
--- a/dom/media/gmp/GMPParent.cpp
+++ b/dom/media/gmp/GMPParent.cpp
@@ -117,17 +117,17 @@ GMPParent::Init(GeckoMediaPluginServiceP
 
   return ReadGMPMetaData();
 }
 
 void
 GMPParent::Crash()
 {
   if (mState != GMPStateNotLoaded) {
-    unused << SendCrashPluginNow();
+    Unused << SendCrashPluginNow();
   }
 }
 
 nsresult
 GMPParent::LoadProcess()
 {
   MOZ_ASSERT(mDirectory, "Plugin directory cannot be NULL!");
   MOZ_ASSERT(GMPThread() == NS_GetCurrentThread());
@@ -228,17 +228,17 @@ GMPParent::EnsureAsyncShutdownTimeoutSet
   RefPtr<GeckoMediaPluginServiceParent> service =
     GeckoMediaPluginServiceParent::GetSingleton();
   if (service) {
     timeout = service->AsyncShutdownTimeoutMs();
   }
   rv = mAsyncShutdownTimeout->InitWithFuncCallback(
     &AbortWaitingForGMPAsyncShutdown, this, timeout,
     nsITimer::TYPE_ONE_SHOT);
-  unused << NS_WARN_IF(NS_FAILED(rv));
+  Unused << NS_WARN_IF(NS_FAILED(rv));
   return rv;
 }
 
 bool
 GMPParent::RecvPGMPContentChildDestroyed()
 {
   --mGMPContentChildCount;
   if (!IsUsed()) {
--- a/dom/media/gmp/GMPStorageParent.cpp
+++ b/dom/media/gmp/GMPStorageParent.cpp
@@ -615,39 +615,39 @@ GMPStorageParent::RecvOpen(const nsCStri
     return false;
   }
 
   if (mNodeId.EqualsLiteral("null")) {
     // Refuse to open storage if the page is opened from local disk,
     // or shared across origin.
     LOGD(("GMPStorageParent[%p]::RecvOpen(record='%s') failed; null nodeId",
           this, aRecordName.get()));
-    unused << SendOpenComplete(aRecordName, GMPGenericErr);
+    Unused << SendOpenComplete(aRecordName, GMPGenericErr);
     return true;
   }
 
   if (aRecordName.IsEmpty()) {
     LOGD(("GMPStorageParent[%p]::RecvOpen(record='%s') failed; record name empty",
           this, aRecordName.get()));
-    unused << SendOpenComplete(aRecordName, GMPGenericErr);
+    Unused << SendOpenComplete(aRecordName, GMPGenericErr);
     return true;
   }
 
   if (mStorage->IsOpen(aRecordName)) {
     LOGD(("GMPStorageParent[%p]::RecvOpen(record='%s') failed; record in use",
           this, aRecordName.get()));
-    unused << SendOpenComplete(aRecordName, GMPRecordInUse);
+    Unused << SendOpenComplete(aRecordName, GMPRecordInUse);
     return true;
   }
 
   auto err = mStorage->Open(aRecordName);
   MOZ_ASSERT(GMP_FAILED(err) || mStorage->IsOpen(aRecordName));
   LOGD(("GMPStorageParent[%p]::RecvOpen(record='%s') complete; rv=%d",
         this, aRecordName.get(), err));
-  unused << SendOpenComplete(aRecordName, err);
+  Unused << SendOpenComplete(aRecordName, err);
 
   return true;
 }
 
 bool
 GMPStorageParent::RecvRead(const nsCString& aRecordName)
 {
   LOGD(("GMPStorageParent[%p]::RecvRead(record='%s')",
@@ -656,22 +656,22 @@ GMPStorageParent::RecvRead(const nsCStri
   if (mShutdown) {
     return false;
   }
 
   nsTArray<uint8_t> data;
   if (!mStorage->IsOpen(aRecordName)) {
     LOGD(("GMPStorageParent[%p]::RecvRead(record='%s') failed; record not open",
          this, aRecordName.get()));
-    unused << SendReadComplete(aRecordName, GMPClosedErr, data);
+    Unused << SendReadComplete(aRecordName, GMPClosedErr, data);
   } else {
     GMPErr rv = mStorage->Read(aRecordName, data);
     LOGD(("GMPStorageParent[%p]::RecvRead(record='%s') read %d bytes rv=%d",
       this, aRecordName.get(), data.Length(), rv));
-    unused << SendReadComplete(aRecordName, rv, data);
+    Unused << SendReadComplete(aRecordName, rv, data);
   }
 
   return true;
 }
 
 bool
 GMPStorageParent::RecvWrite(const nsCString& aRecordName,
                             InfallibleTArray<uint8_t>&& aBytes)
@@ -681,32 +681,32 @@ GMPStorageParent::RecvWrite(const nsCStr
 
   if (mShutdown) {
     return false;
   }
 
   if (!mStorage->IsOpen(aRecordName)) {
     LOGD(("GMPStorageParent[%p]::RecvWrite(record='%s') failed record not open",
           this, aRecordName.get()));
-    unused << SendWriteComplete(aRecordName, GMPClosedErr);
+    Unused << SendWriteComplete(aRecordName, GMPClosedErr);
     return true;
   }
 
   if (aBytes.Length() > GMP_MAX_RECORD_SIZE) {
     LOGD(("GMPStorageParent[%p]::RecvWrite(record='%s') failed record too big",
           this, aRecordName.get()));
-    unused << SendWriteComplete(aRecordName, GMPQuotaExceededErr);
+    Unused << SendWriteComplete(aRecordName, GMPQuotaExceededErr);
     return true;
   }
 
   GMPErr rv = mStorage->Write(aRecordName, aBytes);
   LOGD(("GMPStorageParent[%p]::RecvWrite(record='%s') write complete rv=%d",
         this, aRecordName.get(), rv));
 
-  unused << SendWriteComplete(aRecordName, rv);
+  Unused << SendWriteComplete(aRecordName, rv);
 
   return true;
 }
 
 bool
 GMPStorageParent::RecvGetRecordNames()
 {
   if (mShutdown) {
@@ -714,17 +714,17 @@ GMPStorageParent::RecvGetRecordNames()
   }
 
   nsTArray<nsCString> recordNames;
   GMPErr status = mStorage->GetRecordNames(recordNames);
 
   LOGD(("GMPStorageParent[%p]::RecvGetRecordNames() status=%d numRecords=%d",
         this, status, recordNames.Length()));
 
-  unused << SendRecordNames(recordNames, status);
+  Unused << SendRecordNames(recordNames, status);
 
   return true;
 }
 
 bool
 GMPStorageParent::RecvClose(const nsCString& aRecordName)
 {
   LOGD(("GMPStorageParent[%p]::RecvClose(record='%s')",
@@ -750,16 +750,16 @@ void
 GMPStorageParent::Shutdown()
 {
   LOGD(("GMPStorageParent[%p]::Shutdown()", this));
 
   if (mShutdown) {
     return;
   }
   mShutdown = true;
-  unused << SendShutdown();
+  Unused << SendShutdown();
 
   mStorage = nullptr;
 
 }
 
 } // namespace gmp
 } // namespace mozilla
--- a/dom/media/gmp/GMPTimerParent.cpp
+++ b/dom/media/gmp/GMPTimerParent.cpp
@@ -109,14 +109,14 @@ GMPTimerParent::TimerExpired(Context* aC
 
   if (!mIsOpen) {
     return;
   }
 
   uint32_t id = aContext->mId;
   mTimers.RemoveEntry(aContext);
   if (id) {
-    unused << SendTimerExpired(id);
+    Unused << SendTimerExpired(id);
   }
 }
 
 } // namespace gmp
 } // namespace mozilla
--- a/dom/media/gmp/GMPVideoDecoderChild.cpp
+++ b/dom/media/gmp/GMPVideoDecoderChild.cpp
@@ -203,17 +203,17 @@ GMPVideoDecoderChild::RecvDecodingComple
     mVideoDecoder->DecodingComplete();
     mVideoDecoder = nullptr;
   }
 
   mVideoHost.DoneWithAPI();
 
   mPlugin = nullptr;
 
-  unused << Send__delete__(this);
+  Unused << Send__delete__(this);
 
   return true;
 }
 
 bool
 GMPVideoDecoderChild::Alloc(size_t aSize,
                             Shmem::SharedMemory::SharedMemoryType aType,
                             Shmem* aMem)
--- a/dom/media/gmp/GMPVideoDecoderParent.cpp
+++ b/dom/media/gmp/GMPVideoDecoderParent.cpp
@@ -259,17 +259,17 @@ GMPVideoDecoderParent::Shutdown()
   // Notify client we're gone!  Won't occur after Close()
   if (mCallback) {
     mCallback->Terminated();
     mCallback = nullptr;
   }
 
   mIsOpen = false;
   if (!mActorDestroyed) {
-    unused << SendDecodingComplete();
+    Unused << SendDecodingComplete();
   }
 
   return NS_OK;
 }
 
 // Note: Keep this sync'd up with Shutdown
 void
 GMPVideoDecoderParent::ActorDestroy(ActorDestroyReason aWhy)
--- a/dom/media/gmp/GMPVideoEncoderChild.cpp
+++ b/dom/media/gmp/GMPVideoEncoderChild.cpp
@@ -173,28 +173,28 @@ GMPVideoEncoderChild::RecvEncodingComple
     // return a frame they can use. Don't call the GMP's EncodingComplete()
     // now and don't delete the GMPVideoEncoderChild, defer processing the
     // EncodingComplete() until once the Alloc() finishes.
     mPendingEncodeComplete = true;
     return true;
   }
 
   if (!mVideoEncoder) {
-    unused << Send__delete__(this);
+    Unused << Send__delete__(this);
     return false;
   }
 
   // Ignore any return code. It is OK for this to fail without killing the process.
   mVideoEncoder->EncodingComplete();
 
   mVideoHost.DoneWithAPI();
 
   mPlugin = nullptr;
 
-  unused << Send__delete__(this);
+  Unused << Send__delete__(this);
 
   return true;
 }
 
 bool
 GMPVideoEncoderChild::Alloc(size_t aSize,
                             Shmem::SharedMemory::SharedMemoryType aType,
                             Shmem* aMem)
--- a/dom/media/gmp/GMPVideoEncoderParent.cpp
+++ b/dom/media/gmp/GMPVideoEncoderParent.cpp
@@ -228,17 +228,17 @@ GMPVideoEncoderParent::Shutdown()
   if (mCallback) {
     mCallback->Terminated();
     mCallback = nullptr;
   }
   mVideoHost.DoneWithAPI();
 
   mIsOpen = false;
   if (!mActorDestroyed) {
-    unused << SendEncodingComplete();
+    Unused << SendEncodingComplete();
   }
 }
 
 static void
 ShutdownEncodedThread(nsCOMPtr<nsIThread>& aThread)
 {
   aThread->Shutdown();
 }
--- a/dom/media/gstreamer/GStreamerReader.cpp
+++ b/dom/media/gstreamer/GStreamerReader.cpp
@@ -947,17 +947,17 @@ media::TimeIntervals GStreamerReader::Ge
   }
 
   return buffered;
 }
 
 void GStreamerReader::ReadAndPushData(guint aLength)
 {
   int64_t offset1 = mResource.Tell();
-  unused << offset1;
+  Unused << offset1;
   nsresult rv = NS_OK;
 
   GstBuffer* buffer = gst_buffer_new_and_alloc(aLength);
 #if GST_VERSION_MAJOR >= 1
   GstMapInfo info;
   gst_buffer_map(buffer, &info, GST_MAP_WRITE);
   guint8 *data = info.data;
 #else
@@ -969,17 +969,17 @@ void GStreamerReader::ReadAndPushData(gu
                         aLength - bytesRead, &size);
     if (NS_FAILED(rv) || size == 0)
       break;
 
     bytesRead += size;
   }
 
   int64_t offset2 = mResource.Tell();
-  unused << offset2;
+  Unused << offset2;
 
 #if GST_VERSION_MAJOR >= 1
   gst_buffer_unmap(buffer, &info);
   gst_buffer_set_size(buffer, bytesRead);
 #else
   GST_BUFFER_SIZE(buffer) = bytesRead;
 #endif
 
--- a/dom/media/gtest/TestMediaEventSource.cpp
+++ b/dom/media/gtest/TestMediaEventSource.cpp
@@ -299,17 +299,17 @@ TEST(MediaEventSource, CopyEvent2)
 /*
  * Test move-only types.
  */
 TEST(MediaEventSource, MoveOnly)
 {
   RefPtr<TaskQueue> queue = new TaskQueue(
     GetMediaThreadPool(MediaThreadType::PLAYBACK));
 
-  MediaEventProducer<UniquePtr<int>, ListenerMode::Exclusive> source;
+  MediaEventProducerExc<UniquePtr<int>> source;
 
   auto func = [] (UniquePtr<int>&& aEvent) {
     EXPECT_EQ(*aEvent, 20);
   };
   MediaEventListener listener = source.Connect(queue, func);
 
   // It is OK to pass an rvalue which is move-only.
   source.Notify(UniquePtr<int>(new int(20)));
--- a/dom/media/gtest/TestMediaFormatReader.cpp
+++ b/dom/media/gtest/TestMediaFormatReader.cpp
@@ -148,17 +148,17 @@ bool GetPref<bool>(const char* aPrefKey)
 }
 
 template <typename T>
 void SetPref(const char* a, T value);
 
 template <>
 void SetPref<bool>(const char* aPrefKey, bool aValue)
 {
-  unused << Preferences::SetBool(aPrefKey, aValue);
+  Unused << Preferences::SetBool(aPrefKey, aValue);
 }
 
 template <typename T>
 class PreferencesRAII
 {
 public:
   explicit PreferencesRAII(const char* aPrefKey, T aValue)
   : mPrefKey(aPrefKey)
@@ -237,9 +237,9 @@ TEST(MediaFormatReader, RequestVideoRawD
                 b->mReader.get(),
                 __func__,
                 &MediaDecoderReader::AsyncReadMetadata)
       ->Then(b->mReader->OwnerThread(), __func__, b.get(),
              &MediaFormatReaderBinding::OnMetadataReadVideo,
              &MediaFormatReaderBinding::OnMetadataNotRead);
   };
   b->RunTestAndWait(testCase);
-}
\ No newline at end of file
+}
--- a/dom/media/ogg/OggReader.cpp
+++ b/dom/media/ogg/OggReader.cpp
@@ -1011,17 +1011,17 @@ struct nsAutoOggSyncState {
   ~nsAutoOggSyncState() {
     ogg_sync_clear(&mState);
   }
   ogg_sync_state mState;
 };
 
 int64_t OggReader::RangeEndTime(int64_t aEndOffset)
 {
-  MOZ_ASSERT(OnTaskQueue() || mDecoder->OnStateMachineTaskQueue());
+  MOZ_ASSERT(OnTaskQueue());
 
   int64_t position = mResource.Tell();
   int64_t endTime = RangeEndTime(0, aEndOffset, false);
   nsresult res = mResource.Seek(nsISeekableStream::NS_SEEK_SET, position);
   NS_ENSURE_SUCCESS(res, -1);
   return endTime;
 }
 
@@ -1929,17 +1929,17 @@ media::TimeIntervals OggReader::GetBuffe
   }
 
   return buffered;
 #endif
 }
 
 VideoData* OggReader::FindStartTime(int64_t& aOutStartTime)
 {
-  MOZ_ASSERT(OnTaskQueue() || mDecoder->OnStateMachineTaskQueue());
+  MOZ_ASSERT(OnTaskQueue());
 
   // Extract the start times of the bitstreams in order to calculate
   // the duration.
   int64_t videoStartTime = INT64_MAX;
   int64_t audioStartTime = INT64_MAX;
   VideoData* videoData = nullptr;
 
   if (HasVideo()) {
--- a/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp
+++ b/dom/media/platforms/agnostic/eme/EMEDecoderModule.cpp
@@ -87,53 +87,53 @@ public:
       Input(aDecrypted.mSample);
     } else if (GMP_FAILED(aDecrypted.mStatus)) {
       if (mCallback) {
         mCallback->Error();
       }
     } else {
       MOZ_ASSERT(!mIsShutdown);
       nsresult rv = mDecoder->Input(aDecrypted.mSample);
-      unused << NS_WARN_IF(NS_FAILED(rv));
+      Unused << NS_WARN_IF(NS_FAILED(rv));
     }
   }
 
   nsresult Flush() override {
     MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
     MOZ_ASSERT(!mIsShutdown);
     for (auto iter = mDecrypts.Iter(); !iter.Done(); iter.Next()) {
       nsAutoPtr<DecryptPromiseRequestHolder>& holder = iter.Data();
       holder->DisconnectIfExists();
       iter.Remove();
     }
     nsresult rv = mDecoder->Flush();
-    unused << NS_WARN_IF(NS_FAILED(rv));
+    Unused << NS_WARN_IF(NS_FAILED(rv));
     mSamplesWaitingForKey->Flush();
     return rv;
   }
 
   nsresult Drain() override {
     MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
     MOZ_ASSERT(!mIsShutdown);
     for (auto iter = mDecrypts.Iter(); !iter.Done(); iter.Next()) {
       nsAutoPtr<DecryptPromiseRequestHolder>& holder = iter.Data();
       holder->DisconnectIfExists();
       iter.Remove();
     }
     nsresult rv = mDecoder->Drain();
-    unused << NS_WARN_IF(NS_FAILED(rv));
+    Unused << NS_WARN_IF(NS_FAILED(rv));
     return rv;
   }
 
   nsresult Shutdown() override {
     MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
     MOZ_ASSERT(!mIsShutdown);
     mIsShutdown = true;
     nsresult rv = mDecoder->Shutdown();
-    unused << NS_WARN_IF(NS_FAILED(rv));
+    Unused << NS_WARN_IF(NS_FAILED(rv));
     mSamplesWaitingForKey->BreakCycles();
     mSamplesWaitingForKey = nullptr;
     mDecoder = nullptr;
     mProxy = nullptr;
     mCallback = nullptr;
     return rv;
   }
 
--- a/dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegH264Decoder.cpp
@@ -11,24 +11,61 @@
 #include "ImageContainer.h"
 
 #include "MediaInfo.h"
 
 #include "FFmpegH264Decoder.h"
 #include "FFmpegLog.h"
 #include "mozilla/PodOperations.h"
 
-#define GECKO_FRAME_TYPE 0x00093CC0
-
 typedef mozilla::layers::Image Image;
 typedef mozilla::layers::PlanarYCbCrImage PlanarYCbCrImage;
 
 namespace mozilla
 {
 
+FFmpegH264Decoder<LIBAV_VER>::PtsCorrectionContext::PtsCorrectionContext()
+  : mNumFaultyPts(0)
+  , mNumFaultyDts(0)
+  , mLastPts(INT64_MIN)
+  , mLastDts(INT64_MIN)
+{
+}
+
+int64_t
+FFmpegH264Decoder<LIBAV_VER>::PtsCorrectionContext::GuessCorrectPts(int64_t aPts, int64_t aDts)
+{
+  int64_t pts = AV_NOPTS_VALUE;
+
+  if (aDts != int64_t(AV_NOPTS_VALUE)) {
+    mNumFaultyDts += aDts <= mLastDts;
+    mLastDts = aDts;
+  }
+  if (aPts != int64_t(AV_NOPTS_VALUE)) {
+    mNumFaultyPts += aPts <= mLastPts;
+    mLastPts = aPts;
+  }
+  if ((mNumFaultyPts <= mNumFaultyDts || aDts == int64_t(AV_NOPTS_VALUE)) &&
+      aPts != int64_t(AV_NOPTS_VALUE)) {
+    pts = aPts;
+  } else {
+    pts = aDts;
+  }
+  return pts;
+}
+
+void
+FFmpegH264Decoder<LIBAV_VER>::PtsCorrectionContext::Reset()
+{
+  mNumFaultyPts = 0;
+  mNumFaultyDts = 0;
+  mLastPts = INT64_MIN;
+  mLastDts = INT64_MIN;
+}
+
 FFmpegH264Decoder<LIBAV_VER>::FFmpegH264Decoder(
   FlushableTaskQueue* aTaskQueue, MediaDataDecoderCallback* aCallback,
   const VideoInfo& aConfig,
   ImageContainer* aImageContainer)
   : FFmpegDataDecoder(aTaskQueue, aCallback, GetCodecId(aConfig.mMimeType))
   , mImageContainer(aImageContainer)
   , mPictureWidth(aConfig.mImage.width)
   , mPictureHeight(aConfig.mImage.height)
@@ -51,31 +88,16 @@ FFmpegH264Decoder<LIBAV_VER>::Init()
   mCodecContext->get_buffer = AllocateBufferCb;
   mCodecContext->release_buffer = ReleaseBufferCb;
   mCodecContext->width = mPictureWidth;
   mCodecContext->height = mPictureHeight;
 
   return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__);
 }
 
-int64_t
-FFmpegH264Decoder<LIBAV_VER>::GetPts(const AVPacket& packet)
-{
-  MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
-#if LIBAVCODEC_VERSION_MAJOR == 53
-  if (mFrame->pkt_pts == 0) {
-    return mFrame->pkt_dts;
-  } else {
-    return mFrame->pkt_pts;
-  }
-#else
-  return mFrame->pkt_pts;
-#endif
-}
-
 FFmpegH264Decoder<LIBAV_VER>::DecodeResult
 FFmpegH264Decoder<LIBAV_VER>::DoDecodeFrame(MediaRawData* aSample)
 {
   MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
 
   uint8_t* inputData = const_cast<uint8_t*>(aSample->Data());
   size_t inputSize = aSample->Size();
 
@@ -128,16 +150,23 @@ FFmpegH264Decoder<LIBAV_VER>::DoDecodeFr
 
   packet.data = aData;
   packet.size = aSize;
   packet.dts = aSample->mTimecode;
   packet.pts = aSample->mTime;
   packet.flags = aSample->mKeyframe ? AV_PKT_FLAG_KEY : 0;
   packet.pos = aSample->mOffset;
 
+  // LibAV provides no API to retrieve the decoded sample's duration.
+  // (FFmpeg >= 1.0 provides av_frame_get_pkt_duration)
+  // As such we instead use a map using the dts as key that we will retrieve
+  // later.
+  // The map will have a typical size of 16 entry.
+  mDurationMap.Insert(aSample->mTimecode, aSample->mDuration);
+
   if (!PrepareFrame()) {
     NS_WARNING("FFmpeg h264 decoder failed to allocate frame.");
     mCallback->Error();
     return DecodeResult::DECODE_ERROR;
   }
 
   // Required with old version of FFmpeg/LibAV
   mFrame->reordered_opaque = AV_NOPTS_VALUE;
@@ -155,19 +184,32 @@ FFmpegH264Decoder<LIBAV_VER>::DoDecodeFr
   if (bytesConsumed < 0) {
     NS_WARNING("FFmpeg video decoder error.");
     mCallback->Error();
     return DecodeResult::DECODE_ERROR;
   }
 
   // If we've decoded a frame then we need to output it
   if (decoded) {
-    int64_t pts = GetPts(packet);
+    int64_t pts = mPtsContext.GuessCorrectPts(mFrame->pkt_pts, mFrame->pkt_dts);
     FFMPEG_LOG("Got one frame output with pts=%lld opaque=%lld",
                pts, mCodecContext->reordered_opaque);
+    // Retrieve duration from dts.
+    // We use the first entry found matching this dts (this is done to
+    // handle damaged file with multiple frames with the same dts)
+
+    int64_t duration;
+    if (!mDurationMap.Find(mFrame->pkt_dts, duration)) {
+      NS_WARNING("Unable to retrieve duration from map");
+      duration = aSample->mDuration;
+      // dts are probably incorrectly reported ; so clear the map as we're
+      // unlikely to find them in the future anyway. This also guards
+      // against the map becoming extremely big.
+      mDurationMap.Clear();
+    }
 
     VideoInfo info;
     info.mDisplay = nsIntSize(mDisplayWidth, mDisplayHeight);
 
     VideoData::YCbCrBuffer b;
     b.mPlanes[0].mData = mFrame->data[0];
     b.mPlanes[0].mStride = mFrame->linesize[0];
     b.mPlanes[0].mHeight = mFrame->height;
@@ -185,19 +227,19 @@ FFmpegH264Decoder<LIBAV_VER>::DoDecodeFr
     b.mPlanes[2].mHeight = (mFrame->height + 1) >> 1;
     b.mPlanes[2].mWidth = (mFrame->width + 1) >> 1;
     b.mPlanes[2].mOffset = b.mPlanes[2].mSkip = 0;
 
     RefPtr<VideoData> v = VideoData::Create(info,
                                               mImageContainer,
                                               aSample->mOffset,
                                               pts,
-                                              aSample->mDuration,
+                                              duration,
                                               b,
-                                              aSample->mKeyframe,
+                                              !!mFrame->key_frame,
                                               -1,
                                               gfx::IntRect(0, 0, mCodecContext->width, mCodecContext->height));
     if (!v) {
       NS_WARNING("image allocation error.");
       mCallback->Error();
       return DecodeResult::DECODE_ERROR;
     }
     mCallback->Output(v);
@@ -312,25 +354,29 @@ FFmpegH264Decoder<LIBAV_VER>::AllocateYU
     edgeWidth * aFrame->linesize[0] + edgeWidth,
     edgeWidth / 2 * aFrame->linesize[1] + edgeWidth / 2,
     edgeWidth / 2 * aFrame->linesize[2] + edgeWidth / 2 };
 
   for (uint32_t i = 0; i < 3; i++) {
     aFrame->data[i] = buffer + offsets[i] + planesEdgeWidth[i];
   }
 
-  // Unused, but needs to be non-zero to keep ffmpeg happy.
-  aFrame->type = GECKO_FRAME_TYPE;
-
   aFrame->extended_data = aFrame->data;
   aFrame->width = aCodecContext->width;
   aFrame->height = aCodecContext->height;
 
   aFrame->opaque = static_cast<void*>(image.forget().take());
 
+  aFrame->type = FF_BUFFER_TYPE_USER;
+  aFrame->reordered_opaque = aCodecContext->reordered_opaque;
+#if LIBAVCODEC_VERSION_MAJOR == 53
+  if (aCodecContext->pkt) {
+    aFrame->pkt_pts = aCodecContext->pkt->pts;
+  }
+#endif
   return 0;
 }
 
 nsresult
 FFmpegH264Decoder<LIBAV_VER>::Input(MediaRawData* aSample)
 {
   nsCOMPtr<nsIRunnable> runnable(
     NS_NewRunnableMethodWithArg<RefPtr<MediaRawData>>(
@@ -346,16 +392,24 @@ FFmpegH264Decoder<LIBAV_VER>::ProcessDra
 {
   MOZ_ASSERT(mTaskQueue->IsCurrentThreadIn());
   RefPtr<MediaRawData> empty(new MediaRawData());
   while (DoDecodeFrame(empty) == DecodeResult::DECODE_FRAME) {
   }
   mCallback->DrainComplete();
 }
 
+void
+FFmpegH264Decoder<LIBAV_VER>::ProcessFlush()
+{
+  mPtsContext.Reset();
+  mDurationMap.Clear();
+  FFmpegDataDecoder::ProcessFlush();
+}
+
 FFmpegH264Decoder<LIBAV_VER>::~FFmpegH264Decoder()
 {
   MOZ_COUNT_DTOR(FFmpegH264Decoder);
 }
 
 AVCodecID
 FFmpegH264Decoder<LIBAV_VER>::GetCodecId(const nsACString& aMimeType)
 {
--- a/dom/media/platforms/ffmpeg/FFmpegH264Decoder.h
+++ b/dom/media/platforms/ffmpeg/FFmpegH264Decoder.h
@@ -3,16 +3,18 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef __FFmpegH264Decoder_h__
 #define __FFmpegH264Decoder_h__
 
 #include "FFmpegDataDecoder.h"
+#include "mozilla/Pair.h"
+#include "nsTArray.h"
 
 namespace mozilla
 {
 
 template <int V>
 class FFmpegH264Decoder : public FFmpegDataDecoder<V>
 {
 };
@@ -34,16 +36,17 @@ public:
                     MediaDataDecoderCallback* aCallback,
                     const VideoInfo& aConfig,
                     ImageContainer* aImageContainer);
   virtual ~FFmpegH264Decoder();
 
   RefPtr<InitPromise> Init() override;
   nsresult Input(MediaRawData* aSample) override;
   void ProcessDrain() override;
+  void ProcessFlush() override;
   static AVCodecID GetCodecId(const nsACString& aMimeType);
 
 private:
   void DecodeFrame(MediaRawData* aSample);
   DecodeResult DoDecodeFrame(MediaRawData* aSample);
   DecodeResult DoDecodeFrame(MediaRawData* aSample, uint8_t* aData, int aSize);
   void DoDrain();
   void OutputDelayedFrames();
@@ -54,20 +57,70 @@ private:
    * non-hardware accelerated image format that FFmpeg's H264 decoder is
    * capable of outputting.
    */
   int AllocateYUV420PVideoBuffer(AVCodecContext* aCodecContext,
                                  AVFrame* aFrame);
 
   static int AllocateBufferCb(AVCodecContext* aCodecContext, AVFrame* aFrame);
   static void ReleaseBufferCb(AVCodecContext* aCodecContext, AVFrame* aFrame);
-  int64_t GetPts(const AVPacket& packet);
 
   RefPtr<ImageContainer> mImageContainer;
   uint32_t mPictureWidth;
   uint32_t mPictureHeight;
   uint32_t mDisplayWidth;
   uint32_t mDisplayHeight;
+
+  class PtsCorrectionContext {
+  public:
+    PtsCorrectionContext();
+    int64_t GuessCorrectPts(int64_t aPts, int64_t aDts);
+    void Reset();
+
+  private:
+    int64_t mNumFaultyPts; /// Number of incorrect PTS values so far
+    int64_t mNumFaultyDts; /// Number of incorrect DTS values so far
+    int64_t mLastPts;       /// PTS of the last frame
+    int64_t mLastDts;       /// DTS of the last frame
+  };
+
+  PtsCorrectionContext mPtsContext;
+
+  class DurationMap {
+  public:
+    typedef Pair<int64_t, int64_t> DurationElement;
+
+    // Insert Dts and Duration pair at the end of our map.
+    void Insert(int64_t aDts, int64_t aDuration)
+    {
+      mMap.AppendElement(MakePair(aDts, aDuration));
+    }
+    // Sets aDuration matching aDts and remove it from the map if found.
+    // The element returned is the first one found.
+    // Returns true if found, false otherwise.
+    bool Find(int64_t aDts, int64_t& aDuration)
+    {
+      for (uint32_t i = 0; i < mMap.Length(); i++) {
+        DurationElement& element = mMap[i];
+        if (element.first() == aDts) {
+          aDuration = element.second();
+          mMap.RemoveElementAt(i);
+          return true;
+        }
+      }
+      return false;
+    }
+    // Remove all elements of the map.
+    void Clear()
+    {
+      mMap.Clear();
+    }
+
+  private:
+    nsAutoTArray<DurationElement, 16> mMap;
+  };
+
+  DurationMap mDurationMap;
 };
 
 } // namespace mozilla
 
 #endif // __FFmpegH264Decoder_h__
--- a/dom/media/raw/RawReader.cpp
+++ b/dom/media/raw/RawReader.cpp
@@ -105,17 +105,17 @@ bool
 RawReader::IsMediaSeekable()
 {
   // not used
   return true;
 }
 
  bool RawReader::DecodeAudioData()
 {
-  MOZ_ASSERT(OnTaskQueue() || mDecoder->OnStateMachineTaskQueue());
+  MOZ_ASSERT(OnTaskQueue());
   return false;
 }
 
 // Helper method that either reads until it gets aLength bytes
 // or returns false
 bool RawReader::ReadFromResource(uint8_t* aBuf, uint32_t aLength)
 {
   uint32_t bytesRead = 0;
--- a/dom/media/systemservices/CamerasChild.cpp
+++ b/dom/media/systemservices/CamerasChild.cpp
@@ -625,17 +625,17 @@ CamerasChild::Shutdown()
   OffTheBooksMutexAutoLock lock(CamerasSingleton::Mutex());
   if (CamerasSingleton::Thread()) {
     LOG(("Dispatching actor deletion"));
     // Delete the parent actor.
     RefPtr<nsRunnable> deleteRunnable =
       // CamerasChild (this) will remain alive and is only deleted by the
       // IPC layer when SendAllDone returns.
       media::NewRunnableFrom([this]() -> nsresult {
-        unused << this->SendAllDone();
+        Unused << this->SendAllDone();
         return NS_OK;
       });
     CamerasSingleton::Thread()->Dispatch(deleteRunnable, NS_DISPATCH_NORMAL);
     LOG(("PBackground thread exists, dispatching close"));
     // Dispatch closing the IPC thread back to us when the
     // BackgroundChild is closed.
     RefPtr<nsRunnable> event =
       new ThreadDestructor(CamerasSingleton::Thread());
--- a/dom/media/systemservices/CamerasParent.cpp
+++ b/dom/media/systemservices/CamerasParent.cpp
@@ -400,17 +400,17 @@ CamerasParent::CloseEngines()
   MOZ_ASSERT(mVideoCaptureThread->thread_id() == PlatformThread::CurrentId());
 
   // Stop the callers
   while (mCallbacks.Length()) {
     auto capEngine = mCallbacks[0]->mCapEngine;
     auto capNum = mCallbacks[0]->mCapturerId;
     LOG(("Forcing shutdown of engine %d, capturer %d", capEngine, capNum));
     StopCapture(capEngine, capNum);
-    unused << ReleaseCaptureDevice(capEngine, capNum);
+    Unused << ReleaseCaptureDevice(capEngine, capNum);
   }
 
   for (int i = 0; i < CaptureEngine::MaxEngine; i++) {
     if (mEngines[i].mEngineIsRunning) {
       LOG(("Being closed down while engine %d is running!", i));
     }
     if (mEngines[i].mPtrViERender) {
       mEngines[i].mPtrViERender->Release();
@@ -470,21 +470,21 @@ CamerasParent::RecvNumberOfCaptureDevice
       }
       RefPtr<nsIRunnable> ipc_runnable =
         media::NewRunnableFrom([self, num]() -> nsresult {
           if (self->IsShuttingDown()) {
             return NS_ERROR_FAILURE;
           }
           if (num < 0) {
             LOG(("RecvNumberOfCaptureDevices couldn't find devices"));
-            unused << self->SendReplyFailure();
+            Unused << self->SendReplyFailure();
             return NS_ERROR_FAILURE;
           } else {
             LOG(("RecvNumberOfCaptureDevices: %d", num));
-            unused << self->SendReplyNumberOfCaptureDevices(num);
+            Unused << self->SendReplyNumberOfCaptureDevices(num);
             return NS_OK;
           }
         });
         self->mPBackgroundThread->Dispatch(ipc_runnable, NS_DISPATCH_NORMAL);
       return NS_OK;
     });
   DispatchToVideoCaptureThread(webrtc_runnable);
   return true;
@@ -509,22 +509,22 @@ CamerasParent::RecvNumberOfCapabilities(
       }
       RefPtr<nsIRunnable> ipc_runnable =
         media::NewRunnableFrom([self, num]() -> nsresult {
           if (self->IsShuttingDown()) {
             return NS_ERROR_FAILURE;
           }
           if (num < 0) {
             LOG(("RecvNumberOfCapabilities couldn't find capabilities"));
-            unused << self->SendReplyFailure();
+            Unused << self->SendReplyFailure();
             return NS_ERROR_FAILURE;
           } else {
             LOG(("RecvNumberOfCapabilities: %d", num));
           }
-          unused << self->SendReplyNumberOfCapabilities(num);
+          Unused << self->SendReplyNumberOfCapabilities(num);
           return NS_OK;
         });
       self->mPBackgroundThread->Dispatch(ipc_runnable, NS_DISPATCH_NORMAL);
       return NS_OK;
     });
   DispatchToVideoCaptureThread(webrtc_runnable);
   return true;
 }
@@ -561,20 +561,20 @@ CamerasParent::RecvGetCaptureCapability(
           LOG(("Capability: %u %u %u %u %d %d",
                webrtcCaps.width,
                webrtcCaps.height,
                webrtcCaps.maxFPS,
                webrtcCaps.expectedCaptureDelay,
                webrtcCaps.rawType,
                webrtcCaps.codecType));
           if (error) {
-            unused << self->SendReplyFailure();
+            Unused << self->SendReplyFailure();
             return NS_ERROR_FAILURE;
           }
-          unused << self->SendReplyGetCaptureCapability(capCap);
+          Unused << self->SendReplyGetCaptureCapability(capCap);
           return NS_OK;
         });
       self->mPBackgroundThread->Dispatch(ipc_runnable, NS_DISPATCH_NORMAL);
       return NS_OK;
     });
   DispatchToVideoCaptureThread(webrtc_runnable);
   return true;
 }
@@ -606,22 +606,22 @@ CamerasParent::RecvGetCaptureDevice(cons
       }
       RefPtr<nsIRunnable> ipc_runnable =
         media::NewRunnableFrom([self, error, name, uniqueId]() -> nsresult {
           if (self->IsShuttingDown()) {
             return NS_ERROR_FAILURE;
           }
           if (error) {
             LOG(("GetCaptureDevice failed: %d", error));
-            unused << self->SendReplyFailure();
+            Unused << self->SendReplyFailure();
             return NS_ERROR_FAILURE;
           }
 
           LOG(("Returning %s name %s id", name.get(), uniqueId.get()));
-          unused << self->SendReplyGetCaptureDevice(name, uniqueId);
+          Unused << self->SendReplyGetCaptureDevice(name, uniqueId);
           return NS_OK;
         });
       self->mPBackgroundThread->Dispatch(ipc_runnable, NS_DISPATCH_NORMAL);
       return NS_OK;
     });
   DispatchToVideoCaptureThread(webrtc_runnable);
   return true;
 }
@@ -642,21 +642,21 @@ CamerasParent::RecvAllocateCaptureDevice
           unique_id.get(), MediaEngineSource::kMaxUniqueIdLength, numdev);
       }
       RefPtr<nsIRunnable> ipc_runnable =
         media::NewRunnableFrom([self, numdev, error]() -> nsresult {
           if (self->IsShuttingDown()) {
             return NS_ERROR_FAILURE;
           }
           if (error) {
-            unused << self->SendReplyFailure();
+            Unused << self->SendReplyFailure();
             return NS_ERROR_FAILURE;
           } else {
             LOG(("Allocated device nr %d", numdev));
-            unused << self->SendReplyAllocateCaptureDevice(numdev);
+            Unused << self->SendReplyAllocateCaptureDevice(numdev);
             return NS_OK;
           }
         });
       self->mPBackgroundThread->Dispatch(ipc_runnable, NS_DISPATCH_NORMAL);
       return NS_OK;
     });
   DispatchToVideoCaptureThread(webrtc_runnable);
   return true;
@@ -685,20 +685,20 @@ CamerasParent::RecvReleaseCaptureDevice(
     media::NewRunnableFrom([self, aCapEngine, numdev]() -> nsresult {
       int error = self->ReleaseCaptureDevice(aCapEngine, numdev);
       RefPtr<nsIRunnable> ipc_runnable =
         media::NewRunnableFrom([self, error, numdev]() -> nsresult {
           if (self->IsShuttingDown()) {
             return NS_ERROR_FAILURE;
           }
           if (error) {
-            unused << self->SendReplyFailure();
+            Unused << self->SendReplyFailure();
             return NS_ERROR_FAILURE;
           } else {
-            unused << self->SendReplySuccess();
+            Unused << self->SendReplySuccess();
             LOG(("Freed device nr %d", numdev));
             return NS_OK;
           }
         });
       self->mPBackgroundThread->Dispatch(ipc_runnable, NS_DISPATCH_NORMAL);
       return NS_OK;
     });
   DispatchToVideoCaptureThread(webrtc_runnable);
@@ -748,20 +748,20 @@ CamerasParent::RecvStartCapture(const in
         }
       }
       RefPtr<nsIRunnable> ipc_runnable =
         media::NewRunnableFrom([self, error]() -> nsresult {
           if (self->IsShuttingDown()) {
             return NS_ERROR_FAILURE;
           }
           if (!error) {
-            unused << self->SendReplySuccess();
+            Unused << self->SendReplySuccess();
             return NS_OK;
           } else {
-            unused << self->SendReplyFailure();
+            Unused << self->SendReplyFailure();
             return NS_ERROR_FAILURE;
           }
         });
       self->mPBackgroundThread->Dispatch(ipc_runnable, NS_DISPATCH_NORMAL);
       return NS_OK;
     });
   DispatchToVideoCaptureThread(webrtc_runnable);
   return true;
--- a/dom/media/systemservices/MediaParent.cpp
+++ b/dom/media/systemservices/MediaParent.cpp
@@ -442,17 +442,17 @@ Parent<Super>::RecvGetOriginKey(const ui
     return false;
   }
 
   p->Then([aRequestId, sameProcess](const nsCString& aKey) mutable {
     if (!sameProcess) {
       if (!sIPCServingParent) {
         return NS_OK;
       }
-      unused << sIPCServingParent->SendGetOriginKeyResponse(aRequestId, aKey);
+      Unused << sIPCServingParent->SendGetOriginKeyResponse(aRequestId, aKey);
     } else {
       RefPtr<MediaManager> mgr = MediaManager::GetInstance();
       if (!mgr) {
         return NS_OK;
       }
       RefPtr<Pledge<nsCString>> pledge =
           mgr->mGetOriginKeyPledges.Remove(aRequestId);
       if (pledge) {
--- a/dom/media/systemservices/MediaSystemResourceManagerParent.cpp
+++ b/dom/media/systemservices/MediaSystemResourceManagerParent.cpp
@@ -27,17 +27,17 @@ bool
 MediaSystemResourceManagerParent::RecvAcquire(const uint32_t& aId,
                                               const MediaSystemResourceType& aResourceType,
                                               const bool& aWillWait)
 {
   MediaSystemResourceRequest* request = mResourceRequests.Get(aId);
   MOZ_ASSERT(!request);
   if (request) {
     // Send fail response
-    mozilla::unused << SendResponse(aId, false /* fail */);
+    mozilla::Unused << SendResponse(aId, false /* fail */);
     return true;
   }
 
   request = new MediaSystemResourceRequest(aId, aResourceType);
   mResourceRequests.Put(aId, request);
   mMediaSystemResourceService->Acquire(this, aId, aResourceType, aWillWait);
   return true;
 }
--- a/dom/media/systemservices/MediaSystemResourceService.cpp
+++ b/dom/media/systemservices/MediaSystemResourceService.cpp
@@ -90,32 +90,32 @@ MediaSystemResourceService::Acquire(medi
   }
 
   MediaSystemResource* resource = mResources.Get(static_cast<uint32_t>(aResourceType));
 
   if (!resource ||
       resource->mResourceCount == 0) {
     // Resource does not exit
     // Send fail response
-    mozilla::unused << aParent->SendResponse(aId, false /* fail */);
+    mozilla::Unused << aParent->SendResponse(aId, false /* fail */);
     return;
   }
 
   // Try to acquire a resource
   if (resource->mAcquiredRequests.size() < resource->mResourceCount) {
     // Resource is available
     resource->mAcquiredRequests.push_back(
       MediaSystemResourceRequest(aParent, aId));
     // Send success response
-    mozilla::unused << aParent->SendResponse(aId, true /* success */);
+    mozilla::Unused << aParent->SendResponse(aId, true /* success */);
     return;
   } else if (!aWillWait) {
     // Resource is not available and do not wait.
     // Send fail response
-    mozilla::unused << aParent->SendResponse(aId, false /* fail */);
+    mozilla::Unused << aParent->SendResponse(aId, false /* fail */);
     return;
   }
   // Wait until acquire.
   resource->mWaitingRequests.push_back(
     MediaSystemResourceRequest(aParent, aId));
 }
 
 void
@@ -241,16 +241,16 @@ MediaSystemResourceService::UpdateReques
   std::deque<MediaSystemResourceRequest>& waitingRequests =
     resource->mWaitingRequests;
 
   while ((acquiredRequests.size() < resource->mResourceCount) &&
          (waitingRequests.size() > 0)) {
     MediaSystemResourceRequest& request = waitingRequests.front();
     MOZ_ASSERT(request.mParent);
     // Send response
-    mozilla::unused << request.mParent->SendResponse(request.mId, true /* success */);
+    mozilla::Unused << request.mParent->SendResponse(request.mId, true /* success */);
     // Move request to mAcquiredRequests
     acquiredRequests.push_back(waitingRequests.front());
     waitingRequests.pop_front();
   }
 }
 
 } // namespace mozilla
--- a/dom/media/test/crashtests/crashtests.list
+++ b/dom/media/test/crashtests/crashtests.list
@@ -1,17 +1,17 @@
 skip-if(Android||B2G) load 0-timescale.html # bug 1048628
 skip-if(Android) load 459439-1.html # bug 888557
 load 466607-1.html
 load 466945-1.html
 load 468763-1.html
 load 474744-1.html
 HTTP load 481136-1.html # needs to be HTTP to recognize the ogg as an audio file?
+load 492286-1.xhtml
 load 493915-1.html
-load 492286-1.xhtml
 load 495794-1.html
 load 576612-1.html
 load 752784-1.html
 load 789075-1.html
 HTTP load 795892-1.html
 load 844563.html
 load 846612.html
 load 852838.html
--- a/dom/media/webaudio/AlignedTArray.h
+++ b/dom/media/webaudio/AlignedTArray.h
@@ -10,17 +10,17 @@
 #include "mozilla/Alignment.h"
 #include "nsTArray.h"
 
 /**
  * E: element type, must be a POD type.
  * N: N bytes alignment for the first element, defaults to 32
   */
 template <typename E, int N = 32>
-class AlignedTArray : public nsTArray_Impl<E, nsTArrayInfallibleAllocator>
+class AlignedTArray : private nsTArray_Impl<E, nsTArrayInfallibleAllocator>
 {
   static_assert((N & (N-1)) == 0, "N must be power of 2");
   typedef nsTArray_Impl<E, nsTArrayInfallibleAllocator> base_type;
 public:
   typedef E                                          elem_type;
   typedef typename base_type::size_type              size_type;
   typedef typename base_type::index_type             index_type;
 
@@ -41,16 +41,19 @@ public:
   {
     return base_type::SetLength(newLen + sExtra, mozilla::fallible);
   }
 
   size_type Length() const {
     return base_type::Length() <= sExtra ? 0 : base_type::Length() - sExtra;
   }
 
+  using base_type::ShallowSizeOfExcludingThis;
+  using base_type::ShallowSizeOfIncludingThis;
+
 private:
   AlignedTArray(const AlignedTArray& other) = delete;
   void operator=(const AlignedTArray& other) = delete;
 
   static const size_type sPadding = N <= MOZ_ALIGNOF(E) ? 0 : N - MOZ_ALIGNOF(E);
   static const size_type sExtra = (sPadding + sizeof(E) - 1) / sizeof(E);
 
   template <typename U>
--- a/dom/media/webaudio/AnalyserNode.cpp
+++ b/dom/media/webaudio/AnalyserNode.cpp
@@ -113,17 +113,17 @@ AnalyserNode::AnalyserNode(AudioContext*
 {
   mStream = AudioNodeStream::Create(aContext,
                                     new AnalyserNodeEngine(this),
                                     AudioNodeStream::NO_STREAM_FLAGS);
 
   // Enough chunks must be recorded to handle the case of fftSize being
   // increased to maximum immediately before getFloatTimeDomainData() is
   // called, for example.
-  unused << mChunks.SetLength(CHUNK_COUNT, fallible);
+  Unused << mChunks.SetLength(CHUNK_COUNT, fallible);
 
   AllocateBuffer();
 }
 
 size_t
 AnalyserNode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t amount = AudioNode::SizeOfExcludingThis(aMallocSizeOf);
--- a/dom/media/webaudio/BufferDecoder.cpp
+++ b/dom/media/webaudio/BufferDecoder.cpp
@@ -28,23 +28,16 @@ BufferDecoder::~BufferDecoder()
 
 void
 BufferDecoder::BeginDecoding(TaskQueue* aTaskQueueIdentity)
 {
   MOZ_ASSERT(!mTaskQueueIdentity && aTaskQueueIdentity);
   mTaskQueueIdentity = aTaskQueueIdentity;
 }
 
-bool
-BufferDecoder::OnStateMachineTaskQueue() const
-{
-  // BufferDecoder doesn't have the concept of a state machine.
-  return true;
-}
-
 MediaResource*
 BufferDecoder::GetResource() const
 {
   return mResource;
 }
 
 void
 BufferDecoder::NotifyBytesConsumed(int64_t aBytes, int64_t aOffset)
--- a/dom/media/webaudio/BufferDecoder.h
+++ b/dom/media/webaudio/BufferDecoder.h
@@ -26,18 +26,16 @@ public:
   // of the caller to manage the memory of the MediaResource object.
   explicit BufferDecoder(MediaResource* aResource);
 
   NS_DECL_THREADSAFE_ISUPPORTS
 
   // This has to be called before decoding begins
   void BeginDecoding(TaskQueue* aTaskQueueIdentity);
 
-  virtual bool OnStateMachineTaskQueue() const final override;
-
   virtual MediaResource* GetResource() const final override;
 
   virtual void NotifyBytesConsumed(int64_t aBytes, int64_t aOffset) final override;
 
   virtual void NotifyDecodedFrames(uint32_t aParsed, uint32_t aDecoded,
                                    uint32_t aDropped) final override;
 
   virtual void SetMediaSeekable(bool aMediaSeekable) final override;
--- a/dom/media/webaudio/test/test_periodicWaveBandLimiting.html
+++ b/dom/media/webaudio/test/test_periodicWaveBandLimiting.html
@@ -5,17 +5,17 @@
 <script>
 const sampleRate = 48000;
 const bufferSize = 12800;
 const epsilon = 0.01;
 
 // "All implementations must support arrays up to at least 8192", but the
 // linear interpolation of the current implementation distorts the higher
 // frequency components too much to pass this test.
-const frequencyIndexMax = 100;
+const frequencyIndexMax = 200;
 
 // A set of oscillators are created near the Nyquist frequency.
 // These are factors giving each oscillator frequency relative to the Nyquist.
 // The first is an octave below Nyquist and the last is just above.
 const OCTAVE_BELOW = 0;
 const HALF_BELOW = 1;
 const NEAR_BELOW = 2;
 const ABOVE = 3;
@@ -75,12 +75,12 @@ function test_frequency_index(frequencyI
     });
 }
 
 // The 5/4 ratio with rounding up provides sampling across a range of
 // octaves and offsets within octaves.
 for (var frequencyIndex = 1;
      frequencyIndex < frequencyIndexMax;
      frequencyIndex = Math.floor((5 * frequencyIndex + 3) / 4)) {
-  promise_test(() => test_frequency_index(frequencyIndex),
+  promise_test(test_frequency_index.bind(null, frequencyIndex),
                "Frequency " + frequencyIndex);
 }
 </script>
--- a/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
+++ b/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp
@@ -339,17 +339,17 @@ nsSynthVoiceRegistry::RemoveVoice(nsISpe
       mUseGlobalQueue = false;
     }
   }
 
   nsTArray<SpeechSynthesisParent*> ssplist;
   GetAllSpeechSynthActors(ssplist);
 
   for (uint32_t i = 0; i < ssplist.Length(); ++i)
-    unused << ssplist[i]->SendVoiceRemoved(nsString(aUri));
+    Unused << ssplist[i]->SendVoiceRemoved(nsString(aUri));
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSynthVoiceRegistry::SetDefaultVoice(const nsAString& aUri,
                                       bool aIsDefault)
 {
@@ -369,17 +369,17 @@ nsSynthVoiceRegistry::SetDefaultVoice(co
     mDefaultVoices.AppendElement(retval);
   }
 
   if (XRE_IsParentProcess()) {
     nsTArray<SpeechSynthesisParent*> ssplist;
     GetAllSpeechSynthActors(ssplist);
 
     for (uint32_t i = 0; i < ssplist.Length(); ++i) {
-      unused << ssplist[i]->SendSetDefaultVoice(nsString(aUri), aIsDefault);
+      Unused << ssplist[i]->SendSetDefaultVoice(nsString(aUri), aIsDefault);
     }
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSynthVoiceRegistry::GetVoiceCount(uint32_t* aRetval)
@@ -489,17 +489,17 @@ nsSynthVoiceRegistry::AddVoiceImpl(nsISp
   if (!ssplist.IsEmpty()) {
     mozilla::dom::RemoteVoice ssvoice(nsString(aUri),
                                       nsString(aName),
                                       nsString(aLang),
                                       aLocalService,
                                       aQueuesUtterances);
 
     for (uint32_t i = 0; i < ssplist.Length(); ++i) {
-      unused << ssplist[i]->SendVoiceAdded(ssvoice);
+      Unused << ssplist[i]->SendVoiceAdded(ssvoice);
     }
   }
 
   return NS_OK;
 }
 
 bool
 nsSynthVoiceRegistry::FindVoiceByLang(const nsAString& aLang,
@@ -739,17 +739,17 @@ nsSynthVoiceRegistry::SetIsSpeaking(bool
   MOZ_ASSERT(XRE_IsParentProcess());
 
   // Only set to 'true' if global queue is enabled.
   mIsSpeaking = aIsSpeaking && (mUseGlobalQueue || sForceGlobalQueue);
 
   nsTArray<SpeechSynthesisParent*> ssplist;
   GetAllSpeechSynthActors(ssplist);
   for (uint32_t i = 0; i < ssplist.Length(); ++i) {
-    unused << ssplist[i]->SendIsSpeakingChanged(aIsSpeaking);
+    Unused << ssplist[i]->SendIsSpeakingChanged(aIsSpeaking);
   }
 }
 
 void
 nsSynthVoiceRegistry::SpeakImpl(VoiceData* aVoice,
                                 nsSpeechTask* aTask,
                                 const nsAString& aText,
                                 const float& aVolume,
--- a/dom/messagechannel/MessagePort.cpp
+++ b/dom/messagechannel/MessagePort.cpp
@@ -235,17 +235,17 @@ class ForceCloseHelper final : public ns
 public:
   NS_DECL_ISUPPORTS
 
   static void ForceClose(const MessagePortIdentifier& aIdentifier)
   {
     PBackgroundChild* actor =
       mozilla::ipc::BackgroundChild::GetForCurrentThread();
     if (actor) {
-      unused << actor->SendMessagePortForceClose(aIdentifier.uuid(),
+      Unused << actor->SendMessagePortForceClose(aIdentifier.uuid(),
                                                  aIdentifier.destinationUuid(),
                                                  aIdentifier.sequenceId());
       return;
     }
 
     RefPtr<ForceCloseHelper> helper = new ForceCloseHelper(aIdentifier);
     if (NS_WARN_IF(!mozilla::ipc::BackgroundChild::GetOrCreateForCurrentThread(helper))) {
       MOZ_CRASH();
--- a/dom/messagechannel/MessagePortParent.cpp
+++ b/dom/messagechannel/MessagePortParent.cpp
@@ -98,17 +98,17 @@ MessagePortParent::RecvDisentangle(nsTAr
 bool
 MessagePortParent::RecvStopSendingData()
 {
   if (!mEntangled) {
     return true;
   }
 
   mCanSendData = false;
-  unused << SendStopSendingDataConfirmed();
+  Unused << SendStopSendingDataConfirmed();
   return true;
 }
 
 bool
 MessagePortParent::RecvClose()
 {
   if (mService) {
     MOZ_ASSERT(mEntangled);
@@ -117,17 +117,17 @@ MessagePortParent::RecvClose()
       return false;
     }
 
     Close();
   }
 
   MOZ_ASSERT(!mEntangled);
 
-  unused << Send__delete__(this);
+  Unused << Send__delete__(this);
   return true;
 }
 
 void
 MessagePortParent::ActorDestroy(ActorDestroyReason aWhy)
 {
   if (mService && mEntangled) {
     // When the last parent is deleted, this service is freed but this cannot
@@ -144,17 +144,17 @@ MessagePortParent::Entangled(const nsTAr
   mEntangled = true;
   return SendEntangled(aMessages);
 }
 
 void
 MessagePortParent::CloseAndDelete()
 {
   Close();
-  unused << Send__delete__(this);
+  Unused << Send__delete__(this);
 }
 
 void
 MessagePortParent::Close()
 {
   mService = nullptr;
   mEntangled = false;
 }
--- a/dom/messagechannel/MessagePortService.cpp
+++ b/dom/messagechannel/MessagePortService.cpp
@@ -202,17 +202,17 @@ MessagePortService::DisentanglePort(
 
   FallibleTArray<MessagePortMessage> array;
   if (!SharedMessagePortMessage::FromSharedToMessagesParent(data->mParent,
                                                             aMessages,
                                                             array)) {
     return false;
   }
 
-  unused << data->mParent->Entangled(array);
+  Unused << data->mParent->Entangled(array);
   return true;
 }
 
 bool
 MessagePortService::ClosePort(MessagePortParent* aParent)
 {
   MessagePortServiceData* data;
   if (!mPorts.Get(aParent->ID(), &data)) {
@@ -320,17 +320,17 @@ MessagePortService::PostMessages(
     FallibleTArray<MessagePortMessage> messages;
     if (!SharedMessagePortMessage::FromSharedToMessagesParent(data->mParent,
                                                               data->mMessages,
                                                               messages)) {
       return false;
     }
 
     data->mMessages.Clear();
-    unused << data->mParent->SendReceiveData(messages);
+    Unused << data->mParent->SendReceiveData(messages);
   }
 
   return true;
 }
 
 void
 MessagePortService::ParentDestroy(MessagePortParent* aParent)
 {
--- a/dom/mobilemessage/ipc/SmsIPCService.cpp
+++ b/dom/mobilemessage/ipc/SmsIPCService.cpp
@@ -68,17 +68,17 @@ SendCursorRequest(const IPCMobileMessage
   NS_ENSURE_TRUE(smsChild, NS_ERROR_FAILURE);
 
   RefPtr<MobileMessageCursorChild> actor =
     new MobileMessageCursorChild(aRequestReply);
 
   // Add an extra ref for IPDL. Will be released in
   // SmsChild::DeallocPMobileMessageCursor().
   RefPtr<MobileMessageCursorChild> actorCopy(actor);
-  mozilla::unused << actorCopy.forget().take();
+  mozilla::Unused << actorCopy.forget().take();
 
   smsChild->SendPMobileMessageCursorConstructor(actor, aRequest);
 
   actor.forget(aResult);
   return NS_OK;
 }
 
 uint32_t
--- a/dom/mobilemessage/ipc/SmsParent.cpp
+++ b/dom/mobilemessage/ipc/SmsParent.cpp
@@ -220,83 +220,83 @@ SmsParent::Observe(nsISupports* aSubject
 
   if (!strcmp(aTopic, kSmsReceivedObserverTopic)) {
     MobileMessageData msgData;
     if (!GetMobileMessageDataFromMessage(parent, aSubject, msgData)) {
       NS_ERROR("Got a 'sms-received' topic without a valid message!");
       return NS_OK;
     }
 
-    unused << SendNotifyReceivedMessage(msgData);
+    Unused << SendNotifyReceivedMessage(msgData);
     return NS_OK;
   }
 
   if (!strcmp(aTopic, kSmsRetrievingObserverTopic)) {
     MobileMessageData msgData;
     if (!GetMobileMessageDataFromMessage(parent, aSubject, msgData)) {
       NS_ERROR("Got a 'sms-retrieving' topic without a valid message!");
       return NS_OK;
     }
 
-    unused << SendNotifyRetrievingMessage(msgData);
+    Unused << SendNotifyRetrievingMessage(msgData);
     return NS_OK;
   }
 
   if (!strcmp(aTopic, kSmsSendingObserverTopic)) {
     MobileMessageData msgData;
     if (!GetMobileMessageDataFromMessage(parent, aSubject, msgData)) {
       NS_ERROR("Got a 'sms-sending' topic without a valid message!");
       return NS_OK;
     }
 
-    unused << SendNotifySendingMessage(msgData);
+    Unused << SendNotifySendingMessage(msgData);
     return NS_OK;
   }
 
   if (!strcmp(aTopic, kSmsSentObserverTopic)) {
     MobileMessageData msgData;
     if (!GetMobileMessageDataFromMessage(parent, aSubject, msgData)) {
       NS_ERROR("Got a 'sms-sent' topic without a valid message!");
       return NS_OK;
     }
 
-    unused << SendNotifySentMessage(msgData);
+    Unused << SendNotifySentMessage(msgData);
     return NS_OK;
   }
 
   if (!strcmp(aTopic, kSmsFailedObserverTopic)) {
     MobileMessageData msgData;
     if (!GetMobileMessageDataFromMessage(parent, aSubject, msgData)) {
       NS_ERROR("Got a 'sms-failed' topic without a valid message!");
       return NS_OK;
     }
 
-    unused << SendNotifyFailedMessage(msgData);
+    Unused << SendNotifyFailedMessage(msgData);
     return NS_OK;
   }
 
   if (!strcmp(aTopic, kSmsDeliverySuccessObserverTopic)) {
     MobileMessageData msgData;
     if (!GetMobileMessageDataFromMessage(parent, aSubject, msgData)) {
       NS_ERROR("Got a 'sms-sending' topic without a valid message!");
       return NS_OK;
     }
 
-    unused << SendNotifyDeliverySuccessMessage(msgData);
+    Unused << SendNotifyDeliverySuccessMessage(msgData);
     return NS_OK;
   }<