mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge latest green b2g-inbound changeset and mozilla-central; a=merge
This commit is contained in:
commit
000d251175
@ -186,8 +186,9 @@ AccVCChangeEvent::
|
||||
AccVCChangeEvent(Accessible* aAccessible,
|
||||
nsIAccessible* aOldAccessible,
|
||||
int32_t aOldStart, int32_t aOldEnd,
|
||||
int16_t aReason) :
|
||||
AccEvent(::nsIAccessibleEvent::EVENT_VIRTUALCURSOR_CHANGED, aAccessible),
|
||||
int16_t aReason, EIsFromUserInput aIsFromUserInput) :
|
||||
AccEvent(::nsIAccessibleEvent::EVENT_VIRTUALCURSOR_CHANGED, aAccessible,
|
||||
aIsFromUserInput),
|
||||
mOldAccessible(aOldAccessible), mOldStart(aOldStart), mOldEnd(aOldEnd),
|
||||
mReason(aReason)
|
||||
{
|
||||
|
@ -469,7 +469,8 @@ public:
|
||||
AccVCChangeEvent(Accessible* aAccessible,
|
||||
nsIAccessible* aOldAccessible,
|
||||
int32_t aOldStart, int32_t aOldEnd,
|
||||
int16_t aReason);
|
||||
int16_t aReason,
|
||||
EIsFromUserInput aIsFromUserInput = eFromUserInput);
|
||||
|
||||
virtual ~AccVCChangeEvent() { }
|
||||
|
||||
|
@ -101,7 +101,7 @@ nsAccessiblePivot::SetPosition(nsIAccessible* aPosition)
|
||||
int32_t oldStart = mStartOffset, oldEnd = mEndOffset;
|
||||
mStartOffset = mEndOffset = -1;
|
||||
NotifyOfPivotChange(secondPosition, oldStart, oldEnd,
|
||||
nsIAccessiblePivot::REASON_NONE);
|
||||
nsIAccessiblePivot::REASON_NONE, false);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -154,7 +154,8 @@ nsAccessiblePivot::GetEndOffset(int32_t* aEndOffset)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessiblePivot::SetTextRange(nsIAccessibleText* aTextAccessible,
|
||||
int32_t aStartOffset, int32_t aEndOffset)
|
||||
int32_t aStartOffset, int32_t aEndOffset,
|
||||
bool aIsFromUserInput, uint8_t aArgc)
|
||||
{
|
||||
NS_ENSURE_ARG(aTextAccessible);
|
||||
|
||||
@ -186,7 +187,8 @@ nsAccessiblePivot::SetTextRange(nsIAccessibleText* aTextAccessible,
|
||||
mPosition = newPosition;
|
||||
|
||||
NotifyOfPivotChange(oldPosition, oldStart, oldEnd,
|
||||
nsIAccessiblePivot::REASON_TEXT);
|
||||
nsIAccessiblePivot::REASON_TEXT,
|
||||
(aArgc > 0) ? aIsFromUserInput : true);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -196,7 +198,7 @@ nsAccessiblePivot::SetTextRange(nsIAccessibleText* aTextAccessible,
|
||||
NS_IMETHODIMP
|
||||
nsAccessiblePivot::MoveNext(nsIAccessibleTraversalRule* aRule,
|
||||
nsIAccessible* aAnchor, bool aIncludeStart,
|
||||
uint8_t aArgc, bool* aResult)
|
||||
bool aIsFromUserInput, uint8_t aArgc, bool* aResult)
|
||||
{
|
||||
NS_ENSURE_ARG(aResult);
|
||||
NS_ENSURE_ARG(aRule);
|
||||
@ -215,7 +217,8 @@ nsAccessiblePivot::MoveNext(nsIAccessibleTraversalRule* aRule,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (accessible)
|
||||
*aResult = MovePivotInternal(accessible, nsIAccessiblePivot::REASON_NEXT);
|
||||
*aResult = MovePivotInternal(accessible, nsIAccessiblePivot::REASON_NEXT,
|
||||
(aArgc > 2) ? aIsFromUserInput : true);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -223,7 +226,7 @@ nsAccessiblePivot::MoveNext(nsIAccessibleTraversalRule* aRule,
|
||||
NS_IMETHODIMP
|
||||
nsAccessiblePivot::MovePrevious(nsIAccessibleTraversalRule* aRule,
|
||||
nsIAccessible* aAnchor,
|
||||
bool aIncludeStart,
|
||||
bool aIncludeStart, bool aIsFromUserInput,
|
||||
uint8_t aArgc, bool* aResult)
|
||||
{
|
||||
NS_ENSURE_ARG(aResult);
|
||||
@ -243,13 +246,16 @@ nsAccessiblePivot::MovePrevious(nsIAccessibleTraversalRule* aRule,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (accessible)
|
||||
*aResult = MovePivotInternal(accessible, nsIAccessiblePivot::REASON_PREV);
|
||||
*aResult = MovePivotInternal(accessible, nsIAccessiblePivot::REASON_PREV,
|
||||
(aArgc > 2) ? aIsFromUserInput : true);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessiblePivot::MoveFirst(nsIAccessibleTraversalRule* aRule, bool* aResult)
|
||||
nsAccessiblePivot::MoveFirst(nsIAccessibleTraversalRule* aRule,
|
||||
bool aIsFromUserInput,
|
||||
uint8_t aArgc, bool* aResult)
|
||||
{
|
||||
NS_ENSURE_ARG(aResult);
|
||||
NS_ENSURE_ARG(aRule);
|
||||
@ -262,14 +268,16 @@ nsAccessiblePivot::MoveFirst(nsIAccessibleTraversalRule* aRule, bool* aResult)
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (accessible)
|
||||
*aResult = MovePivotInternal(accessible, nsIAccessiblePivot::REASON_FIRST);
|
||||
*aResult = MovePivotInternal(accessible, nsIAccessiblePivot::REASON_FIRST,
|
||||
(aArgc > 0) ? aIsFromUserInput : true);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessiblePivot::MoveLast(nsIAccessibleTraversalRule* aRule,
|
||||
bool* aResult)
|
||||
bool aIsFromUserInput,
|
||||
uint8_t aArgc, bool* aResult)
|
||||
{
|
||||
NS_ENSURE_ARG(aResult);
|
||||
NS_ENSURE_ARG(aRule);
|
||||
@ -291,13 +299,16 @@ nsAccessiblePivot::MoveLast(nsIAccessibleTraversalRule* aRule,
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (accessible)
|
||||
*aResult = MovePivotInternal(accessible, nsAccessiblePivot::REASON_LAST);
|
||||
*aResult = MovePivotInternal(accessible, nsAccessiblePivot::REASON_LAST,
|
||||
(aArgc > 0) ? aIsFromUserInput : true);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessiblePivot::MoveNextByText(TextBoundaryType aBoundary, bool* aResult)
|
||||
nsAccessiblePivot::MoveNextByText(TextBoundaryType aBoundary,
|
||||
bool aIsFromUserInput, uint8_t aArgc,
|
||||
bool* aResult)
|
||||
{
|
||||
NS_ENSURE_ARG(aResult);
|
||||
|
||||
@ -407,13 +418,16 @@ nsAccessiblePivot::MoveNextByText(TextBoundaryType aBoundary, bool* aResult)
|
||||
mStartOffset = tempStart;
|
||||
mEndOffset = tempEnd;
|
||||
NotifyOfPivotChange(startPosition, oldStart, oldEnd,
|
||||
nsIAccessiblePivot::REASON_TEXT);
|
||||
nsIAccessiblePivot::REASON_TEXT,
|
||||
(aArgc > 0) ? aIsFromUserInput : true);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsAccessiblePivot::MovePreviousByText(TextBoundaryType aBoundary, bool* aResult)
|
||||
nsAccessiblePivot::MovePreviousByText(TextBoundaryType aBoundary,
|
||||
bool aIsFromUserInput, uint8_t aArgc,
|
||||
bool* aResult)
|
||||
{
|
||||
NS_ENSURE_ARG(aResult);
|
||||
|
||||
@ -536,7 +550,8 @@ nsAccessiblePivot::MovePreviousByText(TextBoundaryType aBoundary, bool* aResult)
|
||||
mEndOffset = tempEnd;
|
||||
|
||||
NotifyOfPivotChange(startPosition, oldStart, oldEnd,
|
||||
nsIAccessiblePivot::REASON_TEXT);
|
||||
nsIAccessiblePivot::REASON_TEXT,
|
||||
(aArgc > 0) ? aIsFromUserInput : true);
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
@ -544,6 +559,7 @@ nsAccessiblePivot::MovePreviousByText(TextBoundaryType aBoundary, bool* aResult)
|
||||
NS_IMETHODIMP
|
||||
nsAccessiblePivot::MoveToPoint(nsIAccessibleTraversalRule* aRule,
|
||||
int32_t aX, int32_t aY, bool aIgnoreNoMatch,
|
||||
bool aIsFromUserInput, uint8_t aArgc,
|
||||
bool* aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
@ -581,7 +597,8 @@ nsAccessiblePivot::MoveToPoint(nsIAccessibleTraversalRule* aRule,
|
||||
}
|
||||
|
||||
if (match || !aIgnoreNoMatch)
|
||||
*aResult = MovePivotInternal(match, nsIAccessiblePivot::REASON_POINT);
|
||||
*aResult = MovePivotInternal(match, nsIAccessiblePivot::REASON_POINT,
|
||||
(aArgc > 0) ? aIsFromUserInput : true);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -626,14 +643,16 @@ nsAccessiblePivot::IsDescendantOf(Accessible* aAccessible, Accessible* aAncestor
|
||||
|
||||
bool
|
||||
nsAccessiblePivot::MovePivotInternal(Accessible* aPosition,
|
||||
PivotMoveReason aReason)
|
||||
PivotMoveReason aReason,
|
||||
bool aIsFromUserInput)
|
||||
{
|
||||
nsRefPtr<Accessible> oldPosition = mPosition.forget();
|
||||
mPosition = aPosition;
|
||||
int32_t oldStart = mStartOffset, oldEnd = mEndOffset;
|
||||
mStartOffset = mEndOffset = -1;
|
||||
|
||||
return NotifyOfPivotChange(oldPosition, oldStart, oldEnd, aReason);
|
||||
return NotifyOfPivotChange(oldPosition, oldStart, oldEnd, aReason,
|
||||
aIsFromUserInput);
|
||||
}
|
||||
|
||||
Accessible*
|
||||
@ -824,7 +843,7 @@ nsAccessiblePivot::SearchForText(Accessible* aAccessible, bool aBackward)
|
||||
bool
|
||||
nsAccessiblePivot::NotifyOfPivotChange(Accessible* aOldPosition,
|
||||
int32_t aOldStart, int32_t aOldEnd,
|
||||
int16_t aReason)
|
||||
int16_t aReason, bool aIsFromUserInput)
|
||||
{
|
||||
if (aOldPosition == mPosition &&
|
||||
aOldStart == mStartOffset && aOldEnd == mEndOffset)
|
||||
@ -833,7 +852,8 @@ nsAccessiblePivot::NotifyOfPivotChange(Accessible* aOldPosition,
|
||||
nsTObserverArray<nsCOMPtr<nsIAccessiblePivotObserver> >::ForwardIterator iter(mObservers);
|
||||
while (iter.HasMore()) {
|
||||
nsIAccessiblePivotObserver* obs = iter.GetNext();
|
||||
obs->OnPivotChanged(this, aOldPosition, aOldStart, aOldEnd, aReason);
|
||||
obs->OnPivotChanged(this, aOldPosition, aOldStart, aOldEnd, aReason,
|
||||
aIsFromUserInput);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -49,7 +49,8 @@ private:
|
||||
*/
|
||||
bool NotifyOfPivotChange(Accessible* aOldAccessible,
|
||||
int32_t aOldStart, int32_t aOldEnd,
|
||||
PivotMoveReason aReason);
|
||||
PivotMoveReason aReason,
|
||||
bool aIsFromUserInput);
|
||||
|
||||
/*
|
||||
* Check to see that the given accessible is a descendant of given ancestor
|
||||
@ -95,7 +96,8 @@ private:
|
||||
/*
|
||||
* Update the pivot, and notify observers. Return true if it moved.
|
||||
*/
|
||||
bool MovePivotInternal(Accessible* aPosition, PivotMoveReason aReason);
|
||||
bool MovePivotInternal(Accessible* aPosition, PivotMoveReason aReason,
|
||||
bool aIsFromUserInput);
|
||||
|
||||
/*
|
||||
* Get initial node we should start a search from with a given rule.
|
||||
|
@ -816,11 +816,12 @@ NS_IMETHODIMP
|
||||
DocAccessible::OnPivotChanged(nsIAccessiblePivot* aPivot,
|
||||
nsIAccessible* aOldAccessible,
|
||||
int32_t aOldStart, int32_t aOldEnd,
|
||||
PivotMoveReason aReason)
|
||||
PivotMoveReason aReason,
|
||||
bool aIsFromUserInput)
|
||||
{
|
||||
nsRefPtr<AccEvent> event = new AccVCChangeEvent(this, aOldAccessible,
|
||||
aOldStart, aOldEnd,
|
||||
aReason);
|
||||
nsRefPtr<AccEvent> event = new AccVCChangeEvent(
|
||||
this, aOldAccessible, aOldStart, aOldEnd, aReason,
|
||||
aIsFromUserInput ? eFromUserInput : eNoUserInput);
|
||||
nsEventShell::FireEvent(event);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -20,7 +20,7 @@ interface nsIAccessiblePivotObserver;
|
||||
* provides traversal methods to move the pivot to next/prev state that complies
|
||||
* to a given rule.
|
||||
*/
|
||||
[scriptable, uuid(c2938033-e240-4fe5-9cb6-e7ad649ccd10)]
|
||||
[scriptable, uuid(81fe5144-059b-42db-bd3a-f6ce3158d5e9)]
|
||||
interface nsIAccessiblePivot : nsISupports
|
||||
{
|
||||
const TextBoundaryType CHAR_BOUNDARY = 0;
|
||||
@ -68,11 +68,14 @@ interface nsIAccessiblePivot : nsISupports
|
||||
* range.
|
||||
* @param aStartOffset [in] the start offset to set.
|
||||
* @param aEndOffset [in] the end offset to set.
|
||||
* @param aIsFromUserInput [in] the pivot changed because of direct user input
|
||||
* (default is true).
|
||||
* @throws NS_ERROR_INVALID_ARG when the offset exceeds the accessible's
|
||||
* character count.
|
||||
*/
|
||||
void setTextRange(in nsIAccessibleText aTextAccessible,
|
||||
in long aStartOffset, in long aEndOffset);
|
||||
[optional_argc] void setTextRange(in nsIAccessibleText aTextAccessible,
|
||||
in long aStartOffset, in long aEndOffset,
|
||||
[optional] in boolean aIsFromUserInput);
|
||||
|
||||
/**
|
||||
* Move pivot to next object, from current position or given anchor,
|
||||
@ -82,11 +85,14 @@ interface nsIAccessiblePivot : nsISupports
|
||||
* @param aAnchor [in] accessible to start search from, if not provided,
|
||||
* current position will be used.
|
||||
* @param aIncludeStart [in] include anchor accessible in search.
|
||||
* @param aIsFromUserInput [in] the pivot changed because of direct user input
|
||||
* (default is true).
|
||||
* @return true on success, false if there are no new nodes to traverse to.
|
||||
*/
|
||||
[optional_argc] boolean moveNext(in nsIAccessibleTraversalRule aRule,
|
||||
[optional] in nsIAccessible aAnchor,
|
||||
[optional] in boolean aIncludeStart);
|
||||
[optional] in boolean aIncludeStart,
|
||||
[optional] in boolean aIsFromUserInput);
|
||||
|
||||
/**
|
||||
* Move pivot to previous object, from current position or given anchor,
|
||||
@ -96,45 +102,59 @@ interface nsIAccessiblePivot : nsISupports
|
||||
* @param aAnchor [in] accessible to start search from, if not provided,
|
||||
* current position will be used.
|
||||
* @param aIncludeStart [in] include anchor accessible in search.
|
||||
* @param aIsFromUserInput [in] the pivot changed because of direct user input
|
||||
* (default is true).
|
||||
* @return true on success, false if there are no new nodes to traverse to.
|
||||
*/
|
||||
[optional_argc] boolean movePrevious(in nsIAccessibleTraversalRule aRule,
|
||||
[optional] in nsIAccessible aAnchor,
|
||||
[optional] in boolean aIncludeStart);
|
||||
[optional] in boolean aIncludeStart,
|
||||
[optional] in boolean aIsFromUserInput);
|
||||
|
||||
/**
|
||||
* Move pivot to first object in subtree complying to given traversal rule.
|
||||
*
|
||||
* @param aRule [in] traversal rule to use.
|
||||
* @param aIsFromUserInput [in] the pivot changed because of direct user input
|
||||
* (default is true).
|
||||
* @return true on success, false if there are no new nodes to traverse to.
|
||||
*/
|
||||
boolean moveFirst(in nsIAccessibleTraversalRule aRule);
|
||||
[optional_argc] boolean moveFirst(in nsIAccessibleTraversalRule aRule,
|
||||
[optional] in boolean aIsFromUserInput);
|
||||
|
||||
/**
|
||||
* Move pivot to last object in subtree complying to given traversal rule.
|
||||
*
|
||||
* @param aRule [in] traversal rule to use.
|
||||
* @return true on success, false if there are no new nodes to traverse to.
|
||||
* @param aIsFromUserInput [in] the pivot changed because of direct user input
|
||||
* (default is true).
|
||||
*/
|
||||
boolean moveLast(in nsIAccessibleTraversalRule aRule);
|
||||
[optional_argc] boolean moveLast(in nsIAccessibleTraversalRule aRule,
|
||||
[optional] in boolean aIsFromUserInput);
|
||||
|
||||
/**
|
||||
* Move pivot to next text range.
|
||||
*
|
||||
* @param aBoundary [in] type of boundary for next text range, character, word,
|
||||
* etc.
|
||||
* @param aBoundary [in] type of boundary for next text range,
|
||||
* character, word, etc.
|
||||
* @param aIsFromUserInput [in] the pivot changed because of direct user input
|
||||
* (default is true).
|
||||
* @return true on success, false if there are is no more text.
|
||||
*/
|
||||
boolean moveNextByText(in TextBoundaryType aBoundary);
|
||||
[optional_argc] boolean moveNextByText(in TextBoundaryType aBoundary,
|
||||
[optional] in boolean aIsFromUserInput);
|
||||
|
||||
/**
|
||||
* Move pivot to previous text range.
|
||||
*
|
||||
* @param aBoundary [in] type of boundary for previous text range, character,
|
||||
* word, etc.
|
||||
* @param aBoundary [in] type of boundary for next text range,
|
||||
* character, word, etc.
|
||||
* @param aIsFromUserInput [in] the pivot changed because of direct user input
|
||||
* (default is true).
|
||||
* @return true on success, false if there are is no more text.
|
||||
*/
|
||||
boolean movePreviousByText(in TextBoundaryType aBoundary);
|
||||
[optional_argc] boolean movePreviousByText(in TextBoundaryType aBoundary,
|
||||
[optional] in boolean aIsFromUserInput);
|
||||
|
||||
/**
|
||||
* Move pivot to given coordinate in screen pixels.
|
||||
@ -142,13 +162,16 @@ interface nsIAccessiblePivot : nsISupports
|
||||
* @param aRule [in] raversal rule to use.
|
||||
* @param aX [in] screen's x coordinate
|
||||
* @param aY [in] screen's y coordinate
|
||||
* @param aIgnoreNoMatch [in] don't unset position if no object was found at
|
||||
* point.
|
||||
* @param aIgnoreNoMatch [in] don't unset position if no object was found
|
||||
* at point.
|
||||
* @param aIsFromUserInput [in] the pivot changed because of direct user input
|
||||
* (default is true).
|
||||
* @return true on success, false if the pivot has not been moved.
|
||||
*/
|
||||
boolean moveToPoint(in nsIAccessibleTraversalRule aRule,
|
||||
[optional_argc] boolean moveToPoint(in nsIAccessibleTraversalRule aRule,
|
||||
in long aX, in long aY,
|
||||
in boolean aIgnoreNoMatch);
|
||||
in boolean aIgnoreNoMatch,
|
||||
[optional] in boolean aIsFromUserInput);
|
||||
|
||||
/**
|
||||
* Add an observer for pivot changes.
|
||||
@ -175,18 +198,22 @@ interface nsIAccessiblePivotObserver : nsISupports
|
||||
* Called when the pivot changes.
|
||||
*
|
||||
* @param aPivot [in] the pivot that has changed.
|
||||
* @param aOldAccessible [in] the old pivot position before the change, or null.
|
||||
* @param aOldAccessible [in] the old pivot position before the change,
|
||||
* or null.
|
||||
* @param aOldStart [in] the old start offset, or -1.
|
||||
* @param aOldEnd [in] the old end offset, or -1.
|
||||
* @param aReason [in] the reason for the pivot change.
|
||||
* @param aIsFromUserInput [in] the pivot changed because of direct user input
|
||||
* (default is true).
|
||||
*/
|
||||
void onPivotChanged(in nsIAccessiblePivot aPivot,
|
||||
in nsIAccessible aOldAccessible,
|
||||
in long aOldStart, in long aOldEnd,
|
||||
in PivotMoveReason aReason);
|
||||
in PivotMoveReason aReason,
|
||||
in boolean aIsFromUserInput);
|
||||
};
|
||||
|
||||
[scriptable, uuid(4d9c4352-20f5-4c54-9580-0c77bb6b1115)]
|
||||
[scriptable, uuid(e197460d-1eff-4247-b4bb-a43be1840dae)]
|
||||
interface nsIAccessibleTraversalRule : nsISupports
|
||||
{
|
||||
/* Ignore this accessible object */
|
||||
|
@ -75,11 +75,12 @@ var ObjectTraversalRule =
|
||||
/**
|
||||
* A checker for virtual cursor changed events.
|
||||
*/
|
||||
function VCChangedChecker(aDocAcc, aIdOrNameOrAcc, aTextOffsets, aPivotMoveMethod)
|
||||
function VCChangedChecker(aDocAcc, aIdOrNameOrAcc, aTextOffsets, aPivotMoveMethod,
|
||||
aIsFromUserInput)
|
||||
{
|
||||
this.__proto__ = new invokerChecker(EVENT_VIRTUALCURSOR_CHANGED, aDocAcc);
|
||||
|
||||
this.match = function VCChangedChecker_check(aEvent)
|
||||
this.match = function VCChangedChecker_match(aEvent)
|
||||
{
|
||||
var event = null;
|
||||
try {
|
||||
@ -114,6 +115,9 @@ function VCChangedChecker(aDocAcc, aIdOrNameOrAcc, aTextOffsets, aPivotMoveMetho
|
||||
"expecting " + aIdOrNameOrAcc + ", got '" +
|
||||
prettyName(position));
|
||||
|
||||
SimpleTest.is(aEvent.isFromUserInput, aIsFromUserInput,
|
||||
"Expected user input is " + aIsFromUserInput + '\n');
|
||||
|
||||
if (aTextOffsets) {
|
||||
SimpleTest.is(aDocAcc.virtualCursor.startOffset, aTextOffsets[0],
|
||||
"wrong start offset");
|
||||
@ -190,7 +194,7 @@ function setVCRangeInvoker(aDocAcc, aTextAccessible, aTextOffsets)
|
||||
};
|
||||
|
||||
this.eventSeq = [
|
||||
new VCChangedChecker(aDocAcc, aTextAccessible, aTextOffsets, "setTextRange")
|
||||
new VCChangedChecker(aDocAcc, aTextAccessible, aTextOffsets, "setTextRange", true)
|
||||
];
|
||||
}
|
||||
|
||||
@ -203,8 +207,11 @@ function setVCRangeInvoker(aDocAcc, aTextAccessible, aTextOffsets)
|
||||
* @param aIdOrNameOrAcc [in] id, accessible or accessible name to expect
|
||||
* virtual cursor to land on after performing move method.
|
||||
* false if no move is expected.
|
||||
* @param aIsFromUserInput [in] set user input flag when invoking method, and
|
||||
* expect it in the event.
|
||||
*/
|
||||
function setVCPosInvoker(aDocAcc, aPivotMoveMethod, aRule, aIdOrNameOrAcc)
|
||||
function setVCPosInvoker(aDocAcc, aPivotMoveMethod, aRule, aIdOrNameOrAcc,
|
||||
aIsFromUserInput)
|
||||
{
|
||||
var expectMove = (aIdOrNameOrAcc != false);
|
||||
this.invoke = function virtualCursorChangedInvoker_invoke()
|
||||
@ -212,7 +219,20 @@ function setVCPosInvoker(aDocAcc, aPivotMoveMethod, aRule, aIdOrNameOrAcc)
|
||||
VCChangedChecker.
|
||||
storePreviousPosAndOffset(aDocAcc.virtualCursor);
|
||||
if (aPivotMoveMethod && aRule) {
|
||||
var moved = aDocAcc.virtualCursor[aPivotMoveMethod](aRule);
|
||||
var moved = false;
|
||||
switch (aPivotMoveMethod) {
|
||||
case 'moveFirst':
|
||||
case 'moveLast':
|
||||
moved = aDocAcc.virtualCursor[aPivotMoveMethod](aRule,
|
||||
aIsFromUserInput === undefined ? true : aIsFromUserInput);
|
||||
break;
|
||||
case 'moveNext':
|
||||
case 'movePrevious':
|
||||
moved = aDocAcc.virtualCursor[aPivotMoveMethod](aRule,
|
||||
aDocAcc.virtualCursor.position, false,
|
||||
aIsFromUserInput === undefined ? true : aIsFromUserInput);
|
||||
break;
|
||||
}
|
||||
SimpleTest.is(!!moved, !!expectMove,
|
||||
"moved pivot with " + aPivotMoveMethod +
|
||||
" to " + aIdOrNameOrAcc);
|
||||
@ -228,7 +248,8 @@ function setVCPosInvoker(aDocAcc, aPivotMoveMethod, aRule, aIdOrNameOrAcc)
|
||||
|
||||
if (expectMove) {
|
||||
this.eventSeq = [
|
||||
new VCChangedChecker(aDocAcc, aIdOrNameOrAcc, null, aPivotMoveMethod)
|
||||
new VCChangedChecker(aDocAcc, aIdOrNameOrAcc, null, aPivotMoveMethod,
|
||||
aIsFromUserInput === undefined ? !!aPivotMoveMethod : aIsFromUserInput)
|
||||
];
|
||||
} else {
|
||||
this.eventSeq = [];
|
||||
@ -249,15 +270,19 @@ function setVCPosInvoker(aDocAcc, aPivotMoveMethod, aRule, aIdOrNameOrAcc)
|
||||
* @param aIdOrNameOrAcc [in] id, accessible or accessible name to expect
|
||||
* virtual cursor to land on after performing move method.
|
||||
* false if no move is expected.
|
||||
* @param aIsFromUserInput [in] set user input flag when invoking method, and
|
||||
* expect it in the event.
|
||||
*/
|
||||
function setVCTextInvoker(aDocAcc, aPivotMoveMethod, aBoundary, aTextOffsets, aIdOrNameOrAcc)
|
||||
function setVCTextInvoker(aDocAcc, aPivotMoveMethod, aBoundary, aTextOffsets,
|
||||
aIdOrNameOrAcc, aIsFromUserInput)
|
||||
{
|
||||
var expectMove = (aIdOrNameOrAcc != false);
|
||||
this.invoke = function virtualCursorChangedInvoker_invoke()
|
||||
{
|
||||
VCChangedChecker.storePreviousPosAndOffset(aDocAcc.virtualCursor);
|
||||
SimpleTest.info(aDocAcc.virtualCursor.position);
|
||||
var moved = aDocAcc.virtualCursor[aPivotMoveMethod](aBoundary);
|
||||
var moved = aDocAcc.virtualCursor[aPivotMoveMethod](aBoundary,
|
||||
aIsFromUserInput === undefined ? true : false);
|
||||
SimpleTest.is(!!moved, !!expectMove,
|
||||
"moved pivot by text with " + aPivotMoveMethod +
|
||||
" to " + aIdOrNameOrAcc);
|
||||
@ -272,7 +297,8 @@ function setVCTextInvoker(aDocAcc, aPivotMoveMethod, aBoundary, aTextOffsets, aI
|
||||
|
||||
if (expectMove) {
|
||||
this.eventSeq = [
|
||||
new VCChangedChecker(aDocAcc, aIdOrNameOrAcc, aTextOffsets, aPivotMoveMethod)
|
||||
new VCChangedChecker(aDocAcc, aIdOrNameOrAcc, aTextOffsets, aPivotMoveMethod,
|
||||
aIsFromUserInput === undefined ? true : aIsFromUserInput)
|
||||
];
|
||||
} else {
|
||||
this.eventSeq = [];
|
||||
@ -317,7 +343,7 @@ function moveVCCoordInvoker(aDocAcc, aX, aY, aIgnoreNoMatch,
|
||||
|
||||
if (expectMove) {
|
||||
this.eventSeq = [
|
||||
new VCChangedChecker(aDocAcc, aIdOrNameOrAcc, null, 'moveToPoint')
|
||||
new VCChangedChecker(aDocAcc, aIdOrNameOrAcc, null, 'moveToPoint', true)
|
||||
];
|
||||
} else {
|
||||
this.eventSeq = [];
|
||||
@ -407,7 +433,8 @@ function queueTraversalSequence(aQueue, aDocAcc, aRule, aModalRoot, aSequence)
|
||||
// No further more matches for given rule, expect no virtual cursor changes.
|
||||
aQueue.push(new setVCPosInvoker(aDocAcc, "moveNext", aRule, false));
|
||||
|
||||
aQueue.push(new setVCPosInvoker(aDocAcc, "moveFirst", aRule, aSequence[0]));
|
||||
// set isFromUserInput to false, just to test..
|
||||
aQueue.push(new setVCPosInvoker(aDocAcc, "moveFirst", aRule, aSequence[0], false));
|
||||
|
||||
// No previous more matches for given rule, expect no virtual cursor changes.
|
||||
aQueue.push(new setVCPosInvoker(aDocAcc, "movePrevious", aRule, false));
|
||||
|
@ -96,8 +96,10 @@
|
||||
NS_ERROR_INVALID_ARG));
|
||||
|
||||
// Put cursor in an ignored subtree
|
||||
// set isFromUserInput to false, just to test..
|
||||
gQueue.push(new setVCPosInvoker(docAcc, null, null,
|
||||
getAccessible(doc.getElementById("hidden-link"))));
|
||||
getAccessible(doc.getElementById("hidden-link")),
|
||||
false));
|
||||
// Next item shoud be outside of that subtree
|
||||
gQueue.push(new setVCPosInvoker(docAcc, "moveNext", ObjectTraversalRule, "An "));
|
||||
|
||||
|
@ -53,8 +53,10 @@
|
||||
getAccessible(doc.getElementById('paragraph-1'), nsIAccessibleText)));
|
||||
gQueue.push(new setVCTextInvoker(docAcc, 'movePreviousByText', WORD_BOUNDARY, [0,3],
|
||||
getAccessible(doc.getElementById('p1-link-1'), nsIAccessibleText)));
|
||||
// set user input to false, and see if it works
|
||||
gQueue.push(new setVCTextInvoker(docAcc, 'movePreviousByText', WORD_BOUNDARY, [5,7],
|
||||
getAccessible(doc.getElementById('paragraph-1'), nsIAccessibleText)));
|
||||
getAccessible(doc.getElementById('paragraph-1'), nsIAccessibleText)),
|
||||
false);
|
||||
|
||||
gQueue.push(new setVCPosInvoker(docAcc, null, null,
|
||||
getAccessible(doc.getElementById('section-1'))));
|
||||
@ -62,8 +64,10 @@
|
||||
getAccessible(doc.getElementById('section-1'), nsIAccessibleText)));
|
||||
gQueue.push(new setVCTextInvoker(docAcc, 'moveNextByText', WORD_BOUNDARY, [0,9],
|
||||
getAccessible(doc.getElementById('s1-link-1'), nsIAccessibleText)));
|
||||
// set user input to false, and see if it works
|
||||
gQueue.push(new setVCTextInvoker(docAcc, 'moveNextByText', WORD_BOUNDARY, [10,14],
|
||||
getAccessible(doc.getElementById('s1-link-1'), nsIAccessibleText)));
|
||||
getAccessible(doc.getElementById('s1-link-1'), nsIAccessibleText),
|
||||
false));
|
||||
gQueue.push(new setVCTextInvoker(docAcc, 'moveNextByText', WORD_BOUNDARY, [4,6],
|
||||
getAccessible(doc.getElementById('section-1'), nsIAccessibleText)));
|
||||
gQueue.push(new setVCTextInvoker(docAcc, 'moveNextByText', WORD_BOUNDARY, [7,12],
|
||||
|
@ -53,16 +53,15 @@ side-effects. Previously, when the build configuration was defined in
|
||||
unnoticed. ``moz.build`` files fix this problem by eliminating the
|
||||
potential for false promises.
|
||||
|
||||
In the sandbox, all ``UPPERCASE`` variables are globals and all
|
||||
non-``UPPERCASE`` variables are locals. After a ``moz.build`` file has
|
||||
completed execution, only the globals are used to retrieve state.
|
||||
After a ``moz.build`` file has completed execution, only the
|
||||
``UPPERCASE`` variables are used to retrieve state.
|
||||
|
||||
The set of variables and functions available to the Python sandbox is
|
||||
defined by the :py:mod:`mozbuild.frontend.sandbox_symbols` module. The
|
||||
defined by the :py:mod:`mozbuild.frontend.context` module. The
|
||||
data structures in this module are consumed by the
|
||||
:py:class:`mozbuild.frontend.reader.MozbuildSandbox` class to construct
|
||||
the sandbox. There are tests to ensure that the set of symbols exposed
|
||||
to an empty sandbox are all defined in the ``sandbox_symbols`` module.
|
||||
to an empty sandbox are all defined in the ``context`` module.
|
||||
This module also contains documentation for each symbol, so nothing can
|
||||
sneak into the sandbox without being explicitly defined and documented.
|
||||
|
||||
@ -81,13 +80,14 @@ of all the special ``UPPERCASE`` variables populated during its
|
||||
execution.
|
||||
|
||||
The code for reading ``moz.build`` files lives in
|
||||
:py:mod:`mozbuild.frontend.reader`. The evaluated Python sandboxes are
|
||||
passed into :py:mod:`mozbuild.frontend.emitter`, which converts them to
|
||||
classes defined in :py:mod:`mozbuild.frontend.data`. Each class in this
|
||||
module define a domain-specific component of tree metdata. e.g. there
|
||||
will be separate classes that represent a JavaScript file vs a compiled
|
||||
C++ file or test manifests. This means downstream consumers of this data
|
||||
can filter on class types to only consume what they are interested in.
|
||||
:py:mod:`mozbuild.frontend.reader`. The Python sandboxes evaluation results
|
||||
(:py:class:`mozbuild.frontend.context.Context`) are passed into
|
||||
:py:mod:`mozbuild.frontend.emitter`, which converts them to classes defined
|
||||
in :py:mod:`mozbuild.frontend.data`. Each class in this module defines a
|
||||
domain-specific component of tree metdata. e.g. there will be separate
|
||||
classes that represent a JavaScript file vs a compiled C++ file or test
|
||||
manifests. This means downstream consumers of this data can filter on class
|
||||
types to only consume what they are interested in.
|
||||
|
||||
There is no well-defined mapping between ``moz.build`` file instances
|
||||
and the number of :py:mod:`mozbuild.frontend.data` classes derived from
|
||||
@ -98,7 +98,7 @@ The purpose of the ``emitter`` layer between low-level sandbox execution
|
||||
and metadata representation is to facilitate a unified normalization and
|
||||
verification step. There are multiple downstream consumers of the
|
||||
``moz.build``-derived data and many will perform the same actions. This
|
||||
logic can be complicated, so we a component dedicated to it.
|
||||
logic can be complicated, so we have a component dedicated to it.
|
||||
|
||||
Other Notes
|
||||
===========
|
||||
|
@ -4,4 +4,4 @@
|
||||
mozbuild Sandbox Symbols
|
||||
========================
|
||||
|
||||
.. mozbuildsymbols:: mozbuild.frontend.sandbox_symbols
|
||||
.. mozbuildsymbols:: mozbuild.frontend.context
|
||||
|
@ -19,9 +19,9 @@
|
||||
#include "nsIClassInfoImpl.h"
|
||||
#include "nsError.h"
|
||||
#include "nsIContentSecurityPolicy.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "jswrapper.h"
|
||||
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/HashFunctions.h"
|
||||
|
||||
|
@ -61,10 +61,10 @@
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include <stdint.h>
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsILoadInfo.h"
|
||||
|
||||
|
14
configure.in
14
configure.in
@ -7154,6 +7154,17 @@ if test -n "$JSGC_GENERATIONAL"; then
|
||||
AC_DEFINE(JSGC_GENERATIONAL)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Use compacting GC
|
||||
dnl ========================================================
|
||||
MOZ_ARG_ENABLE_BOOL(gccompacting,
|
||||
[ --enable-gccompacting Compact the JS heap by moving GC things],
|
||||
JS_GCCOMPACTING=1,
|
||||
JS_GCCOMPACTING= )
|
||||
if test -n "$JS_GCCOMPACTING"; then
|
||||
AC_DEFINE(JS_GCCOMPACTING)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl = Use a smaller chunk size for GC chunks
|
||||
dnl ========================================================
|
||||
@ -9115,6 +9126,9 @@ fi
|
||||
if test -z "$JSGC_GENERATIONAL" ; then
|
||||
ac_configure_args="$ac_configure_args --disable-gcgenerational"
|
||||
fi
|
||||
if test -n "$JS_GCCOMPACTING" ; then
|
||||
ac_configure_args="$ac_configure_args --enable-gccompacting"
|
||||
fi
|
||||
if test -n "$JS_GC_SMALL_CHUNK_SIZE" ; then
|
||||
ac_configure_args="$ac_configure_args --enable-small-chunk-size"
|
||||
fi
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "nsTArrayForwardDeclare.h"
|
||||
#include "Units.h"
|
||||
#include "mozilla/dom/AutocompleteInfoBinding.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
|
||||
#if defined(XP_WIN)
|
||||
// Undefine LoadImage to prevent naming conflict with Windows.
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "prprf.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "DecoderTraits.h"
|
||||
#include "harfbuzz/hb.h"
|
||||
#include "imgICache.h"
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsDOMClassInfo.h"
|
||||
#include "nsCxPusher.h"
|
||||
|
||||
#include "mozilla/AsyncEventDispatcher.h"
|
||||
#include "mozilla/BasicEvents.h"
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "AppProcessChecker.h"
|
||||
#include "ContentChild.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsError.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "jsapi.h"
|
||||
@ -33,6 +32,7 @@
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/nsIContentParent.h"
|
||||
#include "mozilla/dom/PermissionMessageUtils.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/StructuredCloneUtils.h"
|
||||
#include "mozilla/dom/PBlobChild.h"
|
||||
#include "mozilla/dom/PBlobParent.h"
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
#include "nsNodeUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsINode.h"
|
||||
#include "nsIContent.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
@ -48,7 +48,6 @@
|
||||
#include "nsCURILoader.h"
|
||||
#include "nsContentPolicyUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsDocShellCID.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "nsIDOMHTMLScriptElement.h"
|
||||
#include "nsIDocShell.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsIXPConnect.h"
|
||||
|
@ -41,7 +41,6 @@
|
||||
#include "nsIStreamConverterService.h"
|
||||
#include "nsICachingChannel.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsIContentPolicy.h"
|
||||
#include "nsContentPolicyUtils.h"
|
||||
|
@ -23,7 +23,6 @@
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIAudioManager.h"
|
||||
#include "SpeakerManagerService.h"
|
||||
#define NS_AUDIOMANAGER_CONTRACTID "@mozilla.org/telephony/audiomanager;1"
|
||||
|
@ -7,7 +7,6 @@
|
||||
#include "DOMRequest.h"
|
||||
|
||||
#include "DOMError.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "DOMCursor.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "mozilla/Assertions.h"
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "xpcprivate.h" // For AutoCxPusher guts
|
||||
#include "xpcpublic.h"
|
||||
#include "nsIGlobalObject.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
@ -18,6 +19,8 @@
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsTArray.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsDOMJSUtils.h"
|
||||
#include "WorkerPrivate.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
@ -373,5 +376,153 @@ AutoNoJSAPI::AutoNoJSAPI(bool aIsMainThread)
|
||||
}
|
||||
}
|
||||
|
||||
danger::AutoCxPusher::AutoCxPusher(JSContext* cx, bool allowNull)
|
||||
{
|
||||
MOZ_ASSERT_IF(!allowNull, cx);
|
||||
|
||||
// Hold a strong ref to the nsIScriptContext, if any. This ensures that we
|
||||
// only destroy the mContext of an nsJSContext when it is not on the cx stack
|
||||
// (and therefore not in use). See nsJSContext::DestroyJSContext().
|
||||
if (cx)
|
||||
mScx = GetScriptContextFromJSContext(cx);
|
||||
|
||||
XPCJSContextStack *stack = XPCJSRuntime::Get()->GetJSContextStack();
|
||||
if (!stack->Push(cx)) {
|
||||
MOZ_CRASH();
|
||||
}
|
||||
mStackDepthAfterPush = stack->Count();
|
||||
|
||||
#ifdef DEBUG
|
||||
mPushedContext = cx;
|
||||
mCompartmentDepthOnEntry = cx ? js::GetEnterCompartmentDepth(cx) : 0;
|
||||
#endif
|
||||
|
||||
// Enter a request and a compartment for the duration that the cx is on the
|
||||
// stack if non-null.
|
||||
if (cx) {
|
||||
mAutoRequest.emplace(cx);
|
||||
|
||||
// DOM JSContexts don't store their default compartment object on the cx.
|
||||
JSObject *compartmentObject = mScx ? mScx->GetWindowProxy()
|
||||
: js::DefaultObjectForContextOrNull(cx);
|
||||
if (compartmentObject)
|
||||
mAutoCompartment.emplace(cx, compartmentObject);
|
||||
}
|
||||
}
|
||||
|
||||
danger::AutoCxPusher::~AutoCxPusher()
|
||||
{
|
||||
// Leave the compartment and request before popping.
|
||||
mAutoCompartment.reset();
|
||||
mAutoRequest.reset();
|
||||
|
||||
// When we push a context, we may save the frame chain and pretend like we
|
||||
// haven't entered any compartment. This gets restored on Pop(), but we can
|
||||
// run into trouble if a Push/Pop are interleaved with a
|
||||
// JSAutoEnterCompartment. Make sure the compartment depth right before we
|
||||
// pop is the same as it was right after we pushed.
|
||||
MOZ_ASSERT_IF(mPushedContext, mCompartmentDepthOnEntry ==
|
||||
js::GetEnterCompartmentDepth(mPushedContext));
|
||||
DebugOnly<JSContext*> stackTop;
|
||||
MOZ_ASSERT(mPushedContext == nsXPConnect::XPConnect()->GetCurrentJSContext());
|
||||
XPCJSRuntime::Get()->GetJSContextStack()->Pop();
|
||||
mScx = nullptr;
|
||||
}
|
||||
|
||||
bool
|
||||
danger::AutoCxPusher::IsStackTop() const
|
||||
{
|
||||
uint32_t currentDepth = XPCJSRuntime::Get()->GetJSContextStack()->Count();
|
||||
MOZ_ASSERT(currentDepth >= mStackDepthAfterPush);
|
||||
return currentDepth == mStackDepthAfterPush;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
|
||||
AutoJSContext::AutoJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)
|
||||
: mCx(nullptr)
|
||||
{
|
||||
Init(false MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT);
|
||||
}
|
||||
|
||||
AutoJSContext::AutoJSContext(bool aSafe MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
|
||||
: mCx(nullptr)
|
||||
{
|
||||
Init(aSafe MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT);
|
||||
}
|
||||
|
||||
void
|
||||
AutoJSContext::Init(bool aSafe MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)
|
||||
{
|
||||
JS::AutoSuppressGCAnalysis nogc;
|
||||
MOZ_ASSERT(!mCx, "mCx should not be initialized!");
|
||||
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
|
||||
nsXPConnect *xpc = nsXPConnect::XPConnect();
|
||||
if (!aSafe) {
|
||||
mCx = xpc->GetCurrentJSContext();
|
||||
}
|
||||
|
||||
if (!mCx) {
|
||||
mJSAPI.Init();
|
||||
mCx = mJSAPI.cx();
|
||||
}
|
||||
}
|
||||
|
||||
AutoJSContext::operator JSContext*() const
|
||||
{
|
||||
return mCx;
|
||||
}
|
||||
|
||||
ThreadsafeAutoJSContext::ThreadsafeAutoJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)
|
||||
{
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
|
||||
if (NS_IsMainThread()) {
|
||||
mCx = nullptr;
|
||||
mAutoJSContext.emplace();
|
||||
} else {
|
||||
mCx = mozilla::dom::workers::GetCurrentThreadJSContext();
|
||||
mRequest.emplace(mCx);
|
||||
}
|
||||
}
|
||||
|
||||
ThreadsafeAutoJSContext::operator JSContext*() const
|
||||
{
|
||||
if (mCx) {
|
||||
return mCx;
|
||||
} else {
|
||||
return *mAutoJSContext;
|
||||
}
|
||||
}
|
||||
|
||||
AutoSafeJSContext::AutoSafeJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)
|
||||
: AutoJSContext(true MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)
|
||||
, mAc(mCx, XPCJSRuntime::Get()->GetJSContextStack()->GetSafeJSContextGlobal())
|
||||
{
|
||||
}
|
||||
|
||||
ThreadsafeAutoSafeJSContext::ThreadsafeAutoSafeJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)
|
||||
{
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
|
||||
if (NS_IsMainThread()) {
|
||||
mCx = nullptr;
|
||||
mAutoSafeJSContext.emplace();
|
||||
} else {
|
||||
mCx = mozilla::dom::workers::GetCurrentThreadJSContext();
|
||||
mRequest.emplace(mCx);
|
||||
}
|
||||
}
|
||||
|
||||
ThreadsafeAutoSafeJSContext::operator JSContext*() const
|
||||
{
|
||||
if (mCx) {
|
||||
return mCx;
|
||||
} else {
|
||||
return *mAutoSafeJSContext;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -9,19 +9,53 @@
|
||||
#ifndef mozilla_dom_ScriptSettings_h
|
||||
#define mozilla_dom_ScriptSettings_h
|
||||
|
||||
#include "nsCxPusher.h"
|
||||
#include "MainThreadUtils.h"
|
||||
#include "nsIGlobalObject.h"
|
||||
#include "nsIPrincipal.h"
|
||||
|
||||
#include "mozilla/Maybe.h"
|
||||
|
||||
#include "jsapi.h"
|
||||
|
||||
class nsPIDOMWindow;
|
||||
class nsGlobalWindow;
|
||||
class nsIScriptContext;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
// For internal use only - use AutoJSAPI instead.
|
||||
namespace danger {
|
||||
|
||||
/**
|
||||
* Fundamental cx pushing class. All other cx pushing classes are implemented
|
||||
* in terms of this class.
|
||||
*/
|
||||
class MOZ_STACK_CLASS AutoCxPusher
|
||||
{
|
||||
public:
|
||||
explicit AutoCxPusher(JSContext *aCx, bool aAllowNull = false);
|
||||
~AutoCxPusher();
|
||||
|
||||
nsIScriptContext* GetScriptContext() { return mScx; }
|
||||
|
||||
// Returns true if this AutoCxPusher performed the push that is currently at
|
||||
// the top of the cx stack.
|
||||
bool IsStackTop() const;
|
||||
|
||||
private:
|
||||
mozilla::Maybe<JSAutoRequest> mAutoRequest;
|
||||
mozilla::Maybe<JSAutoCompartment> mAutoCompartment;
|
||||
nsCOMPtr<nsIScriptContext> mScx;
|
||||
uint32_t mStackDepthAfterPush;
|
||||
#ifdef DEBUG
|
||||
JSContext* mPushedContext;
|
||||
unsigned mCompartmentDepthOnEntry;
|
||||
#endif
|
||||
};
|
||||
|
||||
} /* namespace danger */
|
||||
|
||||
/*
|
||||
* System-wide setup/teardown routines. Init and Destroy should be invoked
|
||||
* once each, at startup and shutdown (respectively).
|
||||
@ -184,7 +218,7 @@ protected:
|
||||
AutoJSAPI(nsIGlobalObject* aGlobalObject, bool aIsMainThread, JSContext* aCx);
|
||||
|
||||
private:
|
||||
mozilla::Maybe<AutoCxPusher> mCxPusher;
|
||||
mozilla::Maybe<danger::AutoCxPusher> mCxPusher;
|
||||
mozilla::Maybe<JSAutoNullableCompartment> mAutoNullableCompartment;
|
||||
JSContext *mCx;
|
||||
|
||||
@ -242,10 +276,79 @@ class AutoNoJSAPI : protected ScriptSettingsStackEntry {
|
||||
public:
|
||||
explicit AutoNoJSAPI(bool aIsMainThread = NS_IsMainThread());
|
||||
private:
|
||||
mozilla::Maybe<AutoCxPusher> mCxPusher;
|
||||
mozilla::Maybe<danger::AutoCxPusher> mCxPusher;
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
||||
/**
|
||||
* Use AutoJSContext when you need a JS context on the stack but don't have one
|
||||
* passed as a parameter. AutoJSContext will take care of finding the most
|
||||
* appropriate JS context and release it when leaving the stack.
|
||||
*/
|
||||
class MOZ_STACK_CLASS AutoJSContext {
|
||||
public:
|
||||
explicit AutoJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM);
|
||||
operator JSContext*() const;
|
||||
|
||||
protected:
|
||||
explicit AutoJSContext(bool aSafe MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
|
||||
|
||||
// We need this Init() method because we can't use delegating constructor for
|
||||
// the moment. It is a C++11 feature and we do not require C++11 to be
|
||||
// supported to be able to compile Gecko.
|
||||
void Init(bool aSafe MOZ_GUARD_OBJECT_NOTIFIER_PARAM);
|
||||
|
||||
JSContext* mCx;
|
||||
dom::AutoJSAPI mJSAPI;
|
||||
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
};
|
||||
|
||||
/**
|
||||
* Use ThreadsafeAutoJSContext when you want an AutoJSContext but might be
|
||||
* running on a worker thread.
|
||||
*/
|
||||
class MOZ_STACK_CLASS ThreadsafeAutoJSContext {
|
||||
public:
|
||||
explicit ThreadsafeAutoJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM);
|
||||
operator JSContext*() const;
|
||||
|
||||
private:
|
||||
JSContext* mCx; // Used on workers. Null means mainthread.
|
||||
Maybe<JSAutoRequest> mRequest; // Used on workers.
|
||||
Maybe<AutoJSContext> mAutoJSContext; // Used on main thread.
|
||||
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
};
|
||||
|
||||
/**
|
||||
* AutoSafeJSContext is similar to AutoJSContext but will only return the safe
|
||||
* JS context. That means it will never call nsContentUtils::GetCurrentJSContext().
|
||||
*
|
||||
* Note - This is deprecated. Please use AutoJSAPI instead.
|
||||
*/
|
||||
class MOZ_STACK_CLASS AutoSafeJSContext : public AutoJSContext {
|
||||
public:
|
||||
explicit AutoSafeJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM);
|
||||
private:
|
||||
JSAutoCompartment mAc;
|
||||
};
|
||||
|
||||
/**
|
||||
* Like AutoSafeJSContext but can be used safely on worker threads.
|
||||
*/
|
||||
class MOZ_STACK_CLASS ThreadsafeAutoSafeJSContext {
|
||||
public:
|
||||
explicit ThreadsafeAutoSafeJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM);
|
||||
operator JSContext*() const;
|
||||
|
||||
private:
|
||||
JSContext* mCx; // Used on workers. Null means mainthread.
|
||||
Maybe<JSAutoRequest> mRequest; // Used on workers.
|
||||
Maybe<AutoSafeJSContext> mAutoSafeJSContext; // Used on main thread.
|
||||
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
};
|
||||
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla_dom_ScriptSettings_h
|
||||
|
@ -21,7 +21,6 @@
|
||||
#include "nsArrayUtils.h"
|
||||
#include "nsIMutableArray.h"
|
||||
#include "nsContentPermissionHelper.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
|
@ -48,7 +48,6 @@
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIDOMGlobalPropertyInitializer.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
|
@ -119,7 +119,6 @@
|
||||
#include "nsGlobalWindowCommands.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsCSSProps.h"
|
||||
#include "nsIDOMFile.h"
|
||||
#include "nsIDOMFileList.h"
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "nsITimer.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsCycleCollector.h"
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "xpcprivate.h"
|
||||
#include "WorkerPrivate.h"
|
||||
|
@ -11831,7 +11831,6 @@ class CGBindingRoot(CGThing):
|
||||
bindingHeaders["nsThreadUtils.h"] = hasWorkerStuff
|
||||
|
||||
dictionaries = config.getDictionaries(webIDLFile=webIDLFile)
|
||||
bindingHeaders["nsCxPusher.h"] = dictionaries
|
||||
hasNonEmptyDictionaries = any(
|
||||
len(dict.members) > 0 for dict in dictionaries)
|
||||
mainCallbacks = config.getCallbacks(webIDLFile=webIDLFile,
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "base/basictypes.h"
|
||||
#include "BluetoothReplyRunnable.h"
|
||||
#include "DOMRequest.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
|
||||
#include "mozilla/ipc/UnixSocket.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsISettingsService.h"
|
||||
#include "nsISystemMessagesInternal.h"
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "mozilla/Scoped.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsISystemMessagesInternal.h"
|
||||
#include "nsString.h"
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "mozilla/Scoped.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsISystemMessagesInternal.h"
|
||||
#include "nsString.h"
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "base/basictypes.h"
|
||||
#include "BluetoothReplyRunnable.h"
|
||||
#include "DOMRequest.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
|
||||
#include "mozilla/dom/Promise.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsISettingsService.h"
|
||||
#include "nsISystemMessagesInternal.h"
|
||||
|
@ -12,9 +12,9 @@
|
||||
#include "BluetoothUtils.h"
|
||||
#include "jsapi.h"
|
||||
#include "mozilla/Scoped.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsISystemMessagesInternal.h"
|
||||
#include "nsString.h"
|
||||
|
@ -11,9 +11,9 @@
|
||||
#include "BluetoothUtils.h"
|
||||
#include "jsapi.h"
|
||||
#include "mozilla/Scoped.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/bluetooth/BluetoothTypes.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsISystemMessagesInternal.h"
|
||||
#include "nsString.h"
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsVariant.h"
|
||||
#include "mozilla/dom/BrowserElementDictionariesBinding.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "mozilla/dom/CustomEvent.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "GLContext.h"
|
||||
#include "jsapi.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIDOMDataContainerEvent.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
@ -24,6 +23,8 @@
|
||||
#include "WebGLTexture.h"
|
||||
#include "WebGLVertexArray.h"
|
||||
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
using namespace gl;
|
||||
|
@ -43,7 +43,6 @@
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "DeviceStorageFileDescriptor.h"
|
||||
#include "DeviceStorageRequestChild.h"
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "mozilla/JSEventHandler.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsDOMClassInfoID.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "nsJSUtils.h"
|
||||
|
@ -12,10 +12,10 @@
|
||||
#include "nsDOMClassInfo.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/FMRadioChild.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsISettingsService.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
|
||||
#define BAND_87500_108000_kHz 1
|
||||
#define BAND_76000_108000_kHz 2
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsCharSeparatedTokenizer.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsDOMClassInfoID.h"
|
||||
#include "nsGlobalWindow.h"
|
||||
#include "nsHashKeys.h"
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "mozilla/dom/ProgressEvent.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsDebug.h"
|
||||
#include "nsError.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "nsDOMClassInfoID.h"
|
||||
#include "nsDOMJSUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsString.h"
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "mozilla/dom/ipc/Blob.h"
|
||||
#include "mozilla/dom/TabParent.h"
|
||||
#include "mozilla/unused.h"
|
||||
#include "nsCxPusher.h"
|
||||
|
||||
#include "AsyncConnectionHelper.h"
|
||||
#include "DatabaseInfo.h"
|
||||
|
@ -8,10 +8,10 @@
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "nsIPropertyBag2.h"
|
||||
#include "ProcessPriorityManager.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
|
||||
#ifdef MOZ_NUWA_PROCESS
|
||||
#include "ipc/Nuwa.h"
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "mozilla/unused.h"
|
||||
#include "mozIApplication.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsEmbedCID.h"
|
||||
#include <algorithm>
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
|
@ -8,7 +8,6 @@
|
||||
#include "mozilla/dom/GetUserMediaRequestBinding.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsCxPusher.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include "MediaPermissionGonk.h"
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIContentPermissionPrompt.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIDOMNavigatorUserMedia.h"
|
||||
|
@ -6,8 +6,9 @@
|
||||
|
||||
#include "MobileConnectionInfo.h"
|
||||
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "nsCxPusher.h"
|
||||
|
||||
#define CONVERT_STRING_TO_NULLABLE_ENUM(_string, _enumType, _enum) \
|
||||
{ \
|
||||
|
@ -14,9 +14,9 @@
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
#include "mozilla/dom/mobilemessage/Constants.h" // For MessageType
|
||||
#include "mozilla/dom/mobilemessage/SmsTypes.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/ToJSValue.h"
|
||||
#include "nsDOMFile.h"
|
||||
#include "nsCxPusher.h"
|
||||
|
||||
using namespace mozilla::dom::mobilemessage;
|
||||
|
||||
|
@ -6,7 +6,6 @@
|
||||
#include "MobileMessageCallback.h"
|
||||
#include "mozilla/dom/ToJSValue.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIDOMMozSmsMessage.h"
|
||||
#include "nsIDOMMozMmsMessage.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "SmsMessage.h"
|
||||
#include "SmsFilter.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "mozilla/dom/MozMobileMessageManagerBinding.h"
|
||||
#include "mozilla/dom/BindingUtils.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "mozilla/dom/mobilemessage/Constants.h" // For MessageType
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsTArrayHelpers.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "xpcpublic.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "DeletedMessageInfo.h"
|
||||
|
@ -7,12 +7,12 @@
|
||||
#include "jsfriendapi.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsIDOMTCPSocket.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "mozilla/unused.h"
|
||||
#include "mozilla/AppProcessChecker.h"
|
||||
#include "mozilla/net/NeckoCommon.h"
|
||||
#include "mozilla/net/PNeckoParent.h"
|
||||
#include "mozilla/dom/ContentParent.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/TabParent.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "mozilla/dom/ToJSValue.h"
|
||||
#include "mozilla/dom/RootedDictionary.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsString.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "NfcOptions.h"
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "nsIScriptContext.h"
|
||||
#include "nsDOMJSUtils.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIJSRuntimeService.h"
|
||||
#include "nsIXPConnect.h"
|
||||
|
@ -40,7 +40,6 @@
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsWildCard.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
|
||||
#include "nsIXPConnect.h"
|
||||
|
@ -10,8 +10,7 @@
|
||||
#include "npfunctions.h"
|
||||
#include "nsPluginHost.h"
|
||||
|
||||
#include "nsCxPusher.h"
|
||||
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/PluginLibrary.h"
|
||||
|
||||
#if defined(XP_WIN)
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "nsNPAPIPlugin.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "PluginScriptableObjectUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "mozilla/unused.h"
|
||||
|
||||
using namespace mozilla::plugins::parent;
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "mozilla/DebugOnly.h"
|
||||
#include "mozilla/plugins/PluginIdentifierParent.h"
|
||||
#include "mozilla/unused.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsNPAPIPlugin.h"
|
||||
#include "PluginScriptableObjectUtils.h"
|
||||
|
||||
|
@ -36,7 +36,6 @@
|
||||
#include "nsIContentViewer.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsIScriptChannel.h"
|
||||
|
@ -30,13 +30,13 @@
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "base/message_loop.h"
|
||||
|
||||
#include "BluetoothCommon.h"
|
||||
#include "BluetoothHfpManagerBase.h"
|
||||
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsDebug.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsISettingsService.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsPrintfCString.h"
|
||||
@ -19,6 +18,7 @@
|
||||
#include "nsString.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "xpcpublic.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
|
||||
#undef LOG
|
||||
|
@ -7,9 +7,9 @@
|
||||
#include <nsThreadUtils.h>
|
||||
#include "mozilla/ModuleUtils.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/dom/ToJSValue.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "nsCxPusher.h"
|
||||
|
||||
#define NS_NETWORKWORKER_CID \
|
||||
{ 0x6df093e1, 0x8127, 0x4fa7, {0x90, 0x13, 0xa3, 0xaa, 0xa7, 0x79, 0xbb, 0xdd} }
|
||||
|
@ -27,12 +27,12 @@
|
||||
#include "AutoMounter.h"
|
||||
#include "TimeZoneSettingObserver.h"
|
||||
#include "AudioManager.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#ifdef MOZ_B2G_RIL
|
||||
#include "mozilla/ipc/Ril.h"
|
||||
#endif
|
||||
#include "mozilla/ipc/KeyStore.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsRadioInterfaceLayer.h"
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "base/message_loop.h"
|
||||
#include "jsapi.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/Hal.h"
|
||||
@ -20,7 +21,6 @@
|
||||
#include "TimeZoneSettingObserver.h"
|
||||
#include "xpcpublic.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsPrintfCString.h"
|
||||
|
||||
#undef LOG
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsCharSeparatedTokenizer.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
@ -6,10 +6,10 @@
|
||||
#include "DateCacheCleaner.h"
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/Hal.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "nsCxPusher.h"
|
||||
|
||||
using namespace mozilla::hal;
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "cert.h"
|
||||
#include "certdb.h"
|
||||
#include "CryptoTask.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIDOMFile.h"
|
||||
#include "nsIWifiService.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "mozilla/dom/ToJSValue.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
#include "WifiUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
|
||||
#ifdef MOZ_TASK_TRACER
|
||||
#include "GeckoTaskTracer.h"
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "mozilla/dom/WifiOptionsBinding.h"
|
||||
#include "mozilla/dom/network/NetUtils.h"
|
||||
#include "WifiHotspotUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
|
||||
// Needed to add a copy constructor to WifiCommandOptions.
|
||||
struct CommandOptions
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "mozilla/dom/PromiseNativeHandler.h"
|
||||
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsProxyRelease.h"
|
||||
#include "nsTArray.h"
|
||||
|
@ -53,7 +53,6 @@
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "nsAlgorithm.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsError.h"
|
||||
#include "nsDOMJSUtils.h"
|
||||
#include "nsHostObjectProtocolHandler.h"
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "mozilla/dom/ProgressEvent.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
||||
|
@ -23,7 +23,6 @@
|
||||
#include "nsJSPrincipals.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsDOMJSUtils.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "xpcpublic.h"
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "nsIContent.h"
|
||||
#include "nsIDocument.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIDOMNode.h"
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include "nsXBLProtoImplMethod.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "xpcpublic.h"
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "nsIContent.h"
|
||||
#include "nsXBLProtoImplProperty.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsXBLPrototypeBinding.h"
|
||||
|
@ -9,7 +9,6 @@
|
||||
#include "nsXBLPrototypeHandler.h"
|
||||
#include "nsXBLPrototypeBinding.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsGlobalWindow.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIAtom.h"
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "nsXBLPrototypeBinding.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
@ -19,7 +19,6 @@
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
#include "nsJSPrincipals.h"
|
||||
#include "jswrapper.h"
|
||||
|
@ -68,7 +68,14 @@ public:
|
||||
MOZ_ASSERT(cairo_status(mCtx) || dt->GetTransform() == GetTransform());
|
||||
}
|
||||
|
||||
~AutoPrepareForDrawing() { cairo_restore(mCtx); }
|
||||
~AutoPrepareForDrawing()
|
||||
{
|
||||
cairo_restore(mCtx);
|
||||
cairo_status_t status = cairo_status(mCtx);
|
||||
if (status) {
|
||||
gfxWarning() << "DrawTargetCairo context in error state: " << cairo_status_to_string(status) << "(" << status << ")";
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
#ifdef DEBUG
|
||||
@ -1290,6 +1297,13 @@ DrawTargetCairo::InitAlreadyReferenced(cairo_surface_t* aSurface, const IntSize&
|
||||
mSize = aSize;
|
||||
mFormat = aFormat ? *aFormat : CairoContentToGfxFormat(cairo_surface_get_content(aSurface));
|
||||
|
||||
// Cairo image surface have a bug where they will allocate a mask surface (for clipping)
|
||||
// the size of the clip extents, and don't take the surface extents into account.
|
||||
// Add a manual clip to the surface extents to prevent this.
|
||||
cairo_new_path(mContext);
|
||||
cairo_rectangle(mContext, 0, 0, mSize.width, mSize.height);
|
||||
cairo_clip(mContext);
|
||||
|
||||
if (mFormat == SurfaceFormat::B8G8R8A8 ||
|
||||
mFormat == SurfaceFormat::R8G8B8A8) {
|
||||
SetPermitSubpixelAA(false);
|
||||
|
@ -58,6 +58,7 @@ gfxPattern::gfxPattern(SourceSurface *aSurface, const Matrix &aTransform)
|
||||
, mSourceSurface(aSurface)
|
||||
, mTransform(aTransform)
|
||||
, mExtend(EXTEND_NONE)
|
||||
, mFilter(mozilla::gfx::Filter::GOOD)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,6 @@
|
||||
#include "nsIXPConnect.h"
|
||||
#include "nsIXPCScriptable.h"
|
||||
|
||||
#include "nsCxPusher.h"
|
||||
#include "nsJSUtils.h"
|
||||
#include "nsJSPrincipals.h"
|
||||
#include "nsThreadUtils.h"
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "nsContentUtils.h"
|
||||
#include "xpcprivate.h"
|
||||
#include "jsfriendapi.h"
|
||||
#include "nsCxPusher.h"
|
||||
#include "AccessCheck.h"
|
||||
|
||||
using namespace JS;
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "nsContentUtils.h"
|
||||
#include "xpcprivate.h"
|
||||
#include "jsfriendapi.h"
|
||||
#include "nsCxPusher.h"
|
||||
|
||||
using namespace JS;
|
||||
using namespace mozilla;
|
||||
|
@ -90,7 +90,7 @@ namespace JS {
|
||||
D(REFRESH_FRAME) \
|
||||
D(FULL_GC_TIMER) \
|
||||
D(SHUTDOWN_CC) \
|
||||
D(FINISH_LARGE_EVALUTE)
|
||||
D(FINISH_LARGE_EVALUATE)
|
||||
|
||||
namespace gcreason {
|
||||
|
||||
|
@ -959,6 +959,7 @@ class HashTable : private AllocPolicy
|
||||
// a new key at the new Lookup position. |front()| is invalid after
|
||||
// this operation until the next call to |popFront()|.
|
||||
void rekeyFront(const Lookup &l, const Key &k) {
|
||||
JS_ASSERT(&k != &HashPolicy::getKey(this->cur->get()));
|
||||
Ptr p(*this->cur, table_);
|
||||
table_.rekeyWithoutRehash(p, l, k);
|
||||
rekeyed = true;
|
||||
|
@ -43,6 +43,7 @@ namespace js {}
|
||||
#define JS_SWEPT_NURSERY_PATTERN 0x2B
|
||||
#define JS_ALLOCATED_NURSERY_PATTERN 0x2D
|
||||
#define JS_FRESH_TENURED_PATTERN 0x4F
|
||||
#define JS_MOVED_TENURED_PATTERN 0x49
|
||||
#define JS_SWEPT_TENURED_PATTERN 0x4B
|
||||
#define JS_ALLOCATED_TENURED_PATTERN 0x4D
|
||||
#define JS_SWEPT_CODE_PATTERN 0x3b
|
||||
|
@ -42,15 +42,15 @@ namespace JSC { typedef MacroAssemblerNone MacroAssembler; }
|
||||
#elif JS_CODEGEN_ARM
|
||||
// Merged with the jit backend support.
|
||||
|
||||
#elif WTF_CPU_MIPS
|
||||
#elif JS_CODEGEN_MIPS
|
||||
#include "assembler/assembler/MacroAssemblerMIPS.h"
|
||||
namespace JSC { typedef MacroAssemblerMIPS MacroAssembler; }
|
||||
|
||||
#elif WTF_CPU_X86
|
||||
#elif JS_CODEGEN_X86
|
||||
#include "assembler/assembler/MacroAssemblerX86.h"
|
||||
namespace JSC { typedef MacroAssemblerX86 MacroAssembler; }
|
||||
|
||||
#elif WTF_CPU_X86_64
|
||||
#elif JS_CODEGEN_X64
|
||||
#include "assembler/assembler/MacroAssemblerX86_64.h"
|
||||
namespace JSC { typedef MacroAssemblerX86_64 MacroAssembler; }
|
||||
|
||||
|
@ -37,7 +37,7 @@ class MacroAssemblerMIPS {
|
||||
public:
|
||||
static bool supportsFloatingPoint()
|
||||
{
|
||||
#if WTF_MIPS_DOUBLE_FLOAT
|
||||
#if (defined(__mips_hard_float) && !defined(__mips_single_float)) || defined(JS_MIPS_SIMULATOR)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
|
@ -30,10 +30,6 @@
|
||||
#ifndef assembler_assembler_MacroAssemblerX86_h
|
||||
#define assembler_assembler_MacroAssemblerX86_h
|
||||
|
||||
#include "assembler/wtf/Platform.h"
|
||||
|
||||
#if ENABLE_ASSEMBLER && WTF_CPU_X86
|
||||
|
||||
#include "assembler/assembler/MacroAssemblerX86Common.h"
|
||||
|
||||
namespace JSC {
|
||||
@ -45,6 +41,4 @@ public:
|
||||
|
||||
} // namespace JSC
|
||||
|
||||
#endif // ENABLE(ASSEMBLER)
|
||||
|
||||
#endif /* assembler_assembler_MacroAssemblerX86_h */
|
||||
|
@ -4,15 +4,12 @@
|
||||
* 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/. */
|
||||
|
||||
#include "assembler/wtf/Platform.h"
|
||||
|
||||
/* SSE checks only make sense on Intel platforms. */
|
||||
#if WTF_CPU_X86 || WTF_CPU_X86_64
|
||||
|
||||
#include "assembler/assembler/MacroAssemblerX86Common.h"
|
||||
|
||||
#if WTF_COMPILER_MSVC
|
||||
#if WTF_CPU_X86_64
|
||||
#include "assembler/wtf/Platform.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#ifdef JS_CODEGEN_X64
|
||||
/* for __cpuid */
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
@ -33,8 +30,8 @@ void MacroAssemblerX86Common::setSSECheckState()
|
||||
// not MSVC or GCC we will read this as SSE2 not present.
|
||||
int flags_edx = 0;
|
||||
int flags_ecx = 0;
|
||||
#if WTF_COMPILER_MSVC
|
||||
#if WTF_CPU_X86_64
|
||||
#ifdef _MSC_VER
|
||||
#ifdef JS_CODEGEN_X64
|
||||
int cpuinfo[4];
|
||||
|
||||
__cpuid(cpuinfo, 1);
|
||||
@ -48,8 +45,8 @@ void MacroAssemblerX86Common::setSSECheckState()
|
||||
mov flags_edx, edx;
|
||||
}
|
||||
#endif
|
||||
#elif WTF_COMPILER_GCC
|
||||
#if WTF_CPU_X86_64
|
||||
#elif defined(__GNUC__)
|
||||
#ifdef JS_CODEGEN_X64
|
||||
asm (
|
||||
"movl $0x1, %%eax;"
|
||||
"cpuid;"
|
||||
@ -69,32 +66,6 @@ void MacroAssemblerX86Common::setSSECheckState()
|
||||
: "%eax"
|
||||
);
|
||||
#endif
|
||||
#elif WTF_COMPILER_SUNCC
|
||||
#if WTF_CPU_X86_64
|
||||
asm (
|
||||
"movl $0x1, %%eax;"
|
||||
"pushq %%rbx;"
|
||||
"cpuid;"
|
||||
"popq %%rbx;"
|
||||
"movl %%ecx, (%rsi);"
|
||||
"movl %%edx, (%rdi);"
|
||||
:
|
||||
: "S" (&flags_ecx), "D" (&flags_edx)
|
||||
: "%eax", "%ecx", "%edx"
|
||||
);
|
||||
#else
|
||||
asm (
|
||||
"movl $0x1, %eax;"
|
||||
"pushl %ebx;"
|
||||
"cpuid;"
|
||||
"popl %ebx;"
|
||||
"movl %ecx, (%esi);"
|
||||
"movl %edx, (%edi);"
|
||||
:
|
||||
: "S" (&flags_ecx), "D" (&flags_edx)
|
||||
: "%eax", "%ecx", "%edx"
|
||||
);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -133,6 +104,3 @@ void MacroAssemblerX86Common::setSSECheckState()
|
||||
s_sseCheckState = HasSSE2;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* WTF_CPU_X86 || WTF_CPU_X86_64 */
|
||||
|
||||
|
@ -70,7 +70,7 @@ private:
|
||||
static void setSSECheckState();
|
||||
|
||||
public:
|
||||
#if WTF_CPU_X86
|
||||
#ifdef JS_CODEGEN_X86
|
||||
static bool isSSEPresent()
|
||||
{
|
||||
#if defined(__SSE__) && !defined(DEBUG)
|
||||
|
@ -30,10 +30,6 @@
|
||||
#ifndef assembler_assembler_MacroAssemblerX86_64_h
|
||||
#define assembler_assembler_MacroAssemblerX86_64_h
|
||||
|
||||
#include "assembler/wtf/Platform.h"
|
||||
|
||||
#if ENABLE_ASSEMBLER && WTF_CPU_X86_64
|
||||
|
||||
#include "assembler/assembler/MacroAssemblerX86Common.h"
|
||||
|
||||
namespace JSC {
|
||||
@ -45,6 +41,4 @@ public:
|
||||
|
||||
} // namespace JSC
|
||||
|
||||
#endif // ENABLE(ASSEMBLER)
|
||||
|
||||
#endif /* assembler_assembler_MacroAssemblerX86_64_h */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user