Merge latest green b2g-inbound changeset and mozilla-central

This commit is contained in:
Ed Morley 2014-04-29 17:34:22 +01:00
commit f7cb5c4af6
70 changed files with 1154 additions and 660 deletions

View File

@ -198,7 +198,7 @@ AccGroupInfo::NextItemTo(Accessible* aItem)
Accessible* parent = aItem->Parent();
uint32_t childCount = parent->ChildCount();
for (int32_t idx = aItem->IndexInParent() + 1; idx < childCount; idx++) {
for (uint32_t idx = aItem->IndexInParent() + 1; idx < childCount; idx++) {
Accessible* nextItem = parent->GetChildAt(idx);
AccGroupInfo* nextGroupInfo = nextItem->GetGroupInfo();
if (nextGroupInfo &&

View File

@ -26,8 +26,8 @@ using namespace mozilla::a11y;
void
TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
int32_t* aStartHTOffset,
int32_t* aEndHTOffset)
uint32_t* aStartOffset,
uint32_t* aEndOffset)
{
// 1. Hyper text accessible must be specified always.
// 2. Offset accessible and result hyper text offsets must be specified in
@ -37,9 +37,9 @@ TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
// specified in the case of default text attributes.
NS_PRECONDITION(mHyperTextAcc &&
((mOffsetAcc && mOffsetAccIdx != -1 &&
aStartHTOffset && aEndHTOffset) ||
aStartOffset && aEndOffset) ||
(!mOffsetAcc && mOffsetAccIdx == -1 &&
!aStartHTOffset && !aEndHTOffset &&
!aStartOffset && !aEndOffset &&
mIncludeDefAttrs && aAttributes)),
"Wrong usage of TextAttrsMgr!");
@ -50,7 +50,7 @@ TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
if (!nsAccUtils::IsEmbeddedObject(currAcc))
break;
(*aStartHTOffset)--;
(*aStartOffset)--;
}
uint32_t childCount = mHyperTextAcc->ChildCount();
@ -60,7 +60,7 @@ TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
if (!nsAccUtils::IsEmbeddedObject(currAcc))
break;
(*aEndHTOffset)++;
(*aEndOffset)++;
}
return;
@ -141,12 +141,12 @@ TextAttrsMgr::GetAttributes(nsIPersistentProperties* aAttributes,
// Expose text attributes range where they are applied if applicable.
if (mOffsetAcc)
GetRange(attrArray, ArrayLength(attrArray), aStartHTOffset, aEndHTOffset);
GetRange(attrArray, ArrayLength(attrArray), aStartOffset, aEndOffset);
}
void
TextAttrsMgr::GetRange(TextAttr* aAttrArray[], uint32_t aAttrArrayLen,
int32_t* aStartHTOffset, int32_t* aEndHTOffset)
uint32_t* aStartOffset, uint32_t* aEndOffset)
{
// Navigate backward from anchor accessible to find start offset.
for (int32_t childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) {
@ -169,7 +169,7 @@ TextAttrsMgr::GetRange(TextAttr* aAttrArray[], uint32_t aAttrArrayLen,
if (offsetFound)
break;
*(aStartHTOffset) -= nsAccUtils::TextLength(currAcc);
*(aStartOffset) -= nsAccUtils::TextLength(currAcc);
}
// Navigate forward from anchor accessible to find end offset.
@ -194,7 +194,7 @@ TextAttrsMgr::GetRange(TextAttr* aAttrArray[], uint32_t aAttrArrayLen,
if (offsetFound)
break;
(*aEndHTOffset) += nsAccUtils::TextLength(currAcc);
(*aEndOffset) += nsAccUtils::TextLength(currAcc);
}
}
@ -870,9 +870,9 @@ TextAttrsMgr::TextPosTextAttr::
const nsIContent* content = aFrame->GetContent();
if (content && content->IsHTML()) {
const nsIAtom* tagName = content->Tag();
if (tagName == nsGkAtoms::sup)
if (tagName == nsGkAtoms::sup)
return eTextPosSuper;
if (tagName == nsGkAtoms::sub)
if (tagName == nsGkAtoms::sub)
return eTextPosSub;
}

View File

@ -69,8 +69,8 @@ public:
* @param aEndHTOffset [out, optional] end hyper text offset
*/
void GetAttributes(nsIPersistentProperties* aAttributes,
int32_t* aStartHTOffset = nullptr,
int32_t* aEndHTOffset = nullptr);
uint32_t* aStartHTOffset = nullptr,
uint32_t* aEndHTOffset = nullptr);
protected:
/**
@ -85,7 +85,7 @@ protected:
*/
class TextAttr;
void GetRange(TextAttr* aAttrArray[], uint32_t aAttrArrayLen,
int32_t* aStartHTOffset, int32_t* aEndHTOffset);
uint32_t* aStartOffset, uint32_t* aEndOffset);
private:
Accessible* mOffsetAcc;
@ -315,7 +315,7 @@ protected:
FontSizeTextAttr(nsIFrame* aRootFrame, nsIFrame* aFrame);
virtual ~FontSizeTextAttr() { }
protected:
protected:
// TTextAttr
virtual bool GetValueFor(Accessible* aAccessible, nscoord* aValue);

View File

@ -14,7 +14,7 @@ using namespace mozilla::a11y;
/**
* An object that stores a given traversal rule during
* An object that stores a given traversal rule during the pivot movement.
*/
class RuleCache
{
@ -325,7 +325,7 @@ nsAccessiblePivot::MoveNextByText(TextBoundaryType aBoundary, bool* aResult)
// If there's no more text on the current node, try to find the next text
// node; if there isn't one, bail out.
if (tempEnd == text->CharacterCount()) {
if (tempEnd == static_cast<int32_t>(text->CharacterCount())) {
if (tempPosition == root)
return NS_OK;
@ -389,7 +389,7 @@ nsAccessiblePivot::MoveNextByText(TextBoundaryType aBoundary, bool* aResult)
// instead want to traverse into it. So restart the movement with
// the child as the starting point.
if (childAtOffset && nsAccUtils::IsEmbeddedObject(childAtOffset) &&
tempStart == childAtOffset->StartOffset()) {
tempStart == static_cast<int32_t>(childAtOffset->StartOffset())) {
tempPosition = childAtOffset;
tempStart = tempEnd = -1;
continue;
@ -517,7 +517,7 @@ nsAccessiblePivot::MovePreviousByText(TextBoundaryType aBoundary, bool* aResult)
// instead want to traverse into it. So restart the movement with
// the child as the starting point.
if (childAtOffset && nsAccUtils::IsEmbeddedObject(childAtOffset) &&
tempEnd == childAtOffset->EndOffset()) {
tempEnd == static_cast<int32_t>(childAtOffset->EndOffset())) {
tempPosition = childAtOffset;
tempStart = tempEnd = childAtOffset->AsHyperText()->CharacterCount();
continue;

View File

@ -21,22 +21,15 @@ namespace a11y {
inline bool
HyperTextAccessible::IsValidOffset(int32_t aOffset)
{
int32_t offset = ConvertMagicOffset(aOffset);
return offset >= 0 && offset <= static_cast<int32_t>(CharacterCount());
return ConvertMagicOffset(aOffset) <= CharacterCount();
}
inline bool
HyperTextAccessible::IsValidRange(int32_t aStartOffset, int32_t aEndOffset)
{
int32_t startOffset = ConvertMagicOffset(aStartOffset);
if (startOffset < 0)
return false;
int32_t endOffset = ConvertMagicOffset(aEndOffset);
if (endOffset < 0 || startOffset > endOffset)
return false;
return endOffset <= static_cast<int32_t>(CharacterCount());
uint32_t endOffset = ConvertMagicOffset(aEndOffset);
return ConvertMagicOffset(aStartOffset) <= endOffset &&
endOffset <= CharacterCount();
}
inline bool
@ -108,8 +101,8 @@ HyperTextAccessible::PasteText(int32_t aPosition)
}
}
inline int32_t
HyperTextAccessible::ConvertMagicOffset(int32_t aOffset)
inline uint32_t
HyperTextAccessible::ConvertMagicOffset(int32_t aOffset) const
{
if (aOffset == nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT)
return CharacterCount();
@ -117,11 +110,11 @@ HyperTextAccessible::ConvertMagicOffset(int32_t aOffset)
if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET)
return CaretOffset();
return aOffset;
return aOffset < 0 ? std::numeric_limits<uint32_t>::max() : aOffset;
}
inline int32_t
HyperTextAccessible::AdjustCaretOffset(int32_t aOffset) const
inline uint32_t
HyperTextAccessible::AdjustCaretOffset(uint32_t aOffset) const
{
// It is the same character offset when the caret is visually at the very
// end of a line or the start of a new line (soft line break). Getting text

View File

@ -83,7 +83,7 @@ HyperTextAccessible::NativeRole()
if (tag == nsGkAtoms::article)
return roles::DOCUMENT;
// Deal with html landmark elements
if (tag == nsGkAtoms::header)
return roles::HEADER;
@ -149,10 +149,9 @@ HyperTextAccessible::GetBoundsInFrame(nsIFrame* aFrame,
nsRect screenRect;
while (frame && startContentOffset < endContentOffset) {
// Start with this frame's screen rect, which we will
// shrink based on the substring we care about within it.
// We will then add that frame to the total screenRect we
// are returning.
// Start with this frame's screen rect, which we will shrink based on
// the substring we care about within it. We will then add that frame to
// the total screenRect we are returning.
nsRect frameScreenRect = frame->GetScreenRectInAppUnits();
// Get the length of the substring in this frame that we want the bounds for
@ -192,8 +191,8 @@ HyperTextAccessible::TextSubstring(int32_t aStartOffset, int32_t aEndOffset,
{
aText.Truncate();
int32_t startOffset = ConvertMagicOffset(aStartOffset);
int32_t endOffset = ConvertMagicOffset(aEndOffset);
uint32_t startOffset = ConvertMagicOffset(aStartOffset);
uint32_t endOffset = ConvertMagicOffset(aEndOffset);
int32_t startChildIdx = GetChildIndexAtOffset(startOffset);
if (startChildIdx == -1)
@ -234,7 +233,7 @@ HyperTextAccessible::TextSubstring(int32_t aStartOffset, int32_t aEndOffset,
endChild->AppendTextTo(aText, 0, endOffset - endChildOffset);
}
int32_t
uint32_t
HyperTextAccessible::DOMPointToOffset(nsINode* aNode, int32_t aNodeOffset,
bool aIsEndOffset) const
{
@ -256,7 +255,7 @@ HyperTextAccessible::DOMPointToOffset(nsINode* aNode, int32_t aNodeOffset,
nsresult rv = ContentToRenderedOffset(frame, aNodeOffset, &offset);
NS_ENSURE_SUCCESS(rv, 0);
// Get the child node and
findNode = aNode;
} else {
@ -279,7 +278,7 @@ HyperTextAccessible::DOMPointToOffset(nsINode* aNode, int32_t aNodeOffset,
// Case #2: there are no children, we're at this node.
findNode = aNode;
} else if (aNodeOffset == aNode->GetChildCount()) {
} else if (aNodeOffset == static_cast<int32_t>(aNode->GetChildCount())) {
// Case #3: we're after the last child, get next node to this one.
for (nsINode* tmpNode = aNode;
!findNode && tmpNode && tmpNode != mContent;
@ -319,12 +318,12 @@ HyperTextAccessible::DOMPointToOffset(nsINode* aNode, int32_t aNodeOffset,
return TransformOffset(descendant, offset, aIsEndOffset);
}
int32_t
uint32_t
HyperTextAccessible::TransformOffset(Accessible* aDescendant,
int32_t aOffset, bool aIsEndOffset) const
uint32_t aOffset, bool aIsEndOffset) const
{
// From the descendant, go up and get the immediate child of this hypertext.
int32_t offset = aOffset;
uint32_t offset = aOffset;
Accessible* descendant = aDescendant;
while (descendant) {
Accessible* parent = descendant->Parent();
@ -420,8 +419,8 @@ HyperTextAccessible::OffsetToDOMPoint(int32_t aOffset)
DOMPoint();
}
int32_t
HyperTextAccessible::FindOffset(int32_t aOffset, nsDirection aDirection,
uint32_t
HyperTextAccessible::FindOffset(uint32_t aOffset, nsDirection aDirection,
nsSelectionAmount aAmount,
EWordMovementType aWordMovementType)
{
@ -434,7 +433,7 @@ HyperTextAccessible::FindOffset(int32_t aOffset, nsDirection aDirection,
int32_t childIdx = text->GetChildIndexAtOffset(innerOffset);
NS_ASSERTION(childIdx != -1, "Bad in offset!");
if (childIdx == -1)
return -1;
return 0;
child = text->GetChildAt(childIdx);
@ -468,7 +467,10 @@ HyperTextAccessible::FindOffset(int32_t aOffset, nsDirection aDirection,
} while (text);
nsIFrame* childFrame = child->GetFrame();
NS_ENSURE_TRUE(childFrame, -1);
if (!childFrame) {
NS_ERROR("No child frame");
return 0;
}
int32_t innerContentOffset = innerOffset;
if (child->IsTextLeaf()) {
@ -497,13 +499,15 @@ HyperTextAccessible::FindOffset(int32_t aOffset, nsDirection aDirection,
pos.mAmount = (aDirection == eDirNext) ? eSelectEndLine : eSelectBeginLine;
frameAtOffset->PeekOffset(&pos);
}
if (!pos.mResultContent)
return -1;
if (!pos.mResultContent) {
NS_ERROR("No result content!");
return 0;
}
// Turn the resulting DOM point into an offset.
int32_t hyperTextOffset = DOMPointToOffset(pos.mResultContent,
pos.mContentOffset,
aDirection == eDirNext);
uint32_t hyperTextOffset = DOMPointToOffset(pos.mResultContent,
pos.mContentOffset,
aDirection == eDirNext);
if (aDirection == eDirPrevious) {
// If we reached the end during search, this means we didn't find the DOM point
@ -519,8 +523,8 @@ HyperTextAccessible::FindOffset(int32_t aOffset, nsDirection aDirection,
return hyperTextOffset;
}
int32_t
HyperTextAccessible::FindLineBoundary(int32_t aOffset,
uint32_t
HyperTextAccessible::FindLineBoundary(uint32_t aOffset,
EWhichLineBoundary aWhichLineBoundary)
{
// Note: empty last line doesn't have own frame (a previous line contains '\n'
@ -533,7 +537,7 @@ HyperTextAccessible::FindLineBoundary(int32_t aOffset,
if (IsEmptyLastLineOffset(aOffset))
return FindOffset(aOffset, eDirPrevious, eSelectBeginLine);
int32_t tmpOffset = FindOffset(aOffset, eDirPrevious, eSelectLine);
uint32_t tmpOffset = FindOffset(aOffset, eDirPrevious, eSelectLine);
return FindOffset(tmpOffset, eDirPrevious, eSelectBeginLine);
}
@ -542,7 +546,7 @@ HyperTextAccessible::FindLineBoundary(int32_t aOffset,
return aOffset - 1;
// If offset is at first line then return 0 (first line start).
int32_t tmpOffset = FindOffset(aOffset, eDirPrevious, eSelectBeginLine);
uint32_t tmpOffset = FindOffset(aOffset, eDirPrevious, eSelectBeginLine);
if (tmpOffset == 0)
return 0;
@ -572,7 +576,7 @@ HyperTextAccessible::FindLineBoundary(int32_t aOffset,
// Move to begin of the next line if any (arrow down and home keys),
// otherwise end of the current line (arrow down only).
int32_t tmpOffset = FindOffset(aOffset, eDirNext, eSelectLine);
uint32_t tmpOffset = FindOffset(aOffset, eDirNext, eSelectLine);
if (tmpOffset == CharacterCount())
return tmpOffset;
@ -584,14 +588,15 @@ HyperTextAccessible::FindLineBoundary(int32_t aOffset,
return aOffset;
// Move to next line end (as down arrow and end key were pressed).
int32_t tmpOffset = FindOffset(aOffset, eDirNext, eSelectLine);
if (tmpOffset != CharacterCount())
return FindOffset(tmpOffset, eDirNext, eSelectEndLine);
return tmpOffset;
uint32_t tmpOffset = FindOffset(aOffset, eDirNext, eSelectLine);
if (tmpOffset == CharacterCount())
return tmpOffset;
return FindOffset(tmpOffset, eDirNext, eSelectEndLine);
}
}
return -1;
return 0;
}
void
@ -603,13 +608,13 @@ HyperTextAccessible::TextBeforeOffset(int32_t aOffset,
*aStartOffset = *aEndOffset = 0;
aText.Truncate();
int32_t convertedOffset = ConvertMagicOffset(aOffset);
if (convertedOffset < 0) {
uint32_t convertedOffset = ConvertMagicOffset(aOffset);
if (convertedOffset == std::numeric_limits<uint32_t>::max()) {
NS_ERROR("Wrong given offset!");
return;
}
int32_t adjustedOffset = convertedOffset;
uint32_t adjustedOffset = convertedOffset;
if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET)
adjustedOffset = AdjustCaretOffset(adjustedOffset);
@ -629,7 +634,7 @@ HyperTextAccessible::TextBeforeOffset(int32_t aOffset,
} else {
*aStartOffset = FindWordBoundary(adjustedOffset, eDirPrevious, eStartWord);
*aEndOffset = FindWordBoundary(*aStartOffset, eDirNext, eStartWord);
if (*aEndOffset != adjustedOffset) {
if (*aEndOffset != static_cast<int32_t>(adjustedOffset)) {
*aEndOffset = *aStartOffset;
*aStartOffset = FindWordBoundary(*aEndOffset, eDirPrevious, eStartWord);
}
@ -675,8 +680,8 @@ HyperTextAccessible::TextAtOffset(int32_t aOffset,
*aStartOffset = *aEndOffset = 0;
aText.Truncate();
int32_t adjustedOffset = ConvertMagicOffset(aOffset);
if (adjustedOffset < 0) {
uint32_t adjustedOffset = ConvertMagicOffset(aOffset);
if (adjustedOffset == std::numeric_limits<uint32_t>::max()) {
NS_ERROR("Wrong given offset!");
return;
}
@ -739,13 +744,13 @@ HyperTextAccessible::TextAfterOffset(int32_t aOffset,
*aStartOffset = *aEndOffset = 0;
aText.Truncate();
int32_t convertedOffset = ConvertMagicOffset(aOffset);
if (convertedOffset < 0) {
uint32_t convertedOffset = ConvertMagicOffset(aOffset);
if (convertedOffset == std::numeric_limits<uint32_t>::max()) {
NS_ERROR("Wrong given offset!");
return;
}
int32_t adjustedOffset = convertedOffset;
uint32_t adjustedOffset = convertedOffset;
if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET)
adjustedOffset = AdjustCaretOffset(adjustedOffset);
@ -776,7 +781,7 @@ HyperTextAccessible::TextAfterOffset(int32_t aOffset,
} else {
*aEndOffset = FindWordBoundary(convertedOffset, eDirNext, eEndWord);
*aStartOffset = FindWordBoundary(*aEndOffset, eDirPrevious, eEndWord);
if (*aStartOffset != convertedOffset) {
if (*aStartOffset != static_cast<int32_t>(convertedOffset)) {
*aStartOffset = *aEndOffset;
*aEndOffset = FindWordBoundary(*aStartOffset, eDirNext, eEndWord);
}
@ -812,7 +817,7 @@ HyperTextAccessible::TextAttributes(bool aIncludeDefAttrs, int32_t aOffset,
nsCOMPtr<nsIPersistentProperties> attributes =
do_CreateInstance(NS_PERSISTENTPROPERTIES_CONTRACTID);
int32_t offset = ConvertMagicOffset(aOffset);
uint32_t offset = ConvertMagicOffset(aOffset);
Accessible* accAtOffset = GetChildAtOffset(offset);
if (!accAtOffset) {
// Offset 0 is correct offset when accessible has empty text. Include
@ -828,8 +833,8 @@ HyperTextAccessible::TextAttributes(bool aIncludeDefAttrs, int32_t aOffset,
}
int32_t accAtOffsetIdx = accAtOffset->IndexInParent();
int32_t startOffset = GetChildOffset(accAtOffsetIdx);
int32_t endOffset = GetChildOffset(accAtOffsetIdx + 1);
uint32_t startOffset = GetChildOffset(accAtOffsetIdx);
uint32_t endOffset = GetChildOffset(accAtOffsetIdx + 1);
int32_t offsetInAcc = offset - startOffset;
TextAttrsMgr textAttrsMgr(this, aIncludeDefAttrs, accAtOffset,
@ -843,8 +848,8 @@ HyperTextAccessible::TextAttributes(bool aIncludeDefAttrs, int32_t aOffset,
RenderedToContentOffset(offsetFrame, offsetInAcc, &nodeOffset);
// Set 'misspelled' text attribute.
GetSpellTextAttribute(accAtOffset->GetNode(), nodeOffset,
&startOffset, &endOffset, attributes);
GetSpellTextAttr(accAtOffset->GetNode(), nodeOffset,
&startOffset, &endOffset, attributes);
}
*aStartOffset = startOffset;
@ -1024,9 +1029,11 @@ nsIntRect
HyperTextAccessible::TextBounds(int32_t aStartOffset, int32_t aEndOffset,
uint32_t aCoordType)
{
int32_t startOffset = ConvertMagicOffset(aStartOffset);
int32_t endOffset = ConvertMagicOffset(aEndOffset);
NS_ASSERTION(startOffset < endOffset, "Wrong bad in!");
uint32_t startOffset = ConvertMagicOffset(aStartOffset);
uint32_t endOffset = ConvertMagicOffset(aEndOffset);
NS_ASSERTION(startOffset < endOffset &&
endOffset != std::numeric_limits<uint32_t>::max(),
"Wrong bad in!");
int32_t childIdx = GetChildIndexAtOffset(startOffset);
if (childIdx == -1)
@ -1036,7 +1043,7 @@ HyperTextAccessible::TextBounds(int32_t aStartOffset, int32_t aEndOffset,
int32_t prevOffset = GetChildOffset(childIdx);
int32_t offset1 = startOffset - prevOffset;
while (childIdx < ChildCount()) {
while (childIdx < static_cast<int32_t>(ChildCount())) {
nsIFrame* frame = GetChildAt(childIdx++)->GetFrame();
if (!frame) {
NS_NOTREACHED("No frame for a child!");
@ -1044,7 +1051,7 @@ HyperTextAccessible::TextBounds(int32_t aStartOffset, int32_t aEndOffset,
}
int32_t nextOffset = GetChildOffset(childIdx);
if (nextOffset >= endOffset) {
if (nextOffset >= static_cast<int32_t>(endOffset)) {
bounds.UnionRect(bounds, GetBoundsInFrame(frame, offset1,
endOffset - prevOffset));
break;
@ -1361,7 +1368,7 @@ HyperTextAccessible::SelectionBoundsAt(int32_t aSelectionNum,
GetSelectionDOMRanges(nsISelectionController::SELECTION_NORMAL, &ranges);
uint32_t rangeCount = ranges.Length();
if (aSelectionNum < 0 || aSelectionNum >= rangeCount)
if (aSelectionNum < 0 || aSelectionNum >= static_cast<int32_t>(rangeCount))
return false;
nsRange* range = ranges[aSelectionNum];
@ -1394,8 +1401,8 @@ HyperTextAccessible::SetSelectionBoundsAt(int32_t aSelectionNum,
int32_t aStartOffset,
int32_t aEndOffset)
{
int32_t startOffset = ConvertMagicOffset(aStartOffset);
int32_t endOffset = ConvertMagicOffset(aEndOffset);
uint32_t startOffset = ConvertMagicOffset(aStartOffset);
uint32_t endOffset = ConvertMagicOffset(aEndOffset);
dom::Selection* domSel = DOMSelection();
if (!domSel)
@ -1403,7 +1410,7 @@ HyperTextAccessible::SetSelectionBoundsAt(int32_t aSelectionNum,
nsRefPtr<nsRange> range;
uint32_t rangeCount = domSel->GetRangeCount();
if (aSelectionNum == rangeCount)
if (aSelectionNum == static_cast<int32_t>(rangeCount))
range = new nsRange(mContent);
else
range = domSel->GetRangeAt(aSelectionNum);
@ -1416,7 +1423,7 @@ HyperTextAccessible::SetSelectionBoundsAt(int32_t aSelectionNum,
// If new range was created then add it, otherwise notify selection listeners
// that existing selection range was changed.
if (aSelectionNum == rangeCount)
if (aSelectionNum == static_cast<int32_t>(rangeCount))
return NS_SUCCEEDED(domSel->AddRange(range));
domSel->RemoveRange(range);
@ -1801,7 +1808,7 @@ HyperTextAccessible::GetDOMPointByFrameOffset(nsIFrame* aFrame, int32_t aOffset,
if (!aFrame) {
// If the given frame is null then set offset after the DOM node of the
// given accessible.
NS_ASSERTION(!aAccessible->IsDoc(),
NS_ASSERTION(!aAccessible->IsDoc(),
"Shouldn't be called on document accessible!");
nsIContent* content = aAccessible->GetContent();
@ -1837,26 +1844,26 @@ HyperTextAccessible::GetDOMPointByFrameOffset(nsIFrame* aFrame, int32_t aOffset,
}
// HyperTextAccessible
nsresult
HyperTextAccessible::GetSpellTextAttribute(nsINode* aNode,
int32_t aNodeOffset,
int32_t* aHTStartOffset,
int32_t* aHTEndOffset,
nsIPersistentProperties* aAttributes)
void
HyperTextAccessible::GetSpellTextAttr(nsINode* aNode,
int32_t aNodeOffset,
uint32_t* aStartOffset,
uint32_t* aEndOffset,
nsIPersistentProperties* aAttributes)
{
nsRefPtr<nsFrameSelection> fs = FrameSelection();
if (!fs)
return NS_OK;
return;
dom::Selection* domSel = fs->GetSelection(nsISelectionController::SELECTION_SPELLCHECK);
if (!domSel)
return NS_OK;
return;
int32_t rangeCount = domSel->GetRangeCount();
if (rangeCount <= 0)
return NS_OK;
return;
int32_t startHTOffset = 0, endHTOffset = 0;
int32_t startOffset = 0, endOffset = 0;
for (int32_t idx = 0; idx < rangeCount; idx++) {
nsRange* range = domSel->GetRangeAt(idx);
if (range->Collapsed())
@ -1865,8 +1872,9 @@ HyperTextAccessible::GetSpellTextAttribute(nsINode* aNode,
// See if the point comes after the range in which case we must continue in
// case there is another range after this one.
nsINode* endNode = range->GetEndParent();
int32_t endOffset = range->EndOffset();
if (nsContentUtils::ComparePoints(aNode, aNodeOffset, endNode, endOffset) >= 0)
int32_t endNodeOffset = range->EndOffset();
if (nsContentUtils::ComparePoints(aNode, aNodeOffset,
endNode, endNodeOffset) >= 0)
continue;
// At this point our point is either in this range or before it but after
@ -1874,43 +1882,43 @@ HyperTextAccessible::GetSpellTextAttribute(nsINode* aNode,
// point in which case the point is in the missspelled range, otherwise it
// must be before the range and after the previous one if any.
nsINode* startNode = range->GetStartParent();
int32_t startOffset = range->StartOffset();
if (nsContentUtils::ComparePoints(startNode, startOffset, aNode,
int32_t startNodeOffset = range->StartOffset();
if (nsContentUtils::ComparePoints(startNode, startNodeOffset, aNode,
aNodeOffset) <= 0) {
startHTOffset = DOMPointToOffset(startNode, startOffset);
startOffset = DOMPointToOffset(startNode, startNodeOffset);
endHTOffset = DOMPointToOffset(endNode, endOffset);
endOffset = DOMPointToOffset(endNode, endNodeOffset);
if (startHTOffset > *aHTStartOffset)
*aHTStartOffset = startHTOffset;
if (startOffset > *aStartOffset)
*aStartOffset = startOffset;
if (endHTOffset < *aHTEndOffset)
*aHTEndOffset = endHTOffset;
if (endOffset < *aEndOffset)
*aEndOffset = endOffset;
if (aAttributes) {
nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::invalid,
NS_LITERAL_STRING("spelling"));
}
return NS_OK;
return;
}
// This range came after the point.
endHTOffset = DOMPointToOffset(startNode, startOffset);
endOffset = DOMPointToOffset(startNode, startNodeOffset);
if (idx > 0) {
nsRange* prevRange = domSel->GetRangeAt(idx - 1);
startHTOffset = DOMPointToOffset(prevRange->GetEndParent(),
prevRange->EndOffset());
startOffset = DOMPointToOffset(prevRange->GetEndParent(),
prevRange->EndOffset());
}
if (startHTOffset > *aHTStartOffset)
*aHTStartOffset = startHTOffset;
if (startOffset > *aStartOffset)
*aStartOffset = startOffset;
if (endHTOffset < *aHTEndOffset)
*aHTEndOffset = endHTOffset;
if (endOffset < *aEndOffset)
*aEndOffset = endOffset;
return NS_OK;
return;
}
// We never found a range that ended after the point, therefore we know that
@ -1918,16 +1926,14 @@ HyperTextAccessible::GetSpellTextAttribute(nsINode* aNode,
// and that we should use the end offset of the last range to compute the
// start offset of the text attribute range.
nsRange* prevRange = domSel->GetRangeAt(rangeCount - 1);
startHTOffset = DOMPointToOffset(prevRange->GetEndParent(),
prevRange->EndOffset());
startOffset = DOMPointToOffset(prevRange->GetEndParent(),
prevRange->EndOffset());
if (startHTOffset > *aHTStartOffset)
*aHTStartOffset = startHTOffset;
return NS_OK;
if (startOffset > *aStartOffset)
*aStartOffset = startOffset;
}
bool
bool
HyperTextAccessible::IsTextRole()
{
if (mRoleMapEntry &&

View File

@ -119,14 +119,14 @@ public:
* by the offset returned is at [offset]. If the passed-in offset in inside a
* descendant, then the returned offset will be on the relevant embedded object char.
*/
int32_t DOMPointToOffset(nsINode* aNode, int32_t aNodeOffset,
bool aIsEndOffset = false) const;
uint32_t DOMPointToOffset(nsINode* aNode, int32_t aNodeOffset,
bool aIsEndOffset = false) const;
/**
* Transform the given a11y point into the offset relative this hypertext.
*/
int32_t TransformOffset(Accessible* aDescendant, int32_t aOffset,
bool aIsEndOffset) const;
uint32_t TransformOffset(Accessible* aDescendant, uint32_t aOffset,
bool aIsEndOffset) const;
/**
* Convert start and end hypertext offsets into DOM range.
@ -416,12 +416,12 @@ protected:
/**
* Transform magic offset into text offset.
*/
int32_t ConvertMagicOffset(int32_t aOffset);
uint32_t ConvertMagicOffset(int32_t aOffset) const;
/**
* Adjust an offset the caret stays at to get a text by line boundary.
*/
int32_t AdjustCaretOffset(int32_t aOffset) const;
uint32_t AdjustCaretOffset(uint32_t aOffset) const;
/**
* Return true if caret is at end of line.
@ -440,7 +440,7 @@ protected:
/**
* Return an offset of the found word boundary.
*/
int32_t FindWordBoundary(int32_t aOffset, nsDirection aDirection,
uint32_t FindWordBoundary(uint32_t aOffset, nsDirection aDirection,
EWordMovementType aWordMovementType)
{
return FindOffset(aOffset, aDirection, eSelectWord, aWordMovementType);
@ -464,16 +464,16 @@ protected:
/**
* Return an offset for requested line boundary. See constants above.
*/
int32_t FindLineBoundary(int32_t aOffset,
EWhichLineBoundary aWhichLineBoundary);
uint32_t FindLineBoundary(uint32_t aOffset,
EWhichLineBoundary aWhichLineBoundary);
/**
* Return an offset corresponding to the given direction and selection amount
* relative the given offset. A helper used to find word or line boundaries.
*/
int32_t FindOffset(int32_t aOffset, nsDirection aDirection,
nsSelectionAmount aAmount,
EWordMovementType aWordMovementType = eDefaultBehavior);
uint32_t FindOffset(uint32_t aOffset, nsDirection aDirection,
nsSelectionAmount aAmount,
EWordMovementType aWordMovementType = eDefaultBehavior);
/**
* Return the boundaries of the substring in case of textual frame or
@ -516,10 +516,9 @@ protected:
* @param aEndOffset [in, out] the end offset
* @param aAttributes [out, optional] result attributes
*/
nsresult GetSpellTextAttribute(nsINode* aNode, int32_t aNodeOffset,
int32_t *aStartOffset,
int32_t *aEndOffset,
nsIPersistentProperties *aAttributes);
void GetSpellTextAttr(nsINode* aNode, int32_t aNodeOffset,
uint32_t* aStartOffset, uint32_t* aEndOffset,
nsIPersistentProperties* aAttributes);
private:
/**

View File

@ -248,7 +248,7 @@ XULListboxAccessible::RowCount()
Accessible*
XULListboxAccessible::CellAt(uint32_t aRowIndex, uint32_t aColumnIndex)
{
{
nsCOMPtr<nsIDOMXULSelectControlElement> control =
do_QueryInterface(mContent);
NS_ENSURE_TRUE(control, nullptr);
@ -280,7 +280,7 @@ XULListboxAccessible::IsColSelected(uint32_t aColIdx)
nsresult rv = control->GetSelectedCount(&selectedrowCount);
NS_ENSURE_SUCCESS(rv, false);
return selectedrowCount == RowCount();
return selectedrowCount == static_cast<int32_t>(RowCount());
}
bool
@ -338,7 +338,8 @@ XULListboxAccessible::SelectedColCount()
nsresult rv = control->GetSelectedCount(&selectedRowCount);
NS_ENSURE_SUCCESS(rv, 0);
return selectedRowCount > 0 && selectedRowCount == RowCount() ? ColCount() : 0;
return selectedRowCount > 0 &&
selectedRowCount == static_cast<int32_t>(RowCount()) ? ColCount() : 0;
}
uint32_t
@ -560,7 +561,7 @@ XULListboxAccessible::ContainerWidget() const
if (inputElm) {
nsCOMPtr<nsINode> inputNode = do_QueryInterface(inputElm);
if (inputNode) {
Accessible* input =
Accessible* input =
mDoc->GetAccessible(inputNode);
return input ? input->ContainerWidget() : nullptr;
}
@ -587,12 +588,12 @@ XULListitemAccessible::
NS_IMPL_ISUPPORTS_INHERITED0(XULListitemAccessible, Accessible)
Accessible*
Accessible*
XULListitemAccessible::GetListAccessible()
{
if (IsDefunct())
return nullptr;
nsCOMPtr<nsIDOMXULSelectControlItemElement> listItem =
do_QueryInterface(mContent);
if (!listItem)

View File

@ -1428,7 +1428,7 @@ pref("browser.newtabpage.rows", 3);
// number of columns of newtab grid
pref("browser.newtabpage.columns", 3);
pref("browser.newtabpage.directorySource", "data:application/json,{}");
pref("browser.newtabpage.directorySource", "chrome://global/content/directoryLinks.json");
// Enable the DOM fullscreen API.
pref("full-screen-api.enabled", true);

View File

@ -53,6 +53,11 @@ let gGrid = {
});
addEventListener("load", this);
addEventListener("resize", this);
// The document may already be loaded if the user is toggling the page
if (document.readyState == "complete") {
this.handleEvent({type: "load"});
}
},
/**

View File

@ -21,6 +21,7 @@ skip-if = os == "mac" # Intermittent failures, bug 898317
[browser_newtab_bug991111.js]
[browser_newtab_bug991210.js]
[browser_newtab_bug998387.js]
[browser_newtab_bug1001854.js]
[browser_newtab_disable.js]
[browser_newtab_drag_drop.js]
[browser_newtab_drag_drop_ext.js]

View File

@ -0,0 +1,20 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
const PRELOAD_PREF = "browser.newtab.preload";
function runTests() {
// turn off preload to ensure that a newtab page loads as disabled
Services.prefs.setBoolPref(PRELOAD_PREF, false);
Services.prefs.setBoolPref(PREF_NEWTAB_ENABLED, false);
yield addNewTabPageTab();
let search = getContentDocument().getElementById("newtab-search-form");
is(search.style.width, "", "search form has no width yet");
NewTabUtils.allPages.enabled = true;
isnot(search.style.width, "", "search form has width set");
// restore original state
Services.prefs.clearUserPref(PRELOAD_PREF);
}

View File

@ -34,6 +34,8 @@ function test() {
is(url, base + "&form=MOZSBR", "Check search bar search URL for 'foo'");
url = engine.getSubmission("foo", null, "homepage").uri.spec;
is(url, base + "&form=MOZSPG", "Check homepage search URL for 'foo'");
url = engine.getSubmission("foo", null, "newtab").uri.spec;
is(url, base + "&form=MOZTSB", "Check newtab search URL for 'foo'");
// Check search suggestion URL.
url = engine.getSubmission("foo", "application/x-suggestions+json").uri.spec;

View File

@ -215,11 +215,9 @@ let SyncHandler = {
*/
let SessionHistoryListener = {
init: function () {
// The frame tree observer is needed to handle navigating away from
// an about page. Currently nsISHistoryListener does not have
// OnHistoryNewEntry() called for about pages because the history entry is
// modified to point at the new page. Once Bug 981900 lands the frame tree
// observer can be removed.
// The frame tree observer is needed to handle initial subframe loads.
// It will redundantly invalidate with the SHistoryListener in some cases
// but these invalidations are very cheap.
gFrameTree.addObserver(this);
// By adding the SHistoryListener immediately, we will unfortunately be

View File

@ -76,6 +76,7 @@ support-files =
[browser_privatetabs.js]
[browser_scrollPositions.js]
[browser_sessionHistory.js]
[browser_sessionHistory_slow.sjs]
[browser_sessionStorage.js]
[browser_swapDocShells.js]
[browser_telemetry.js]

View File

@ -219,7 +219,6 @@ add_task(function test_pushstate_replacestate() {
is(entries.length, 2, "there is another shistory entry");
is(entries[1].url, "http://example.com/test-entry/", "url is correct");
// Disabled until replaceState invalidation is supported. See Bug 967028.
browser.messageManager.
sendAsyncMessage("ss-test:historyReplaceState", {url: 'test-entry2/'});
yield promiseContentMessage(browser, "ss-test:historyReplaceState");
@ -233,3 +232,35 @@ add_task(function test_pushstate_replacestate() {
// Cleanup.
gBrowser.removeTab(tab);
});
/**
* Ensure that slow loading subframes will invalidate shistory.
*/
add_task(function test_slow_subframe_load() {
const SLOW_URL = "http://mochi.test:8888/browser/browser/components/" +
"sessionstore/test/browser_sessionHistory_slow.sjs";
const URL = "data:text/html;charset=utf-8," +
"<frameset cols=50%25,50%25>" +
"<frame src='" + SLOW_URL + "'>" +
"</frameset>";
// Add a new tab with a slow loading subframe
let tab = gBrowser.addTab(URL);
let browser = tab.linkedBrowser;
yield promiseBrowserLoaded(browser);
SyncHandlers.get(browser).flush();
let {entries} = JSON.parse(ss.getTabState(tab));
// Check the number of children.
is(entries.length, 1, "there is one root entry ...");
is(entries[0].children.length, 1, "... with one child entries");
// Check URLs.
ok(entries[0].url.startsWith("data:text/html"), "correct root url");
is(entries[0].children[0].url, SLOW_URL, "correct url for subframe");
// Cleanup.
gBrowser.removeTab(tab);
});

View File

@ -0,0 +1,21 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const Cc = Components.classes;
const Ci = Components.interfaces;
const DELAY_MS = "2000";
let timer;
function handleRequest(req, resp) {
resp.processAsync();
resp.setHeader("Cache-Control", "no-cache", false);
resp.setHeader("Content-Type", "text/html;charset=utf-8", false);
timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
timer.init(() => {
resp.write("hi");
resp.finish();
}, DELAY_MS, Ci.nsITimer.TYPE_ONE_SHOT);
}

View File

@ -121,7 +121,7 @@
.newtab-site[type=affiliate] .newtab-thumbnail,
.newtab-site[type=organic] .newtab-thumbnail,
.newtab-site[type=sponsored] .newtab-thumbnail {
background-position: top center;
background-position: center center;
background-size: auto;
}

View File

@ -165,6 +165,11 @@ toolbarseparator {
min-height: 19px; /* 16px button height + 2px padding + 1px margin-bottom */
}
#nav-bar-customization-target > #wrapper-personal-bookmarks > #personal-bookmarks {
min-height: 32px;
-moz-box-align: center;
}
toolbarbutton.chevron {
list-style-image: url("chrome://global/skin/icons/chevron.png");
margin: 1px 0 0;

View File

@ -125,7 +125,7 @@
.newtab-site[type=affiliate] .newtab-thumbnail,
.newtab-site[type=organic] .newtab-thumbnail,
.newtab-site[type=sponsored] .newtab-thumbnail {
background-position: top center;
background-position: center center;
background-size: auto;
}

View File

@ -124,7 +124,7 @@
.newtab-site[type=affiliate] .newtab-thumbnail,
.newtab-site[type=organic] .newtab-thumbnail,
.newtab-site[type=sponsored] .newtab-thumbnail {
background-position: top center;
background-position: center center;
background-size: auto;
}

View File

@ -328,7 +328,7 @@ public class CodeGenerator {
if (!aNoThrow) {
wrapperMethodBodies.append(
" AndroidBridge::HandleUncaughtException(env);\n" +
" MOZ_ASSUME_UNREACHABLE(\"Exception should have caused crash.\");\n");
" MOZ_CRASH(\"Exception should have caused crash.\");\n");
} else {
wrapperMethodBodies.append(
" return").append(Utils.getFailureReturnForType(returnType)).append(";\n");

View File

@ -98,10 +98,12 @@ class RemoteAutomation(Automation):
return status
def deleteANRs(self):
# delete ANR traces.txt file; usually need root permissions
# empty ANR traces.txt file; usually need root permissions
# we make it empty and writable so we can test the ANR reporter later
traces = "/data/anr/traces.txt"
try:
self._devicemanager.shellCheckOutput(['rm', traces], root=True)
self._devicemanager.shellCheckOutput(['echo', '', '>', traces], root=True)
self._devicemanager.shellCheckOutput(['chmod', '666', traces], root=True)
except DMError:
print "Error deleting %s" % traces
pass

View File

@ -88,6 +88,9 @@ public:
MOZ_ASSERT(mPendingDecoders.IsEmpty());
return false;
}
MaybeSwitchVideoReaders(aTimeThreshold);
bool rv = GetVideoReader()->DecodeVideoFrame(aKeyFrameSkip, aTimeThreshold);
nsAutoTArray<VideoData*, 10> video;
@ -103,16 +106,6 @@ public:
MSE_DEBUG("%p MSR::DecodeVF %d (%p) returned false (readers=%u)",
this, mActiveVideoDecoder, mDecoders[mActiveVideoDecoder].get(), mDecoders.Length());
if (SwitchVideoReaders(aTimeThreshold)) {
rv = GetVideoReader()->DecodeVideoFrame(aKeyFrameSkip, aTimeThreshold);
nsAutoTArray<VideoData*, 10> video;
GetVideoReader()->VideoQueue().GetElementsAfter(-1, &video);
for (uint32_t i = 0; i < video.Length(); ++i) {
VideoQueue().Push(video[i]);
}
GetVideoReader()->VideoQueue().Empty();
}
return rv;
}
@ -136,14 +129,9 @@ public:
void CallDecoderInitialization();
private:
bool SwitchVideoReaders(int64_t aTimeThreshold) {
MOZ_ASSERT(mActiveVideoDecoder != -1);
// XXX: We switch when the first reader is depleted, but it might be
// better to switch as soon as the next reader is ready to decode and
// has data for the current media time.
void MaybeSwitchVideoReaders(int64_t aTimeThreshold) {
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
GetVideoReader()->SetIdle();
MOZ_ASSERT(mActiveVideoDecoder != -1);
WaitForPendingDecoders();
@ -151,15 +139,17 @@ private:
if (!mDecoders[i]->GetReader()->GetMediaInfo().HasVideo()) {
continue;
}
mActiveVideoDecoder = i;
MSE_DEBUG("%p MSR::DecodeVF switching to %d", this, mActiveVideoDecoder);
if (aTimeThreshold >= mDecoders[i]->GetMediaStartTime()) {
GetVideoReader()->SetIdle();
GetVideoReader()->SetActive();
GetVideoReader()->DecodeToTarget(aTimeThreshold);
mActiveVideoDecoder = i;
MSE_DEBUG("%p MSR::DecodeVF switching to %d", this, mActiveVideoDecoder);
return true;
GetVideoReader()->SetActive();
GetVideoReader()->DecodeToTarget(aTimeThreshold);
break;
}
}
return false;
}
MediaDecoderReader* GetAudioReader() {
@ -337,9 +327,13 @@ MediaSourceReader::CallDecoderInitialization()
MediaInfo mi;
nsAutoPtr<MetadataTags> tags; // TODO: Handle metadata.
nsresult rv;
int64_t startTime = 0;
{
ReentrantMonitorAutoExit exitMon(mDecoder->GetReentrantMonitor());
rv = reader->ReadMetadata(&mi, getter_Transfers(tags));
if (NS_SUCCEEDED(rv)) {
reader->FindStartTime(startTime);
}
}
reader->SetIdle();
if (NS_FAILED(rv)) {
@ -347,10 +341,12 @@ MediaSourceReader::CallDecoderInitialization()
MSE_DEBUG("%p: Reader %p failed to initialize, rv=%x", this, reader, rv);
continue;
}
decoder->SetMediaStartTime(startTime);
bool active = false;
if (mi.HasVideo() || mi.HasAudio()) {
MSE_DEBUG("%p: Reader %p has video=%d audio=%d", this, reader, mi.HasVideo(), mi.HasAudio());
MSE_DEBUG("%p: Reader %p has video=%d audio=%d startTime=%lld",
this, reader, mi.HasVideo(), mi.HasAudio(), startTime);
active = true;
}

View File

@ -196,16 +196,10 @@ SourceBuffer::GetBuffered(ErrorResult& aRv)
nsRefPtr<TimeRanges> r = new TimeRanges();
mDecoders[i]->GetBuffered(r);
if (r->Length() > 0) {
MSE_DEBUG("%p GetBuffered decoder=%u Length=%u Start=%f End=%f", this, i, r->Length(),
r->GetStartTime(), r->GetEndTime());
ranges->Add(r->GetStartTime(), r->GetEndTime());
} else {
MSE_DEBUG("%p GetBuffered decoder=%u Length=%u", this, i, r->Length());
}
}
ranges->Normalize();
MSE_DEBUG("%p GetBuffered Length=%u Start=%f End=%f", this, ranges->Length(),
ranges->GetStartTime(), ranges->GetEndTime());
return ranges.forget();
}

View File

@ -21,6 +21,7 @@ public:
// of the caller to manage the memory of the MediaResource object.
SubBufferDecoder(MediaResource* aResource, MediaSourceDecoder* aParentDecoder)
: BufferDecoder(aResource), mParentDecoder(aParentDecoder), mReader(nullptr)
, mMediaDuration(-1), mMediaStartTime(0)
{
}
@ -72,10 +73,21 @@ public:
return mMediaDuration;
}
int64_t GetMediaStartTime()
{
return mMediaStartTime;
}
void SetMediaStartTime(int64_t aMediaStartTime)
{
mMediaStartTime = aMediaStartTime;
}
private:
MediaSourceDecoder* mParentDecoder;
nsAutoPtr<MediaDecoderReader> mReader;
int64_t mMediaDuration;
int64_t mMediaStartTime;
};
} // namespace mozilla

View File

@ -441,7 +441,6 @@ skip-if = buildapp == 'b2g' # b2g(Value being assigned to HTMLMediaElement.curre
[test_texttrackregion.html]
[test_texttracklist.html]
[test_timeupdate_small_files.html]
skip-if = os == "linux" # Intermittent failures, bug 760770
[test_unseekable.html]
skip-if = buildapp == 'b2g'
[test_VideoPlaybackQuality.html]

View File

@ -74,13 +74,13 @@ function startTest(test, token) {
v._timeupdateCount = 0;
v._finished = false;
v.gotEnded = 0;
v.autoplay = true;
v.addEventListener("ended", ended, false);
v.addEventListener("timeupdate", timeupdate, false);
for (var i = 0; i < eventsToLog.length; ++i) {
v.addEventListener(eventsToLog[i], logEvent, false);
}
document.body.appendChild(v);
v.play();
}
manager.runTests(gSmallTests, startTest);

View File

@ -3989,6 +3989,13 @@ nsDOMWindowUtils::SetAudioVolume(float aVolume)
return window->SetAudioVolume(aVolume);
}
NS_IMETHODIMP
nsDOMWindowUtils::XpconnectArgument(nsIDOMWindowUtils* aThis)
{
// Do nothing.
return NS_OK;
}
NS_INTERFACE_MAP_BEGIN(nsTranslationNodeList)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_ENTRY(nsITranslationNodeList)

View File

@ -43,7 +43,7 @@ interface nsIRunnable;
interface nsICompositionStringSynthesizer;
interface nsITranslationNodeList;
[scriptable, uuid(9376bafe-e7b1-48e7-87e2-1e64a7b5d54d)]
[scriptable, uuid(d68ea9fa-b1ea-4744-a78e-bb0e6ef95f55)]
interface nsIDOMWindowUtils : nsISupports {
/**
@ -1672,6 +1672,12 @@ interface nsIDOMWindowUtils : nsISupports {
* volume of all ancestor windows.
*/
attribute float audioVolume;
/**
* This method doesn't do anything useful. It was solely added for the
* purpose of the test for bug 503926.
*/
void xpconnectArgument(in nsIDOMWindowUtils aThis);
};
[scriptable, uuid(c694e359-7227-4392-a138-33c0cc1f15a6)]

View File

@ -262,8 +262,7 @@ static void CopyDataSourceSurface(DataSourceSurface* aSource,
bool needsRBSwap = false;
if (aDest->GetFormat() == SurfaceFormat::B8G8R8A8 ||
aDest->GetFormat() == SurfaceFormat::B8G8R8X8 ||
aDest->GetFormat() == SurfaceFormat::R5G6B5) {
aDest->GetFormat() == SurfaceFormat::B8G8R8X8) {
needsRBSwap = true;
}
@ -508,7 +507,7 @@ ReadPixelsIntoImageSurface(GLContext* gl, gfxImageSurface* dest) {
}
void
ReadPixelsIntoDataSourceSurface(GLContext* gl, DataSourceSurface* dest) {
ReadPixelsIntoDataSurface(GLContext* gl, DataSourceSurface* dest) {
gl->MakeCurrent();
MOZ_ASSERT(dest->GetSize().width != 0);
MOZ_ASSERT(dest->GetSize().height != 0);
@ -839,7 +838,7 @@ GLReadTexImageHelper::ReadTexImage(GLuint aTextureId,
mGL->fDisableVertexAttribArray(0);
/* Read-back draw results */
ReadPixelsIntoDataSourceSurface(mGL, isurf);
ReadPixelsIntoDataSurface(mGL, isurf);
CLEANUP_IF_GLERROR_OCCURRED("when reading pixels into surface");
} while (false);

View File

@ -24,6 +24,8 @@ class DataSourceSurface;
namespace gl {
void ReadPixelsIntoDataSurface(GLContext* aGL,
gfx::DataSourceSurface* aSurface);
void ReadPixelsIntoImageSurface(GLContext* aGL, gfxImageSurface* aSurface);
void ReadScreenIntoImageSurface(GLContext* aGL, gfxImageSurface* aSurface);

View File

@ -381,7 +381,7 @@ GLScreenBuffer::Morph(SurfaceFactory_GL* newFactory, SurfaceStreamType streamTyp
mStream = newStream;
}
void
bool
GLScreenBuffer::Attach(SharedSurface* surface, const gfx::IntSize& size)
{
ScopedBindFramebuffer autoFB(mGL);
@ -400,9 +400,17 @@ GLScreenBuffer::Attach(SharedSurface* surface, const gfx::IntSize& size)
mRead->Attach(surf);
} else {
// Else something changed, so resize:
DrawBuffer* draw = CreateDraw(size); // Can be null.
DrawBuffer* draw = nullptr;
bool drawOk = CreateDraw(size, &draw); // Can be null.
ReadBuffer* read = CreateRead(surf);
MOZ_ASSERT(read); // Should never fail if SwapProd succeeded.
bool readOk = !!read;
if (!drawOk || !readOk) {
delete draw;
delete read;
return false;
}
delete mDraw;
delete mRead;
@ -417,6 +425,8 @@ GLScreenBuffer::Attach(SharedSurface* surface, const gfx::IntSize& size)
if (!PreserveBuffer()) {
// DiscardFramebuffer here could help perf on some mobile platforms.
}
return true;
}
bool
@ -433,9 +443,7 @@ GLScreenBuffer::Swap(const gfx::IntSize& size)
}
MOZ_ASSERT(nextSurf);
Attach(nextSurf, size);
return true;
return Attach(nextSurf, size);
}
bool
@ -454,18 +462,17 @@ GLScreenBuffer::Resize(const gfx::IntSize& size)
if (!surface)
return false;
Attach(surface, size);
return true;
return Attach(surface, size);
}
DrawBuffer*
GLScreenBuffer::CreateDraw(const gfx::IntSize& size)
bool
GLScreenBuffer::CreateDraw(const gfx::IntSize& size, DrawBuffer** out_buffer)
{
GLContext* gl = mFactory->GL();
const GLFormats& formats = mFactory->Formats();
const SurfaceCaps& caps = mFactory->DrawCaps();
return DrawBuffer::Create(gl, caps, formats, size);
return DrawBuffer::Create(gl, caps, formats, size, out_buffer);
}
ReadBuffer*
@ -482,58 +489,47 @@ void
GLScreenBuffer::Readback(SharedSurface_GL* src, DataSourceSurface* dest)
{
MOZ_ASSERT(src && dest);
DataSourceSurface::MappedSurface ms;
dest->Map(DataSourceSurface::MapType::READ, &ms);
nsRefPtr<gfxImageSurface> wrappedDest =
new gfxImageSurface(ms.mData,
ThebesIntSize(dest->GetSize()),
ms.mStride,
SurfaceFormatToImageFormat(dest->GetFormat()));
DeprecatedReadback(src, wrappedDest);
dest->Unmap();
MOZ_ASSERT(dest->GetSize() == src->Size());
MOZ_ASSERT(dest->GetFormat() == (src->HasAlpha() ? SurfaceFormat::B8G8R8A8
: SurfaceFormat::B8G8R8X8));
mGL->MakeCurrent();
bool needsSwap = src != SharedSurf();
if (needsSwap) {
SharedSurf()->UnlockProd();
src->LockProd();
}
ReadBuffer* buffer = CreateRead(src);
MOZ_ASSERT(buffer);
ScopedBindFramebuffer autoFB(mGL, buffer->FB());
ReadPixelsIntoDataSurface(mGL, dest);
delete buffer;
if (needsSwap) {
src->UnlockProd();
SharedSurf()->LockProd();
}
}
void
GLScreenBuffer::DeprecatedReadback(SharedSurface_GL* src, gfxImageSurface* dest)
{
MOZ_ASSERT(src && dest);
MOZ_ASSERT(ToIntSize(dest->GetSize()) == src->Size());
MOZ_ASSERT(dest->Format() == (src->HasAlpha() ? gfxImageFormat::ARGB32
: gfxImageFormat::RGB24));
mGL->MakeCurrent();
bool needsSwap = src != SharedSurf();
if (needsSwap) {
SharedSurf()->UnlockProd();
src->LockProd();
}
ReadBuffer* buffer = CreateRead(src);
MOZ_ASSERT(buffer);
ScopedBindFramebuffer autoFB(mGL, buffer->FB());
ReadPixelsIntoImageSurface(mGL, dest);
delete buffer;
if (needsSwap) {
src->UnlockProd();
SharedSurf()->LockProd();
}
}
DrawBuffer*
bool
DrawBuffer::Create(GLContext* const gl,
const SurfaceCaps& caps,
const GLFormats& formats,
const gfx::IntSize& size)
const gfx::IntSize& size,
DrawBuffer** out_buffer)
{
MOZ_ASSERT(out_buffer);
*out_buffer = nullptr;
if (!caps.color) {
MOZ_ASSERT(!caps.alpha && !caps.depth && !caps.stencil);
// Nothing is needed.
return nullptr;
return true;
}
GLuint colorMSRB = 0;
@ -567,9 +563,15 @@ DrawBuffer::Create(GLContext* const gl,
GLuint fb = 0;
gl->fGenFramebuffers(1, &fb);
gl->AttachBuffersToFB(0, colorMSRB, depthRB, stencilRB, fb);
MOZ_ASSERT(gl->IsFramebufferComplete(fb));
return new DrawBuffer(gl, size, fb, colorMSRB, depthRB, stencilRB);
ScopedDeletePtr<DrawBuffer> buffer;
buffer = new DrawBuffer(gl, size, fb, colorMSRB, depthRB, stencilRB);
if (!gl->IsFramebufferComplete(fb))
return false;
*out_buffer = buffer.forget();
return true;
}
DrawBuffer::~DrawBuffer()
@ -639,11 +641,15 @@ ReadBuffer::Create(GLContext* gl,
gl->AttachBuffersToFB(colorTex, colorRB, depthRB, stencilRB, fb, target);
gl->mFBOMapping[fb] = surf;
MOZ_ASSERT(gl->IsFramebufferComplete(fb));
return new ReadBuffer(gl,
fb, depthRB, stencilRB,
surf);
ScopedDeletePtr<ReadBuffer> buffer;
buffer = new ReadBuffer(gl,
fb, depthRB, stencilRB,
surf);
if (!gl->IsFramebufferComplete(fb))
return nullptr;
return buffer.forget();
}
ReadBuffer::~ReadBuffer()

View File

@ -46,11 +46,13 @@ protected:
typedef struct gfx::SurfaceCaps SurfaceCaps;
public:
// Infallible, may return null if unneeded.
static DrawBuffer* Create(GLContext* const gl,
const SurfaceCaps& caps,
const GLFormats& formats,
const gfx::IntSize& size);
// Fallible!
// But it may return true with *out_buffer==nullptr if unneeded.
static bool Create(GLContext* const gl,
const SurfaceCaps& caps,
const GLFormats& formats,
const gfx::IntSize& size,
DrawBuffer** out_buffer);
protected:
GLContext* const mGL;
@ -280,12 +282,11 @@ public:
bool Resize(const gfx::IntSize& size);
void Readback(SharedSurface_GL* src, gfx::DataSourceSurface* dest);
void DeprecatedReadback(SharedSurface_GL* src, gfxImageSurface* dest);
protected:
void Attach(SharedSurface* surface, const gfx::IntSize& size);
bool Attach(SharedSurface* surface, const gfx::IntSize& size);
DrawBuffer* CreateDraw(const gfx::IntSize& size);
bool CreateDraw(const gfx::IntSize& size, DrawBuffer** out_buffer);
ReadBuffer* CreateRead(SharedSurface_GL* surf);
public:

View File

@ -322,18 +322,8 @@ void
SharedSurface_Basic::Fence()
{
mGL->MakeCurrent();
ScopedBindFramebuffer autoFB(mGL, mFB);
DataSourceSurface::MappedSurface map;
mData->Map(DataSourceSurface::MapType::WRITE, &map);
nsRefPtr<gfxImageSurface> wrappedData =
new gfxImageSurface(map.mData,
ThebesIntSize(mData->GetSize()),
map.mStride,
SurfaceFormatToImageFormat(mData->GetFormat()));
ReadPixelsIntoImageSurface(mGL, wrappedData);
mData->Unmap();
ReadPixelsIntoDataSurface(mGL, mData);
}

View File

@ -1328,16 +1328,7 @@ CompositorOGL::CopyToTarget(DrawTarget *aTarget, const gfx::Matrix& aTransform)
RefPtr<DataSourceSurface> source =
Factory::CreateDataSourceSurface(rect.Size(), gfx::SurfaceFormat::B8G8R8A8);
DataSourceSurface::MappedSurface map;
source->Map(DataSourceSurface::MapType::WRITE, &map);
// XXX we should do this properly one day without using the gfxImageSurface
nsRefPtr<gfxImageSurface> surf =
new gfxImageSurface(map.mData,
gfxIntSize(width, height),
map.mStride,
gfxImageFormat::ARGB32);
ReadPixelsIntoImageSurface(mGLContext, surf);
source->Unmap();
ReadPixelsIntoDataSurface(mGLContext, source);
// Map from GL space to Cairo space and reverse the world transform.
Matrix glToCairoTransform = aTransform;

View File

@ -199,7 +199,9 @@ static bool
CompileRegExpObject(JSContext *cx, RegExpObjectBuilder &builder, CallArgs args)
{
if (args.length() == 0) {
RegExpStatics *res = cx->global()->getRegExpStatics();
RegExpStatics *res = cx->global()->getRegExpStatics(cx);
if (!res)
return false;
Rooted<JSAtom*> empty(cx, cx->runtime()->emptyString);
RegExpObject *reobj = builder.build(empty, res->getFlags());
if (!reobj)
@ -284,7 +286,9 @@ CompileRegExpObject(JSContext *cx, RegExpObjectBuilder &builder, CallArgs args)
if (!js::RegExpShared::checkSyntax(cx, nullptr, escapedSourceStr))
return false;
RegExpStatics *res = cx->global()->getRegExpStatics();
RegExpStatics *res = cx->global()->getRegExpStatics(cx);
if (!res)
return false;
RegExpObject *reobj = builder.build(escapedSourceStr, RegExpFlag(flags | res->getFlags()));
if (!reobj)
return false;
@ -387,7 +391,9 @@ static const JSFunctionSpec regexp_methods[] = {
name(JSContext *cx, unsigned argc, Value *vp) \
{ \
CallArgs args = CallArgsFromVp(argc, vp); \
RegExpStatics *res = cx->global()->getRegExpStatics(); \
RegExpStatics *res = cx->global()->getRegExpStatics(cx); \
if (!res) \
return false; \
code; \
}
@ -413,7 +419,9 @@ DEFINE_STATIC_GETTER(static_paren9_getter, return res->createParen(cx, 9,
static bool \
name(JSContext *cx, unsigned argc, Value *vp) \
{ \
RegExpStatics *res = cx->global()->getRegExpStatics(); \
RegExpStatics *res = cx->global()->getRegExpStatics(cx); \
if (!res) \
return false; \
code; \
return true; \
}
@ -422,7 +430,9 @@ static bool
static_input_setter(JSContext *cx, unsigned argc, Value *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
RegExpStatics *res = cx->global()->getRegExpStatics();
RegExpStatics *res = cx->global()->getRegExpStatics(cx);
if (!res)
return false;
RootedString str(cx, ToString<CanGC>(cx, args.get(0)));
if (!str)
@ -437,7 +447,9 @@ static bool
static_multiline_setter(JSContext *cx, unsigned argc, Value *vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
RegExpStatics *res = cx->global()->getRegExpStatics();
RegExpStatics *res = cx->global()->getRegExpStatics(cx);
if (!res)
return false;
bool b = ToBoolean(args.get(0));
res->setMultiline(cx, b);
@ -521,9 +533,14 @@ js::ExecuteRegExp(JSContext *cx, HandleObject regexp, HandleString string,
if (!reobj->getShared(cx, &re))
return RegExpRunStatus_Error;
RegExpStatics *res = (staticsUpdate == UpdateRegExpStatics)
? cx->global()->getRegExpStatics()
: nullptr;
RegExpStatics *res;
if (staticsUpdate == UpdateRegExpStatics) {
res = cx->global()->getRegExpStatics(cx);
if (!res)
return RegExpRunStatus_Error;
} else {
res = nullptr;
}
/* Step 3. */
Rooted<JSLinearString*> input(cx, string->ensureLinear(cx));

View File

@ -3994,20 +3994,12 @@ Parser<ParseHandler>::doWhileStatement()
return null();
PopStatementPC(tokenStream, pc);
if (versionNumber() == JSVERSION_ECMA_3) {
// Pedantically require a semicolon or line break, following ES3.
// Bug 880329 proposes removing this case.
if (!MatchOrInsertSemicolon(tokenStream))
return null();
} else {
// The semicolon after do-while is even more optional than most
// semicolons in JS. Web compat required this by 2004:
// http://bugzilla.mozilla.org/show_bug.cgi?id=238945
// ES3 and ES5 disagreed, but ES6 conforms to Web reality:
// https://bugs.ecmascript.org/show_bug.cgi?id=157
(void) tokenStream.matchToken(TOK_SEMI);
}
// The semicolon after do-while is even more optional than most
// semicolons in JS. Web compat required this by 2004:
// http://bugzilla.mozilla.org/show_bug.cgi?id=238945
// ES3 and ES5 disagreed, but ES6 conforms to Web reality:
// https://bugs.ecmascript.org/show_bug.cgi?id=157
tokenStream.matchToken(TOK_SEMI);
return handler.newDoWhileStatement(body, cond, TokenPos(begin, pos().end));
}
@ -6918,11 +6910,11 @@ Parser<ParseHandler>::newRegExp()
RegExpFlag flags = tokenStream.currentToken().regExpFlags();
Rooted<RegExpObject*> reobj(context);
if (RegExpStatics *res = context->global()->getRegExpStatics())
reobj = RegExpObject::create(context, res, chars, length, flags, &tokenStream);
else
reobj = RegExpObject::createNoStatics(context, chars, length, flags, &tokenStream);
RegExpStatics *res = context->global()->getRegExpStatics(context);
if (!res)
return null();
reobj = RegExpObject::create(context, res, chars, length, flags, &tokenStream);
if (!reobj)
return null();

View File

@ -9423,11 +9423,17 @@ IonBuilder::jsop_regexp(RegExpObject *reobj)
bool mustClone = true;
types::TypeObjectKey *typeObj = types::TypeObjectKey::get(&script()->global());
if (!typeObj->hasFlags(constraints(), types::OBJECT_FLAG_REGEXP_FLAGS_SET)) {
RegExpStatics *res = script()->global().getRegExpStatics();
DebugOnly<uint32_t> origFlags = reobj->getFlags();
DebugOnly<uint32_t> staticsFlags = res->getFlags();
JS_ASSERT((origFlags & staticsFlags) == staticsFlags);
#ifdef DEBUG
// Only compare the statics if the one on script()->global() has been
// instantiated.
if (script()->global().hasRegExpStatics()) {
RegExpStatics *res = script()->global().getAlreadyCreatedRegExpStatics();
MOZ_ASSERT(res);
uint32_t origFlags = reobj->getFlags();
uint32_t staticsFlags = res->getFlags();
JS_ASSERT((origFlags & staticsFlags) == staticsFlags);
}
#endif
if (!reobj->global() && !reobj->sticky())
mustClone = false;

View File

@ -5735,7 +5735,10 @@ JS_NewRegExpObject(JSContext *cx, HandleObject obj, char *bytes, size_t length,
if (!chars)
return nullptr;
RegExpStatics *res = obj->as<GlobalObject>().getRegExpStatics();
RegExpStatics *res = obj->as<GlobalObject>().getRegExpStatics(cx);
if (!res)
return nullptr;
RegExpObject *reobj = RegExpObject::create(cx, res, chars, length,
RegExpFlag(flags), nullptr);
js_free(chars);
@ -5748,29 +5751,42 @@ JS_NewUCRegExpObject(JSContext *cx, HandleObject obj, jschar *chars, size_t leng
{
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
RegExpStatics *res = obj->as<GlobalObject>().getRegExpStatics();
RegExpStatics *res = obj->as<GlobalObject>().getRegExpStatics(cx);
if (!res)
return nullptr;
return RegExpObject::create(cx, res, chars, length,
RegExpFlag(flags), nullptr);
}
JS_PUBLIC_API(void)
JS_PUBLIC_API(bool)
JS_SetRegExpInput(JSContext *cx, HandleObject obj, HandleString input, bool multiline)
{
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, input);
obj->as<GlobalObject>().getRegExpStatics()->reset(cx, input, !!multiline);
RegExpStatics *res = obj->as<GlobalObject>().getRegExpStatics(cx);
if (!res)
return false;
res->reset(cx, input, !!multiline);
return true;
}
JS_PUBLIC_API(void)
JS_PUBLIC_API(bool)
JS_ClearRegExpStatics(JSContext *cx, HandleObject obj)
{
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
JS_ASSERT(obj);
obj->as<GlobalObject>().getRegExpStatics()->clear();
RegExpStatics *res = obj->as<GlobalObject>().getRegExpStatics(cx);
if (!res)
return false;
res->clear();
return true;
}
JS_PUBLIC_API(bool)
@ -5780,7 +5796,9 @@ JS_ExecuteRegExp(JSContext *cx, HandleObject obj, HandleObject reobj, jschar *ch
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
RegExpStatics *res = obj->as<GlobalObject>().getRegExpStatics();
RegExpStatics *res = obj->as<GlobalObject>().getRegExpStatics(cx);
if (!res)
return false;
return ExecuteRegExpLegacy(cx, res, reobj->as<RegExpObject>(), NullPtr(), chars, length, indexp,
test, rval);

View File

@ -4543,11 +4543,11 @@ extern JS_PUBLIC_API(JSObject *)
JS_NewUCRegExpObject(JSContext *cx, JS::HandleObject obj, jschar *chars, size_t length,
unsigned flags);
extern JS_PUBLIC_API(void)
extern JS_PUBLIC_API(bool)
JS_SetRegExpInput(JSContext *cx, JS::HandleObject obj, JS::HandleString input,
bool multiline);
extern JS_PUBLIC_API(void)
extern JS_PUBLIC_API(bool)
JS_ClearRegExpStatics(JSContext *cx, JS::HandleObject obj);
extern JS_PUBLIC_API(bool)

View File

@ -2115,7 +2115,10 @@ js::str_match(JSContext *cx, unsigned argc, Value *vp)
if (!g.normalizeRegExp(cx, false, 1, args))
return false;
RegExpStatics *res = cx->global()->getRegExpStatics();
RegExpStatics *res = cx->global()->getRegExpStatics(cx);
if (!res)
return false;
Rooted<JSLinearString*> linearStr(cx, str->ensureLinear(cx));
if (!linearStr)
return false;
@ -2156,7 +2159,9 @@ js::str_search(JSContext *cx, unsigned argc, Value *vp)
const jschar *chars = linearStr->chars();
size_t length = linearStr->length();
RegExpStatics *res = cx->global()->getRegExpStatics();
RegExpStatics *res = cx->global()->getRegExpStatics(cx);
if (!res)
return false;
/* Per ECMAv5 15.5.4.12 (5) The last index property is ignored and left unchanged. */
size_t i = 0;
@ -2829,16 +2834,26 @@ StrReplaceRegexpRemove(JSContext *cx, HandleString str, RegExpShared &re, Mutabl
break;
}
RegExpStatics *res;
/* If unmatched, return the input string. */
if (!lastIndex) {
if (startIndex > 0)
cx->global()->getRegExpStatics()->updateLazily(cx, flatStr, &re, lazyIndex);
if (startIndex > 0) {
res = cx->global()->getRegExpStatics(cx);
if (!res)
return false;
res->updateLazily(cx, flatStr, &re, lazyIndex);
}
rval.setString(str);
return true;
}
/* The last successful match updates the RegExpStatics. */
cx->global()->getRegExpStatics()->updateLazily(cx, flatStr, &re, lazyIndex);
res = cx->global()->getRegExpStatics(cx);
if (!res)
return false;
res->updateLazily(cx, flatStr, &re, lazyIndex);
/* Include any remaining part of the string. */
if (lastIndex < charsLen) {
@ -2866,7 +2881,10 @@ StrReplaceRegExp(JSContext *cx, ReplaceData &rdata, MutableHandleValue rval)
rdata.leftIndex = 0;
rdata.calledBack = false;
RegExpStatics *res = cx->global()->getRegExpStatics();
RegExpStatics *res = cx->global()->getRegExpStatics(cx);
if (!res)
return false;
RegExpShared &re = rdata.g.regExp();
// The spec doesn't describe this function very clearly, so we go ahead and
@ -3283,7 +3301,10 @@ SplitHelper(JSContext *cx, Handle<JSLinearString*> str, uint32_t limit, const Ma
/* Step 13(c)(iii)(6-7). */
if (Matcher::returnsCaptures) {
RegExpStatics *res = cx->global()->getRegExpStatics();
RegExpStatics *res = cx->global()->getRegExpStatics(cx);
if (!res)
return nullptr;
const MatchPairs &matches = res->getMatches();
for (size_t i = 0; i < matches.parenCount(); i++) {
/* Steps 13(c)(iii)(7)(a-c). */
@ -3494,7 +3515,10 @@ js::str_split(JSContext *cx, unsigned argc, Value *vp)
aobj = SplitHelper(cx, linearStr, limit, matcher, type);
}
} else {
SplitRegExpMatcher matcher(*re, cx->global()->getRegExpStatics());
RegExpStatics *res = cx->global()->getRegExpStatics(cx);
if (!res)
return false;
SplitRegExpMatcher matcher(*re, res);
aobj = SplitHelper(cx, linearStr, limit, matcher, type);
}
if (!aobj)

View File

@ -565,12 +565,6 @@ GlobalObject::create(JSContext *cx, const Class *clasp)
if (!global->setDelegate(cx))
return nullptr;
/* Construct a regexp statics object for this global object. */
JSObject *res = RegExpStatics::create(cx, global);
if (!res)
return nullptr;
global->initSlot(REGEXP_STATICS, ObjectValue(*res));
return global;
}
@ -783,6 +777,41 @@ GlobalObject::getOrCreateForOfPICObject(JSContext *cx, Handle<GlobalObject *> gl
return forOfPIC;
}
bool
GlobalObject::hasRegExpStatics() const
{
return !getSlot(REGEXP_STATICS).isUndefined();
}
RegExpStatics *
GlobalObject::getRegExpStatics(ExclusiveContext *cx) const
{
MOZ_ASSERT(cx);
Rooted<GlobalObject*> self(cx, const_cast<GlobalObject*>(this));
JSObject *resObj = nullptr;
const Value &val = this->getSlot(REGEXP_STATICS);
if (!val.isObject()) {
MOZ_ASSERT(val.isUndefined());
resObj = RegExpStatics::create(cx, self);
if (!resObj)
return nullptr;
self->initSlot(REGEXP_STATICS, ObjectValue(*resObj));
} else {
resObj = &val.toObject();
}
return static_cast<RegExpStatics*>(resObj->getPrivate(/* nfixed = */ 1));
}
RegExpStatics *
GlobalObject::getAlreadyCreatedRegExpStatics() const
{
const Value &val = this->getSlot(REGEXP_STATICS);
MOZ_ASSERT(val.isObject());
return static_cast<RegExpStatics*>(val.toObject().getPrivate(/* nfixed = */ 1));
}
bool
GlobalObject::getSelfHostedFunction(JSContext *cx, HandleAtom selfHostedName, HandleAtom name,
unsigned nargs, MutableHandleValue funVal)

View File

@ -592,10 +592,9 @@ class GlobalObject : public JSObject
bool getSelfHostedFunction(JSContext *cx, HandleAtom selfHostedName, HandleAtom name,
unsigned nargs, MutableHandleValue funVal);
RegExpStatics *getRegExpStatics() const {
JSObject &resObj = getSlot(REGEXP_STATICS).toObject();
return static_cast<RegExpStatics *>(resObj.getPrivate(/* nfixed = */ 1));
}
bool hasRegExpStatics() const;
RegExpStatics *getRegExpStatics(ExclusiveContext *cx) const;
RegExpStatics *getAlreadyCreatedRegExpStatics() const;
JSObject *getThrowTypeError() const {
JS_ASSERT(functionObjectClassesInitialized());

View File

@ -106,7 +106,10 @@ RegExpObjectBuilder::clone(Handle<RegExpObject *> other)
* the clone -- if the |RegExpStatics| provides more flags we'll
* need a different |RegExpShared|.
*/
RegExpStatics *res = other->getProto()->getParent()->as<GlobalObject>().getRegExpStatics();
RegExpStatics *res = other->getProto()->getParent()->as<GlobalObject>().getRegExpStatics(cx);
if (!res)
return nullptr;
RegExpFlag origFlags = other->getFlags();
RegExpFlag staticsFlags = res->getFlags();
if ((origFlags & staticsFlags) != staticsFlags) {

View File

@ -15,8 +15,8 @@ using namespace js;
/*
* RegExpStatics allocates memory -- in order to keep the statics stored
* per-global and not leak, we create a js::Class to wrap the C++ instance and
* provide an appropriate finalizer. We store an instance of that js::Class in
* a global reserved slot.
* provide an appropriate finalizer. We lazily create and store an instance of
* that js::Class in a global reserved slot.
*/
static void
@ -53,7 +53,7 @@ const Class RegExpStaticsObject::class_ = {
};
JSObject *
RegExpStatics::create(JSContext *cx, GlobalObject *parent)
RegExpStatics::create(ExclusiveContext *cx, GlobalObject *parent)
{
JSObject *obj = NewObjectWithGivenProto(cx, &RegExpStaticsObject::class_, nullptr, parent);
if (!obj)
@ -74,7 +74,7 @@ RegExpStatics::markFlagsSet(JSContext *cx)
// type changes on RegExp.prototype, so mark a state change to trigger
// recompilation of all such code (when recompiling, a stub call will
// always be performed).
JS_ASSERT(this == cx->global()->getRegExpStatics());
JS_ASSERT_IF(cx->global()->hasRegExpStatics(), this == cx->global()->getRegExpStatics(cx));
types::MarkTypeObjectFlags(cx, cx->global(), types::OBJECT_FLAG_REGEXP_FLAGS_SET);
}

View File

@ -47,7 +47,7 @@ class RegExpStatics
public:
RegExpStatics() : bufferLink(nullptr), copied(false) { clear(); }
static JSObject *create(JSContext *cx, GlobalObject *parent);
static JSObject *create(ExclusiveContext *cx, GlobalObject *parent);
private:
bool executeLazy(JSContext *cx);

View File

@ -17,6 +17,8 @@ class RegExpStaticsObject : public JSObject
static const Class class_;
size_t sizeOfData(mozilla::MallocSizeOf mallocSizeOf) {
// XXX: should really call RegExpStatics::sizeOfIncludingThis() here
// instead, but the extra memory it would measure is insignificant.
return mallocSizeOf(getPrivate());
}
};

View File

@ -19,7 +19,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=503926
getInterface(Components.interfaces.nsIDOMWindowUtils);
var passed = false;
var obj = { QueryInterface: function() { passed = true; } }
try { gWindowUtils.dispatchDOMEventViaPresShell(obj, obj, false); } catch (e) {}
gWindowUtils.xpconnectArgument(obj);
var isDialog = location.hash != '#iframe';
var outer = XPCNativeWrapper.unwrap(isDialog ? opener : top);
outer.ok(passed, "chrome/chrome test passed: " + (isDialog ? "dialog" : "iframe"));

View File

@ -29,7 +29,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=503926
getInterface(Components.interfaces.nsIDOMWindowUtils);
var passed = false;
var obj = { QueryInterface: function() { passed = true; } };
try { gWindowUtils.dispatchDOMEventViaPresShell(obj, obj, false); } catch (e) {}
gWindowUtils.xpconnectArgument(obj);
ok(passed, "trusted QIs should be called");
openDialog("bug503926.xul", "chromeDialog", "modal");

View File

@ -20,7 +20,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=503926
/** Test for Bug 503926 **/
var passed = true;
var obj = { QueryInterface: function() { passed = false; } };
try { document.body.appendChild(obj); } catch (e) {}
SpecialPowers.getDOMWindowUtils(window).xpconnectArgument(obj);
ok(passed, "untrusted QI should not be called!");
</script>

View File

@ -10,6 +10,7 @@ skip-if = processor == "x86"
skip-if = android_version == "10"
[testAdobeFlash]
skip-if = processor == "x86"
[testANRReporter]
[testAwesomebar]
[testAxisLocking]
# disabled on x86 only; bug 927476

View File

@ -0,0 +1,229 @@
package org.mozilla.gecko.tests;
import org.mozilla.gecko.AppConstants;
import android.content.Context;
import android.content.Intent;
import com.jayway.android.robotium.solo.Condition;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import org.json.JSONObject;
/**
* Tests the proper operation of the ANR reporter.
*/
public class testANRReporter extends BaseTest {
private static final String ANR_ACTION = "android.intent.action.ANR";
private static final String PING_DIR = "saved-telemetry-pings";
private static final int WAIT_FOR_PING_TIMEOUT = 10000;
private static final String ANR_PATH = "/data/anr/traces.txt";
private static final String SAMPLE_ANR
= "----- pid 1 at 2014-01-15 18:55:51 -----\n"
+ "Cmd line: " + AppConstants.ANDROID_PACKAGE_NAME + "\n"
+ "\n"
+ "JNI: CheckJNI is off; workarounds are off; pins=0; globals=397\n"
+ "\n"
+ "DALVIK THREADS:\n"
+ "(mutexes: tll=0 tsl=0 tscl=0 ghl=0)\n"
+ "\n"
+ "\"main\" prio=5 tid=1 WAIT\n"
+ " | group=\"main\" sCount=1 dsCount=0 obj=0x41d6bc90 self=0x41d5a3c8\n"
+ " | sysTid=3485 nice=0 sched=0/0 cgrp=apps handle=1074852180\n"
+ " | state=S schedstat=( 0 0 0 ) utm=1065 stm=152 core=0\n"
+ " at java.lang.Object.wait(Native Method)\n"
+ " - waiting on <0x427ab340> (a org.mozilla.gecko.GeckoEditable$5)\n"
+ " at java.lang.Object.wait(Object.java:364)\n"
+ " at org.mozilla.gecko.GeckoEditable$5.run(GeckoEditable.java:746)\n"
+ " at android.os.Handler.handleCallback(Handler.java:733)\n"
+ " at android.os.Handler.dispatchMessage(Handler.java:95)\n"
+ " at android.os.Looper.loop(Looper.java:137)\n"
+ " at android.app.ActivityThread.main(ActivityThread.java:4998)\n"
+ " at java.lang.reflect.Method.invokeNative(Native Method)\n"
+ " at java.lang.reflect.Method.invoke(Method.java:515)\n"
+ " at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)\n"
+ " at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)\n"
+ " at dalvik.system.NativeStart.main(Native Method)\n"
+ "\n"
+ "\"Gecko\" prio=5 tid=16 SUSPENDED\n"
+ " | group=\"main\" sCount=1 dsCount=0 obj=0x426e2b28 self=0x76ae92e8\n"
+ " | sysTid=3541 nice=0 sched=0/0 cgrp=apps handle=1991153472\n"
+ " | state=S schedstat=( 0 0 0 ) utm=1118 stm=145 core=0\n"
+ " #00 pc 00000904 /system/lib/libc.so (__futex_syscall3+4294832136)\n"
+ " #01 pc 0000eec4 /system/lib/libc.so (__pthread_cond_timedwait_relative+48)\n"
+ " #02 pc 0000ef24 /system/lib/libc.so (__pthread_cond_timedwait+64)\n"
+ " #03 pc 000536b7 /system/lib/libdvm.so\n"
+ " #04 pc 00053c79 /system/lib/libdvm.so (dvmChangeStatus(Thread*, ThreadStatus)+34)\n"
+ " #05 pc 00049507 /system/lib/libdvm.so\n"
+ " #06 pc 0004d84b /system/lib/libdvm.so\n"
+ " #07 pc 0003f1df /dev/ashmem/libxul.so (deleted)\n"
+ " at org.mozilla.gecko.mozglue.GeckoLoader.nativeRun(Native Method)\n"
+ " at org.mozilla.gecko.GeckoAppShell.runGecko(GeckoAppShell.java:384)\n"
+ " at org.mozilla.gecko.GeckoThread.run(GeckoThread.java:177)\n"
+ "\n"
+ "----- end 1 -----\n"
+ "\n"
+ "\n"
+ "----- pid 2 at 2013-01-25 13:27:01 -----\n"
+ "Cmd line: system_server\n"
+ "\n"
+ "----- end 2 -----\n";
private boolean mDone;
private JSONObject readPingFile(final File pingFile) throws Exception {
final long fileSize = pingFile.length();
if (fileSize == 0 || fileSize > Integer.MAX_VALUE) {
throw new Exception("Invalid ping file size");
}
final char[] buffer = new char[(int) fileSize];
final FileReader reader = new FileReader(pingFile);
try {
final int readSize = reader.read(buffer);
if (readSize == 0 || readSize > buffer.length) {
throw new Exception("Invalid number of bytes read");
}
} finally {
reader.close();
}
return new JSONObject(new String(buffer));
}
public void testANRReporter() throws Exception {
blockForGeckoReady();
// Cannot test ANR reporter if it's disabled.
if (!AppConstants.MOZ_ANDROID_ANR_REPORTER) {
mAsserter.ok(true, "ANR reporter is disabled", null);
return;
}
// For the ANR reporter to work, we need to provide sample ANR traces to it.
// Therefore, we need the ANR file to exist and writable. If not, we don't
// have the right permissions to create the file, so we just bail.
final File anrFile = new File(ANR_PATH);
if (!anrFile.exists()) {
mAsserter.ok(true, "ANR file does not exist", null);
return;
}
if (!anrFile.canWrite()) {
mAsserter.ok(true, "ANR file is not writable", null);
return;
}
final FileWriter anrWriter = new FileWriter(anrFile);
try {
anrWriter.write(SAMPLE_ANR);
} finally {
anrWriter.close();
}
// Block the UI thread to simulate an ANR
final Runnable uiBlocker = new Runnable() {
@Override
public synchronized void run() {
while (!mDone) {
try {
wait();
} catch (final InterruptedException e) {
}
}
}
};
getActivity().runOnUiThread(uiBlocker);
// Make sure our initial ping directory is empty.
final File pingDir = new File(mProfile, PING_DIR);
final String[] initialFiles = pingDir.list();
mAsserter.ok(initialFiles == null || initialFiles.length == 0,
"Ping directory is empty", null);
final Intent anrIntent = new Intent(ANR_ACTION);
anrIntent.setPackage(AppConstants.ANDROID_PACKAGE_NAME);
mAsserter.is(anrIntent.getPackage(), AppConstants.ANDROID_PACKAGE_NAME,
"Successfully set package name");
final Context testContext = getInstrumentation().getContext();
mAsserter.isnot(testContext, null, "testContext should not be null");
// Trigger the ANR.
mAsserter.info("Triggering ANR", null);
testContext.sendBroadcast(anrIntent);
// ANR reporter is supposed to ignore duplicate ANRs.
// This will be checked later when we look for ping files.
mAsserter.info("Triggering second ANR", null);
testContext.sendBroadcast(new Intent(anrIntent));
mAsserter.info("Waiting for ping", null);
waitForCondition(new Condition() {
@Override
public boolean isSatisfied() {
final File[] newFiles = pingDir.listFiles();
if (newFiles == null || newFiles.length == 0) {
// Keep waiting.
return false;
}
// Make sure we have a complete file. We skip assertions and catch all
// exceptions here because the condition may not be satisfied now but may
// be satisfied later. After the wait is over, we will repeat the same
// steps with assertions and exceptions.
try {
return readPingFile(newFiles[0]).has("slug");
} catch (final Exception e) {
return false;
}
}
}, WAIT_FOR_PING_TIMEOUT);
mAsserter.ok(pingDir.exists(), "Ping directory exists", null);
mAsserter.ok(pingDir.isDirectory(), "Ping directory is a directory", null);
final File[] newFiles = pingDir.listFiles();
mAsserter.isnot(newFiles, null, "Ping directory is not empty");
mAsserter.is(newFiles.length, 1, "ANR reporter wrote one ping");
mAsserter.ok(newFiles[0].exists(), "Ping exists", null);
mAsserter.ok(newFiles[0].isFile(), "Ping is a file", null);
mAsserter.ok(newFiles[0].canRead(), "Ping is readable", null);
mAsserter.info("Found ping file", newFiles[0].getPath());
// Check standard properties required by Telemetry server.
final JSONObject pingObject = readPingFile(newFiles[0]);
mAsserter.ok(pingObject.has("slug"), "Ping has slug property", null);
mAsserter.ok(pingObject.has("reason"), "Ping has reason property", null);
mAsserter.ok(pingObject.has("payload"), "Ping has payload property", null);
final JSONObject pingPayload = pingObject.getJSONObject("payload");
mAsserter.ok(pingPayload.has("ver"), "Payload has ver property", null);
mAsserter.ok(pingPayload.has("info"), "Payload has info property", null);
mAsserter.ok(pingPayload.has("androidANR"), "Payload has androidANR property", null);
final JSONObject pingInfo = pingPayload.getJSONObject("info");
mAsserter.ok(pingInfo.has("reason"), "Info has reason property", null);
mAsserter.ok(pingInfo.has("appName"), "Info has appName property", null);
mAsserter.ok(pingInfo.has("appUpdateChannel"), "Info has appUpdateChannel property", null);
mAsserter.ok(pingInfo.has("appVersion"), "Info has appVersion property", null);
mAsserter.ok(pingInfo.has("appBuildID"), "Info has appBuildID property", null);
// Do some profile clean up. This is not absolutely necessary because the profile
// is blown away after test runs anyways, so we don't check return values here.
for (final File ping : newFiles) {
ping.delete();
}
pingDir.delete();
// Unblock UI thread
synchronized (uiBlocker) {
mDone = true;
uiBlocker.notify();
}
// Clear the sample ANR
final FileWriter anrClearer = new FileWriter(anrFile);
anrClearer.close();
}
}

View File

@ -147,9 +147,7 @@ var SelectionHandler = {
// Ignore IMM composition notifications when caret movement starts
this._ignoreCompositionChanges = true;
// Send a click event to the text box, which positions the caret
this._sendMouseEvents(data.x, data.y);
this._moveCaret(data.x, data.y);
// Move the handle directly under the caret
this._positionHandles();
@ -763,7 +761,7 @@ var SelectionHandler = {
*/
_moveSelection: function sh_moveSelection(aIsStartHandle, aX, aY) {
// XXX We should be smarter about the coordinates we pass to caretPositionFromPoint, especially
// in editable targets. We should factor out the logic that's currently in _sendMouseEvents.
// in editable targets. We should factor out the logic that's currently in _moveCaret.
let viewOffset = this._getViewOffset();
let caretPos = this._contentWindow.document.caretPositionFromPoint(aX - viewOffset.x, aY - viewOffset.y);
if (!caretPos) {
@ -810,56 +808,49 @@ var SelectionHandler = {
}
},
_sendMouseEvents: function sh_sendMouseEvents(aX, aY, useShift) {
// If we're positioning a cursor in an input field, make sure the handle
// stays within the bounds of the field
if (this._activeType == this.TYPE_CURSOR) {
// Get rect of text inside element
let range = document.createRange();
range.selectNodeContents(this._targetElement.QueryInterface(Ci.nsIDOMNSEditableElement).editor.rootElement);
let textBounds = range.getBoundingClientRect();
_moveCaret: function sh_moveCaret(aX, aY) {
// Get rect of text inside element
let range = document.createRange();
range.selectNodeContents(this._targetElement.QueryInterface(Ci.nsIDOMNSEditableElement).editor.rootElement);
let textBounds = range.getBoundingClientRect();
// Get rect of editor
let editorBounds = this._domWinUtils.sendQueryContentEvent(this._domWinUtils.QUERY_EDITOR_RECT, 0, 0, 0, 0,
this._domWinUtils.QUERY_CONTENT_FLAG_USE_XP_LINE_BREAK);
// the return value from sendQueryContentEvent is in LayoutDevice pixels and we want CSS pixels, so
// divide by the pixel ratio
let editorRect = new Rect(editorBounds.left / window.devicePixelRatio,
editorBounds.top / window.devicePixelRatio,
editorBounds.width / window.devicePixelRatio,
editorBounds.height / window.devicePixelRatio);
// Get rect of editor
let editorBounds = this._domWinUtils.sendQueryContentEvent(this._domWinUtils.QUERY_EDITOR_RECT, 0, 0, 0, 0,
this._domWinUtils.QUERY_CONTENT_FLAG_USE_XP_LINE_BREAK);
// the return value from sendQueryContentEvent is in LayoutDevice pixels and we want CSS pixels, so
// divide by the pixel ratio
let editorRect = new Rect(editorBounds.left / window.devicePixelRatio,
editorBounds.top / window.devicePixelRatio,
editorBounds.width / window.devicePixelRatio,
editorBounds.height / window.devicePixelRatio);
// Use intersection of the text rect and the editor rect
let rect = new Rect(textBounds.left, textBounds.top, textBounds.width, textBounds.height);
rect.restrictTo(editorRect);
// Use intersection of the text rect and the editor rect
let rect = new Rect(textBounds.left, textBounds.top, textBounds.width, textBounds.height);
rect.restrictTo(editorRect);
// Clamp vertically and scroll if handle is at bounds. The top and bottom
// must be restricted by an additional pixel since clicking on the top
// edge of an input field moves the cursor to the beginning of that
// field's text (and clicking the bottom moves the cursor to the end).
if (aY < rect.y + 1) {
aY = rect.y + 1;
this._getSelectionController().scrollLine(false);
} else if (aY > rect.y + rect.height - 1) {
aY = rect.y + rect.height - 1;
this._getSelectionController().scrollLine(true);
}
// Clamp horizontally and scroll if handle is at bounds
if (aX < rect.x) {
aX = rect.x;
this._getSelectionController().scrollCharacter(false);
} else if (aX > rect.x + rect.width) {
aX = rect.x + rect.width;
this._getSelectionController().scrollCharacter(true);
}
} else if (this._activeType == this.TYPE_SELECTION) {
// Send mouse event 1px too high to prevent selection from entering the line below where it should be
aY -= 1;
// Clamp vertically and scroll if handle is at bounds. The top and bottom
// must be restricted by an additional pixel since clicking on the top
// edge of an input field moves the cursor to the beginning of that
// field's text (and clicking the bottom moves the cursor to the end).
if (aY < rect.y + 1) {
aY = rect.y + 1;
this._getSelectionController().scrollLine(false);
} else if (aY > rect.y + rect.height - 1) {
aY = rect.y + rect.height - 1;
this._getSelectionController().scrollLine(true);
}
this._domWinUtils.sendMouseEventToWindow("mousedown", aX, aY, 0, 0, useShift ? Ci.nsIDOMNSEvent.SHIFT_MASK : 0, true);
this._domWinUtils.sendMouseEventToWindow("mouseup", aX, aY, 0, 0, useShift ? Ci.nsIDOMNSEvent.SHIFT_MASK : 0, true);
// Clamp horizontally and scroll if handle is at bounds
if (aX < rect.x) {
aX = rect.x;
this._getSelectionController().scrollCharacter(false);
} else if (aX > rect.x + rect.width) {
aX = rect.x + rect.width;
this._getSelectionController().scrollCharacter(true);
}
this._domWinUtils.sendMouseEventToWindow("mousedown", aX, aY, 0, 0, 0, true);
this._domWinUtils.sendMouseEventToWindow("mouseup", aX, aY, 0, 0, 0, true);
},
copySelection: function sh_copySelection() {

View File

@ -698,8 +698,14 @@ FxAccountsInternal.prototype = {
// Login is truly complete once keys have been fetched, so once getKeys()
// obtains and stores kA and kB, it will fire the onverified observer
// notification.
return this.whenVerified(data)
.then(() => this.getKeys());
// The callers of startVerifiedCheck never consume a returned promise (ie,
// this is simply kicking off a background fetch) so we must add a rejection
// handler to avoid runtime warnings about the rejection not being handled.
this.whenVerified(data).then(
() => this.getKeys(),
err => log.info("startVerifiedCheck promise was rejected: " + err)
);
},
whenVerified: function(data) {

View File

@ -321,9 +321,16 @@ add_test(function test_fetchAndUnwrapKeys_no_token() {
});
});
fxa.setSignedInUser(user).then((user) => {
fxa.internal.fetchAndUnwrapKeys();
});
fxa.setSignedInUser(user).then(
user => {
return fxa.internal.fetchAndUnwrapKeys();
}
).then(
null,
error => {
log.info("setSignedInUser correctly rejected");
}
)
});
// Alice (User A) signs up but never verifies her email. Then Bob (User B)

View File

@ -2,37 +2,48 @@
# 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/.
import os
from marionette_test import MarionetteTestCase
from marionette import JavascriptException
# boiler plate for the initial navigation and frame switch
def switch_to_window_verify(test, start_url, frame, verify_title, verify_url):
test.assertTrue(test.marionette.execute_script("window.location.href = 'about:blank'; return true;"))
test.assertEqual("about:blank", test.marionette.execute_script("return window.location.href;"))
test_html = test.marionette.absolute_url(start_url)
test.marionette.navigate(test_html)
test.assertEqual(test.marionette.get_active_frame(), None)
test.assertNotEqual("about:blank", test.marionette.execute_script("return window.location.href;"))
test.assertEqual(verify_title, test.marionette.title)
test.marionette.switch_to_default_content()
test.marionette.switch_to_frame(frame)
test.assertTrue(verify_url in test.marionette.get_url())
inner_frame_element = test.marionette.get_active_frame()
# test that we can switch back to main frame, then switch back to the
# inner frame with the value we got from get_active_frame
test.marionette.switch_to_frame()
test.assertEqual(verify_title, test.marionette.title)
test.marionette.switch_to_frame(inner_frame_element)
test.assertTrue(verify_url in test.marionette.get_url())
class TestSwitchFrame(MarionetteTestCase):
def test_switch_simple(self):
switch_to_window_verify(self, "test_iframe.html", "test_iframe", "Marionette IFrame Test", "test.html")
start_url = "test_iframe.html"
verify_title = "Marionette IFrame Test"
verify_url = "test.html"
test_html = self.marionette.absolute_url(start_url)
self.marionette.navigate(test_html)
self.assertEqual(self.marionette.get_active_frame(), None)
frame = self.marionette.find_element("id", "test_iframe")
self.marionette.switch_to_frame(frame)
self.assertTrue(verify_url in self.marionette.get_url())
inner_frame_element = self.marionette.get_active_frame()
# test that we can switch back to main frame, then switch back to the
# inner frame with the value we got from get_active_frame
self.marionette.switch_to_frame()
self.assertEqual(verify_title, self.marionette.title)
self.marionette.switch_to_frame(inner_frame_element)
self.assertTrue(verify_url in self.marionette.get_url())
def test_switch_nested(self):
switch_to_window_verify(self, "test_nested_iframe.html", "test_iframe", "Marionette IFrame Test", "test_inner_iframe.html")
self.marionette.switch_to_frame("inner_frame")
start_url = "test_nested_iframe.html"
verify_title = "Marionette IFrame Test"
verify_url = "test_inner_iframe.html"
test_html = self.marionette.absolute_url(start_url)
self.marionette.navigate(test_html)
frame = self.marionette.find_element("id", "test_iframe")
self.assertEqual(self.marionette.get_active_frame(), None)
self.marionette.switch_to_frame(frame)
self.assertTrue(verify_url in self.marionette.get_url())
inner_frame_element = self.marionette.get_active_frame()
# test that we can switch back to main frame, then switch back to the
# inner frame with the value we got from get_active_frame
self.marionette.switch_to_frame()
self.assertEqual(verify_title, self.marionette.title)
self.marionette.switch_to_frame(inner_frame_element)
self.assertTrue(verify_url in self.marionette.get_url())
inner_frame = self.marionette.find_element('id', 'inner_frame')
self.marionette.switch_to_frame(inner_frame)
self.assertTrue("test.html" in self.marionette.get_url())
self.marionette.switch_to_frame() # go back to main frame
self.assertTrue("test_nested_iframe.html" in self.marionette.get_url())
@ -40,7 +51,23 @@ class TestSwitchFrame(MarionetteTestCase):
self.assertTrue("test_nested_iframe.html" in self.marionette.execute_script("return window.location.href;"))
def test_stack_trace(self):
switch_to_window_verify(self, "test_iframe.html", "test_iframe", "Marionette IFrame Test", "test.html")
start_url = "test_iframe.html"
verify_title = "Marionette IFrame Test"
verify_url = "test.html"
test_html = self.marionette.absolute_url(start_url)
self.marionette.navigate(test_html)
frame = self.marionette.find_element("id", "test_iframe")
self.assertEqual(self.marionette.get_active_frame(), None)
self.marionette.switch_to_frame(frame)
self.assertTrue(verify_url in self.marionette.get_url())
inner_frame_element = self.marionette.get_active_frame()
# test that we can switch back to main frame, then switch back to the
# inner frame with the value we got from get_active_frame
self.marionette.switch_to_frame()
self.assertEqual(verify_title, self.marionette.title)
self.marionette.switch_to_frame(inner_frame_element)
self.assertTrue(verify_url in self.marionette.get_url())
#can't use assertRaises in context manager with python2.6
self.assertRaises(JavascriptException, self.marionette.execute_async_script, "foo();")
try:
@ -48,12 +75,13 @@ class TestSwitchFrame(MarionetteTestCase):
except JavascriptException as e:
self.assertTrue("foo" in e.msg)
def testShouldBeAbleToCarryOnWorkingIfTheFrameIsDeletedFromUnderUs(self):
def test_should_be_able_to_carry_on_working_if_the_frame_is_deleted_from_under_us(self):
test_html = self.marionette.absolute_url("deletingFrame.html")
self.marionette.navigate(test_html)
self.marionette.switch_to_frame("iframe1");
killIframe = self.marionette.find_element("id" ,"killIframe")
self.marionette.switch_to_frame(self.marionette.find_element('id',
'iframe1'))
killIframe = self.marionette.find_element("id", "killIframe")
killIframe.click()
self.marionette.switch_to_frame()
@ -63,11 +91,12 @@ class TestSwitchFrame(MarionetteTestCase):
addIFrame.click()
self.marionette.find_element("id", "iframe1")
self.marionette.switch_to_frame("iframe1");
self.marionette.switch_to_frame(self.marionette.find_element("id",
"iframe1"))
self.marionette.find_element("id", "checkbox")
def testShouldAllowAUserToSwitchFromAnIframeBackToTheMainContentOfThePage(self):
def test_should_allow_a_user_to_switch_from_an_iframe_back_to_the_main_content_of_the_page(self):
test_iframe = self.marionette.absolute_url("test_iframe.html")
self.marionette.navigate(test_iframe)
self.marionette.switch_to_frame(0)
@ -75,3 +104,18 @@ class TestSwitchFrame(MarionetteTestCase):
header = self.marionette.find_element("id", "iframe_page_heading")
self.assertEqual(header.text, "This is the heading")
def test_should_be_able_to_switch_to_a_frame_by_its_index(self):
test_html = self.marionette.absolute_url("frameset.html")
self.marionette.navigate(test_html)
self.marionette.switch_to_frame(2)
element = self.marionette.find_element("id", "email")
self.assertEquals("email", element.get_attribute("type"))
def test_should_be_able_to_switch_to_a_frame_using_a_previously_located_element(self):
test_html = self.marionette.absolute_url("frameset.html")
self.marionette.navigate(test_html)
frame = self.marionette.find_element("name", "third")
self.marionette.switch_to_frame(frame)
element = self.marionette.find_element("id", "email")
self.assertEquals("email", element.get_attribute("type"))

View File

@ -40,7 +40,8 @@ class TestSwitchRemoteFrame(MarionetteTestCase):
iframe.src = "%s";
document.body.appendChild(iframe);
""" % self.marionette.absolute_url("test.html"))
self.marionette.switch_to_frame("remote_iframe")
remote_iframe = self.marionette.find_element("id", "remote_iframe")
self.marionette.switch_to_frame(remote_iframe)
main_process = self.marionette.execute_script("""
return SpecialPowers.isMainProcess();
""")
@ -60,7 +61,8 @@ class TestSwitchRemoteFrame(MarionetteTestCase):
iframe.src = "%s";
document.body.appendChild(iframe);
""" % self.marionette.absolute_url("test.html"))
self.marionette.switch_to_frame("remote_iframe")
self.marionette.switch_to_frame(self.marionette.find_element("id",
"remote_iframe"))
main_process = self.marionette.execute_script("""
return SpecialPowers.isMainProcess();
""")
@ -70,7 +72,8 @@ class TestSwitchRemoteFrame(MarionetteTestCase):
return SpecialPowers.isMainProcess();
""")
self.assertTrue(main_process)
self.marionette.switch_to_frame("remote_iframe")
self.marionette.switch_to_frame(self.marionette.find_element("id",
"remote_iframe"))
main_process = self.marionette.execute_script("""
return SpecialPowers.isMainProcess();
""")

View File

@ -85,6 +85,7 @@ browser = false
[test_switch_frame.py]
[test_switch_frame_chrome.py]
[test_switch_remote_frame.py]
browser = false
[test_pagesource.py]
b2g = false

View File

@ -0,0 +1,14 @@
<html>
<head>
<title>Unique title</title>
</head>
<frameset cols="*, *, *, *, *, *, *">
<frame name="first" src="page/1"/>
<frame name="second" src="page/2?title=Fish"/>
<frame name="third" src="formPage.html"/>
<frame name="fourth" src="framesetPage2.html"/>
<frame id="fifth" src="xhtmlTest.html"/>
<frame id="sixth" src="iframes.html"/>
<frame id="sixth.iframe1" src="page/3"/>
</frameset>
</html>

View File

@ -0,0 +1,7 @@
<html>
<head></head>
<frameset cols="*, *">
<frame name="child1" src="page/10"/>
<frame name="child2" src="page/11"/>
</frameset>
</html>

View File

@ -11,5 +11,6 @@
<h1 id="iframe_page_heading">This is the heading</h1>
<iframe src="test.html" id="test_iframe"></iframe>
<iframe src="test.html" id="test_iframe" name="test_iframe_name"></iframe>
</body>
</html>

View File

@ -95,7 +95,7 @@ FrameManager.prototype = {
}
},
//This is just 'switch to OOP frame'. We're handling this here so we can maintain a list of remoteFrames.
//This is just 'switch to OOP frame'. We're handling this here so we can maintain a list of remoteFrames.
switchToFrame: function FM_switchToFrame(message) {
// Switch to a remote frame.
let frameWindow = Services.wm.getOuterWindowWithId(message.json.win); //get the original frame window
@ -126,7 +126,7 @@ FrameManager.prototype = {
}
}
// If we get here, then we need to load the frame script in this frame,
// If we get here, then we need to load the frame script in this frame,
// and set the frame's ChromeMessageSender as the active message manager the server will listen to
this.addMessageManagerListeners(mm);
logger.info("frame-manager load script: " + mm.toString());

View File

@ -1807,11 +1807,11 @@ function switchToFrame(msg) {
checkTimer.initWithCallback(checkLoad, 100, Ci.nsITimer.TYPE_ONE_SHOT);
}
let foundFrame = null;
let frames = []; //curFrame.document.getElementsByTagName("iframe");
let parWindow = null; //curFrame.QueryInterface(Ci.nsIInterfaceRequestor)
let frames = [];
let parWindow = null;
// Check of the curFrame reference is dead
try {
frames = curFrame.document.getElementsByTagName("iframe");
frames = curFrame.frames;
//Until Bug 761935 lands, we won't have multiple nested OOP iframes. We will only have one.
//parWindow will refer to the iframe above the nested OOP frame.
parWindow = curFrame.QueryInterface(Ci.nsIInterfaceRequestor)
@ -1823,7 +1823,8 @@ function switchToFrame(msg) {
msg.json.id = null;
msg.json.element = null;
}
if ((msg.json.id == null) && (msg.json.element == null)) {
if ((msg.json.id === null || msg.json.id === undefined) && (msg.json.element == null)) {
// returning to root frame
sendSyncMessage("Marionette:switchedToFrame", { frameValue: null });
@ -1839,52 +1840,45 @@ function switchToFrame(msg) {
if (elementManager.seenItems[msg.json.element] != undefined) {
let wantedFrame;
try {
wantedFrame = elementManager.getKnownElement(msg.json.element, curFrame); //HTMLIFrameElement
wantedFrame = elementManager.getKnownElement(msg.json.element, curFrame); //Frame Element
}
catch(e) {
sendError(e.message, e.code, e.stack, command_id);
}
for (let i = 0; i < frames.length; i++) {
// use XPCNativeWrapper to compare elements; see bug 834266
if (XPCNativeWrapper(frames[i]) == XPCNativeWrapper(wantedFrame)) {
curFrame = frames[i];
foundFrame = i;
if (frames.length > 0) {
for (let i = 0; i < frames.length; i++) {
// use XPCNativeWrapper to compare elements; see bug 834266
if (XPCNativeWrapper(frames[i].frameElement) == XPCNativeWrapper(wantedFrame)) {
curFrame = frames[i].frameElement;
foundFrame = i;
}
}
}
if (foundFrame == null) {
// Either the frame has been removed or we have a OOP frame
// so lets just get all the iframes and do a quick loop before
// throwing in the towel
let iframes = curFrame.document.getElementsByTagName("iframe");
for (var i = 0; i < iframes.length; i++) {
if (XPCNativeWrapper(iframes[i]) == XPCNativeWrapper(wantedFrame)) {
curFrame = iframes[i];
foundFrame = i;
}
}
}
}
}
if (foundFrame == null) {
switch(typeof(msg.json.id)) {
case "string" :
let foundById = null;
for (let i = 0; i < frames.length; i++) {
//give precedence to name
let frame = frames[i];
let name = utils.getElementAttribute(frame, 'name');
let id = utils.getElementAttribute(frame, 'id');
if (name == msg.json.id) {
foundFrame = i;
break;
} else if ((foundById == null) && (id == msg.json.id)) {
foundById = i;
}
}
if ((foundFrame == null) && (foundById != null)) {
foundFrame = foundById;
curFrame = frames[foundFrame];
}
break;
case "number":
if (frames[msg.json.id] != undefined) {
foundFrame = msg.json.id;
curFrame = frames[foundFrame];
}
break;
if (typeof(msg.json.id) === 'number') {
foundFrame = frames[msg.json.id].frameElement;
curFrame = foundFrame;
foundFrame = elementManager.addToKnownElements(curFrame);
}
}
if (foundFrame == null) {
sendError("Unable to locate frame: " + msg.json.id, 8, null, command_id);
return;
sendError("Unable to locate frame: " + (msg.json.id || msg.json.element), 8, null, command_id);
return true;
}
sandbox = null;
@ -1898,8 +1892,8 @@ function switchToFrame(msg) {
// The frame we want to switch to is a remote (out-of-process) frame;
// notify our parent to handle the switch.
curFrame = content;
sendToServer('Marionette:switchToFrame', {frame: foundFrame,
win: parWindow,
sendToServer('Marionette:switchToFrame', {win: parWindow,
frame: foundFrame,
command_id: command_id});
}
else {

View File

@ -54,6 +54,7 @@ user_pref("font.size.inflation.minTwips", 0);
// AddonManager tests require that the experiments provider be present.
user_pref("experiments.supported", true);
user_pref("experiments.logging.level", "Trace");
user_pref("experiments.logging.dump", true);
// Point the manifest at something local so we don't risk it hitting production
// data and installing experiments that may vary over time.
user_pref("experiments.manifest.uri", "http://%(server)s/experiments-dummy/manifest");

File diff suppressed because one or more lines are too long

View File

@ -283,13 +283,15 @@ void TableTicker::StreamJSObject(JSStreamWriter& b)
}
}
// Send a event asking any subprocesses (plugins) to
// give us their information
SubprocessClosure closure(&b);
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
if (os) {
nsRefPtr<ProfileSaveEvent> pse = new ProfileSaveEvent(SubProcessCallback, &closure);
os->NotifyObservers(pse, "profiler-subprocess", nullptr);
if (Sampler::CanNotifyObservers()) {
// Send a event asking any subprocesses (plugins) to
// give us their information
SubprocessClosure closure(&b);
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
if (os) {
nsRefPtr<ProfileSaveEvent> pse = new ProfileSaveEvent(SubProcessCallback, &closure);
os->NotifyObservers(pse, "profiler-subprocess", nullptr);
}
}
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
@ -306,7 +308,6 @@ void TableTicker::StreamJSObject(JSStreamWriter& b)
b.EndArray();
b.EndObject();
}
// END SaveProfileTask et al

View File

@ -698,9 +698,11 @@ void mozilla_sampler_start(int aProfileEntries, double aInterval,
sIsProfiling = true;
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
if (os)
os->NotifyObservers(nullptr, "profiler-started", nullptr);
if (Sampler::CanNotifyObservers()) {
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
if (os)
os->NotifyObservers(nullptr, "profiler-started", nullptr);
}
LOG("END mozilla_sampler_start");
}
@ -749,9 +751,11 @@ void mozilla_sampler_stop()
sIsProfiling = false;
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
if (os)
os->NotifyObservers(nullptr, "profiler-stopped", nullptr);
if (Sampler::CanNotifyObservers()) {
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
if (os)
os->NotifyObservers(nullptr, "profiler-stopped", nullptr);
}
LOG("END mozilla_sampler_stop");
}

View File

@ -44,6 +44,7 @@
#include "mozilla/unused.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/Mutex.h"
#include "MainThreadUtils.h"
#include "PlatformMacros.h"
#include "v8-support.h"
#include <vector>
@ -353,6 +354,17 @@ class Sampler {
static void SetActiveSampler(TableTicker* sampler) { sActiveSampler = sampler; }
static mozilla::Mutex* sRegisteredThreadsMutex;
static bool CanNotifyObservers() {
#if defined(SPS_OS_android) && !defined(MOZ_WIDGET_GONK)
// Android ANR reporter uses the profiler off the main thread
return NS_IsMainThread();
#else
MOZ_ASSERT(NS_IsMainThread());
return true;
#endif
}
protected:
static std::vector<ThreadInfo*>* sRegisteredThreads;
static TableTicker* sActiveSampler;

View File

@ -179,7 +179,7 @@ void GeckoAppShell::AcknowledgeEvent() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jAcknowledgeEvent);
@ -191,7 +191,7 @@ void GeckoAppShell::AddPluginViewWrapper(jobject a0, jfloat a1, jfloat a2, jfloa
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[6];
@ -211,7 +211,7 @@ void GeckoAppShell::AlertsProgressListener_OnProgress(const nsAString& a0, int64
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[4];
@ -229,7 +229,7 @@ void GeckoAppShell::CancelVibrate() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jCancelVibrate);
@ -241,7 +241,7 @@ void GeckoAppShell::CheckURIVisited(const nsAString& a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
@ -255,7 +255,7 @@ void GeckoAppShell::ClearMessageList(int32_t a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jClearMessageList, a0);
@ -267,7 +267,7 @@ void GeckoAppShell::CloseCamera() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jCloseCamera);
@ -279,7 +279,7 @@ void GeckoAppShell::CloseNotification(const nsAString& a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
@ -293,7 +293,7 @@ void GeckoAppShell::CreateMessageListWrapper(int64_t a0, int64_t a1, jobjectArra
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[7];
@ -314,7 +314,7 @@ void GeckoAppShell::CreateShortcut(const nsAString& a0, const nsAString& a1, con
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(4) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[4];
@ -332,7 +332,7 @@ void GeckoAppShell::DeleteMessageWrapper(int32_t a0, int32_t a1) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jDeleteMessageWrapper, a0, a1);
@ -344,7 +344,7 @@ void GeckoAppShell::DisableBatteryNotifications() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableBatteryNotifications);
@ -356,7 +356,7 @@ void GeckoAppShell::DisableNetworkNotifications() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableNetworkNotifications);
@ -368,7 +368,7 @@ void GeckoAppShell::DisableScreenOrientationNotifications() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableScreenOrientationNotifications);
@ -380,7 +380,7 @@ void GeckoAppShell::DisableSensor(int32_t a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jDisableSensor, a0);
@ -392,7 +392,7 @@ void GeckoAppShell::EnableBatteryNotifications() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableBatteryNotifications);
@ -404,7 +404,7 @@ void GeckoAppShell::EnableLocation(bool a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableLocation, a0);
@ -416,7 +416,7 @@ void GeckoAppShell::EnableLocationHighAccuracy(bool a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableLocationHighAccuracy, a0);
@ -428,7 +428,7 @@ void GeckoAppShell::EnableNetworkNotifications() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableNetworkNotifications);
@ -440,7 +440,7 @@ void GeckoAppShell::EnableScreenOrientationNotifications() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableScreenOrientationNotifications);
@ -452,7 +452,7 @@ void GeckoAppShell::EnableSensor(int32_t a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jEnableSensor, a0);
@ -464,7 +464,7 @@ jobject GeckoAppShell::GetContext() {
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetContext);
@ -477,7 +477,7 @@ jdoubleArray GeckoAppShell::GetCurrentBatteryInformationWrapper() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetCurrentBatteryInformationWrapper);
@ -490,7 +490,7 @@ jdoubleArray GeckoAppShell::GetCurrentNetworkInformationWrapper() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetCurrentNetworkInformationWrapper);
@ -503,7 +503,7 @@ jfloat GeckoAppShell::GetDensity() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jfloat temp = env->CallStaticFloatMethod(mGeckoAppShellClass, jGetDensity);
@ -516,7 +516,7 @@ int32_t GeckoAppShell::GetDpiWrapper() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
int32_t temp = env->CallStaticIntMethod(mGeckoAppShellClass, jGetDpiWrapper);
@ -529,7 +529,7 @@ jstring GeckoAppShell::GetExtensionFromMimeTypeWrapper(const nsAString& a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
@ -544,7 +544,7 @@ jobjectArray GeckoAppShell::GetHandlersForMimeTypeWrapper(const nsAString& a0, c
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(3) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
@ -560,7 +560,7 @@ jobjectArray GeckoAppShell::GetHandlersForURLWrapper(const nsAString& a0, const
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(3) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
@ -576,7 +576,7 @@ jbyteArray GeckoAppShell::GetIconForExtensionWrapper(const nsAString& a0, int32_
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
@ -591,7 +591,7 @@ void GeckoAppShell::GetMessageWrapper(int32_t a0, int32_t a1) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jGetMessageWrapper, a0, a1);
@ -603,7 +603,7 @@ jstring GeckoAppShell::GetMimeTypeFromExtensionsWrapper(const nsAString& a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
@ -618,7 +618,7 @@ void GeckoAppShell::GetNextMessageInListWrapper(int32_t a0, int32_t a1) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jGetNextMessageInListWrapper, a0, a1);
@ -630,7 +630,7 @@ jstring GeckoAppShell::GetProxyForURIWrapper(const nsAString& a0, const nsAStrin
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(4) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[4];
@ -649,7 +649,7 @@ int32_t GeckoAppShell::GetScreenDepthWrapper() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
int32_t temp = env->CallStaticIntMethod(mGeckoAppShellClass, jGetScreenDepthWrapper);
@ -662,7 +662,7 @@ int16_t GeckoAppShell::GetScreenOrientationWrapper() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
int16_t temp = env->CallStaticShortMethod(mGeckoAppShellClass, jGetScreenOrientationWrapper);
@ -675,7 +675,7 @@ bool GeckoAppShell::GetShowPasswordSetting() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jGetShowPasswordSetting);
@ -688,7 +688,7 @@ jintArray GeckoAppShell::GetSystemColoursWrapper() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jobject temp = env->CallStaticObjectMethod(mGeckoAppShellClass, jGetSystemColoursWrapper);
@ -701,7 +701,7 @@ void GeckoAppShell::HandleGeckoMessageWrapper(jobject a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jHandleGeckoMessageWrapper, a0);
@ -723,7 +723,7 @@ void GeckoAppShell::HideProgressDialog() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jHideProgressDialog);
@ -735,7 +735,7 @@ jintArray GeckoAppShell::InitCameraWrapper(const nsAString& a0, int32_t a1, int3
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[4];
@ -754,7 +754,7 @@ bool GeckoAppShell::IsNetworkLinkKnown() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jIsNetworkLinkKnown);
@ -767,7 +767,7 @@ bool GeckoAppShell::IsNetworkLinkUp() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jIsNetworkLinkUp);
@ -780,7 +780,7 @@ bool GeckoAppShell::IsTablet() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jIsTablet);
@ -793,7 +793,7 @@ void GeckoAppShell::KillAnyZombies() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jKillAnyZombies);
@ -805,7 +805,7 @@ jclass GeckoAppShell::LoadPluginClass(const nsAString& a0, const nsAString& a1)
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(3) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
@ -821,7 +821,7 @@ void GeckoAppShell::LockScreenOrientation(int32_t a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jLockScreenOrientation, a0);
@ -833,7 +833,7 @@ void GeckoAppShell::MarkURIVisited(const nsAString& a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
@ -847,7 +847,7 @@ void GeckoAppShell::MoveTaskToBack() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jMoveTaskToBack);
@ -859,7 +859,7 @@ int32_t GeckoAppShell::NetworkLinkType() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
int32_t temp = env->CallStaticIntMethod(mGeckoAppShellClass, jNetworkLinkType);
@ -872,7 +872,7 @@ void GeckoAppShell::NotifyDefaultPrevented(bool a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyDefaultPrevented, a0);
@ -884,7 +884,7 @@ void GeckoAppShell::NotifyIME(int32_t a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyIME, a0);
@ -896,7 +896,7 @@ void GeckoAppShell::NotifyIMEChange(const nsAString& a0, int32_t a1, int32_t a2,
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[4];
@ -914,7 +914,7 @@ void GeckoAppShell::NotifyIMEContext(int32_t a0, const nsAString& a1, const nsAS
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(3) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[4];
@ -932,7 +932,7 @@ void GeckoAppShell::NotifyWakeLockChanged(const nsAString& a0, const nsAString&
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
@ -947,7 +947,7 @@ void GeckoAppShell::NotifyXreExit() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jNotifyXreExit);
@ -959,7 +959,7 @@ bool GeckoAppShell::OpenUriExternal(const nsAString& a0, const nsAString& a1, co
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(6) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[6];
@ -980,7 +980,7 @@ void GeckoAppShell::PerformHapticFeedback(bool a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jPerformHapticFeedback, a0);
@ -992,7 +992,7 @@ bool GeckoAppShell::PumpMessageLoop() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jPumpMessageLoop);
@ -1005,7 +1005,7 @@ void GeckoAppShell::RegisterSurfaceTextureFrameListener(jobject a0, int32_t a1)
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jRegisterSurfaceTextureFrameListener, a0, a1);
@ -1017,7 +1017,7 @@ void GeckoAppShell::RemovePluginView(jobject a0, bool a1) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jRemovePluginView, a0, a1);
@ -1029,7 +1029,7 @@ void GeckoAppShell::ScanMedia(const nsAString& a0, const nsAString& a1) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
@ -1044,7 +1044,7 @@ void GeckoAppShell::ScheduleRestart() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jScheduleRestart);
@ -1056,7 +1056,7 @@ void GeckoAppShell::SendMessageWrapper(const nsAString& a0, const nsAString& a1,
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[3];
@ -1073,7 +1073,7 @@ void GeckoAppShell::SetFullScreen(bool a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jSetFullScreen, a0);
@ -1085,7 +1085,7 @@ void GeckoAppShell::SetKeepScreenOn(bool a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jSetKeepScreenOn, a0);
@ -1097,7 +1097,7 @@ void GeckoAppShell::SetURITitle(const nsAString& a0, const nsAString& a1) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
@ -1112,7 +1112,7 @@ void GeckoAppShell::ShowAlertNotificationWrapper(const nsAString& a0, const nsAS
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(5) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[5];
@ -1131,7 +1131,7 @@ void GeckoAppShell::ShowInputMethodPicker() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jShowInputMethodPicker);
@ -1143,7 +1143,7 @@ bool GeckoAppShell::UnlockProfile() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
bool temp = env->CallStaticBooleanMethod(mGeckoAppShellClass, jUnlockProfile);
@ -1156,7 +1156,7 @@ void GeckoAppShell::UnlockScreenOrientation() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jUnlockScreenOrientation);
@ -1168,7 +1168,7 @@ void GeckoAppShell::UnregisterSurfaceTextureFrameListener(jobject a0) {
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jUnregisterSurfaceTextureFrameListener, a0);
@ -1180,7 +1180,7 @@ void GeckoAppShell::Vibrate1(int64_t a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jVibrate1, a0);
@ -1192,7 +1192,7 @@ void GeckoAppShell::VibrateA(jlongArray a0, int32_t a1) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoAppShellClass, jVibrateA, a0, a1);
@ -1235,7 +1235,7 @@ jobject JavaDomKeyLocation::valueOf(const nsAString& a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
@ -1250,7 +1250,7 @@ jobjectArray JavaDomKeyLocation::values() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jobject temp = env->CallStaticObjectMethod(mDomKeyLocationClass, jvalues);
@ -1325,7 +1325,7 @@ jstring GeckoJavaSampler::GetFrameNameJavaProfilingWrapper(int32_t a0, int32_t a
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[3];
@ -1343,7 +1343,7 @@ jdouble GeckoJavaSampler::GetSampleTimeJavaProfiling(int32_t a0, int32_t a1) {
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jdouble temp = env->CallStaticDoubleMethod(mGeckoJavaSamplerClass, jGetSampleTimeJavaProfiling, a0, a1);
@ -1356,7 +1356,7 @@ jstring GeckoJavaSampler::GetThreadNameJavaProfilingWrapper(int32_t a0) {
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jobject temp = env->CallStaticObjectMethod(mGeckoJavaSamplerClass, jGetThreadNameJavaProfilingWrapper, a0);
@ -1369,7 +1369,7 @@ void GeckoJavaSampler::PauseJavaProfiling() {
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jPauseJavaProfiling);
@ -1381,7 +1381,7 @@ void GeckoJavaSampler::StartJavaProfiling(int32_t a0, int32_t a1) {
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jStartJavaProfiling, a0, a1);
@ -1393,7 +1393,7 @@ void GeckoJavaSampler::StopJavaProfiling() {
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jStopJavaProfiling);
@ -1405,7 +1405,7 @@ void GeckoJavaSampler::UnpauseJavaProfiling() {
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mGeckoJavaSamplerClass, jUnpauseJavaProfiling);
@ -1440,7 +1440,7 @@ SurfaceBits::SurfaceBits() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
Init(env->NewObject(mSurfaceBitsClass, jSurfaceBits), env);
@ -1506,7 +1506,7 @@ void ThumbnailHelper::SendThumbnail(jobject a0, int32_t a1, bool a2) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[3];
@ -1542,7 +1542,7 @@ DisplayPortMetrics::DisplayPortMetrics(jfloat a0, jfloat a1, jfloat a2, jfloat a
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[5];
@ -1585,7 +1585,7 @@ jobject GLController::CreateEGLSurfaceForCompositorWrapper() {
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jobject temp = env->CallObjectMethod(wrapped_obj, jCreateEGLSurfaceForCompositorWrapper);
@ -1633,7 +1633,7 @@ void GeckoLayerClient::ActivateProgram() {
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jActivateProgram);
@ -1645,7 +1645,7 @@ void GeckoLayerClient::ContentDocumentChanged() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jContentDocumentChanged);
@ -1657,7 +1657,7 @@ jobject GeckoLayerClient::CreateFrame() {
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jobject temp = env->CallObjectMethod(wrapped_obj, jCreateFrame);
@ -1670,7 +1670,7 @@ void GeckoLayerClient::DeactivateProgram() {
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jDeactivateProgram);
@ -1682,7 +1682,7 @@ jobject GeckoLayerClient::GetDisplayPort(bool a0, bool a1, int32_t a2, jobject a
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[4];
@ -1701,7 +1701,7 @@ bool GeckoLayerClient::IsContentDocumentDisplayed() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
bool temp = env->CallBooleanMethod(wrapped_obj, jIsContentDocumentDisplayed);
@ -1714,7 +1714,7 @@ jobject GeckoLayerClient::ProgressiveUpdateCallback(bool a0, jfloat a1, jfloat a
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[7];
@ -1736,7 +1736,7 @@ void GeckoLayerClient::SetFirstPaintViewport(jfloat a0, jfloat a1, jfloat a2, jf
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[7];
@ -1757,7 +1757,7 @@ void GeckoLayerClient::SetPageRect(jfloat a0, jfloat a1, jfloat a2, jfloat a3) {
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[4];
@ -1775,7 +1775,7 @@ jobject GeckoLayerClient::SyncFrameMetrics(jfloat a0, jfloat a1, jfloat a2, jflo
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[14];
@ -1804,7 +1804,7 @@ jobject GeckoLayerClient::SyncViewportInfo(int32_t a0, int32_t a1, int32_t a2, i
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[6];
@ -1840,7 +1840,7 @@ ImmutableViewportMetrics::ImmutableViewportMetrics(jfloat a0, jfloat a1, jfloat
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[13];
@ -1881,7 +1881,7 @@ jobject LayerView::RegisterCompositorWrapper() {
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jobject temp = env->CallStaticObjectMethod(mLayerViewClass, jRegisterCompositorWrapper);
@ -1911,7 +1911,7 @@ void NativePanZoomController::PostDelayedCallbackWrapper(int64_t a0) {
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jPostDelayedCallbackWrapper, a0);
@ -1923,7 +1923,7 @@ void NativePanZoomController::RequestContentRepaintWrapper(jfloat a0, jfloat a1,
JNIEnv *env = GetJNIForThread();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[5];
@ -1971,7 +1971,7 @@ ProgressiveUpdateData::ProgressiveUpdateData() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
Init(env->NewObject(mProgressiveUpdateDataClass, jProgressiveUpdateData), env);
@ -1982,7 +1982,7 @@ void ProgressiveUpdateData::setViewport(jobject a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jsetViewport, a0);
@ -2087,7 +2087,7 @@ ViewTransform::ViewTransform(jfloat a0, jfloat a1, jfloat a2) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jvalue args[3];
@ -2208,7 +2208,7 @@ jobject NativeZip::CreateInputStream(jobject a0, int32_t a1) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(2) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jobject temp = env->CallObjectMethod(wrapped_obj, jCreateInputStream, a0, a1);
@ -2244,7 +2244,7 @@ MatrixBlobCursor::MatrixBlobCursor(jobjectArray a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
Init(env->NewObject(mMatrixBlobCursorClass, jMatrixBlobCursor, a0), env);
@ -2255,7 +2255,7 @@ MatrixBlobCursor::MatrixBlobCursor(jobjectArray a0, int32_t a1) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
Init(env->NewObject(mMatrixBlobCursorClass, jMatrixBlobCursor0, a0, a1), env);
@ -2266,7 +2266,7 @@ void MatrixBlobCursor::AddRow(jobject a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jAddRow, a0);
@ -2278,7 +2278,7 @@ void MatrixBlobCursor::AddRow(jobject a0, int32_t a1) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jAddRow1, a0, a1);
@ -2290,7 +2290,7 @@ void MatrixBlobCursor::AddRow(jobjectArray a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallVoidMethod(wrapped_obj, jAddRow2, a0);
@ -2321,7 +2321,7 @@ SQLiteBridgeException::SQLiteBridgeException() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
Init(env->NewObject(mSQLiteBridgeExceptionClass, jSQLiteBridgeException), env);
@ -2332,7 +2332,7 @@ SQLiteBridgeException::SQLiteBridgeException(const nsAString& a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);
@ -2371,7 +2371,7 @@ void Clipboard::ClearText() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
env->CallStaticVoidMethod(mClipboardClass, jClearText);
@ -2383,7 +2383,7 @@ jstring Clipboard::GetClipboardTextWrapper() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jobject temp = env->CallStaticObjectMethod(mClipboardClass, jGetClipboardTextWrapper);
@ -2396,7 +2396,7 @@ bool Clipboard::HasText() {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(0) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
bool temp = env->CallStaticBooleanMethod(mClipboardClass, jHasText);
@ -2409,7 +2409,7 @@ void Clipboard::SetClipboardText(const nsAString& a0) {
JNIEnv *env = AndroidBridge::GetJNIEnv();
if (env->PushLocalFrame(1) != 0) {
AndroidBridge::HandleUncaughtException(env);
MOZ_ASSUME_UNREACHABLE("Exception should have caused crash.");
MOZ_CRASH("Exception should have caused crash.");
}
jstring j0 = AndroidBridge::NewJavaString(env, a0);