mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 11:57:32 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
92d9218cf1
28 changed files with 239 additions and 72 deletions
|
|
@ -286,6 +286,7 @@ FilePickerParent::RecvOpen(const int16_t& aSelectedType,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MOZ_ASSERT(!mCallback);
|
||||||
mCallback = new FilePickerShownCallback(this);
|
mCallback = new FilePickerShownCallback(this);
|
||||||
|
|
||||||
mFilePicker->Open(mCallback);
|
mFilePicker->Open(mCallback);
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ class FilePickerParent : public PFilePickerParent
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual ~FilePickerShownCallback() {}
|
virtual ~FilePickerShownCallback() {}
|
||||||
FilePickerParent* mFilePickerParent;
|
RefPtr<FilePickerParent> mFilePickerParent;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
@ -78,7 +78,7 @@ class FilePickerParent : public PFilePickerParent
|
||||||
// This runnable is used to do some I/O operation on a separate thread.
|
// This runnable is used to do some I/O operation on a separate thread.
|
||||||
class IORunnable : public Runnable
|
class IORunnable : public Runnable
|
||||||
{
|
{
|
||||||
FilePickerParent* mFilePickerParent;
|
RefPtr<FilePickerParent> mFilePickerParent;
|
||||||
nsTArray<nsCOMPtr<nsIFile>> mFiles;
|
nsTArray<nsCOMPtr<nsIFile>> mFiles;
|
||||||
nsTArray<BlobImplOrString> mResults;
|
nsTArray<BlobImplOrString> mResults;
|
||||||
nsCOMPtr<nsIEventTarget> mEventTarget;
|
nsCOMPtr<nsIEventTarget> mEventTarget;
|
||||||
|
|
|
||||||
|
|
@ -1688,6 +1688,11 @@ Notification::GetPermissionInternal(nsISupports* aGlobal, ErrorResult& aRv)
|
||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIPrincipal> principal = sop->GetPrincipal();
|
nsCOMPtr<nsIPrincipal> principal = sop->GetPrincipal();
|
||||||
|
if (!principal) {
|
||||||
|
aRv.Throw(NS_ERROR_UNEXPECTED);
|
||||||
|
return NotificationPermission::Denied;
|
||||||
|
}
|
||||||
|
|
||||||
return GetPermissionInternal(principal, aRv);
|
return GetPermissionInternal(principal, aRv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,8 @@ SharedSurface_Basic::~SharedSurface_Basic()
|
||||||
mGL->fDeleteFramebuffers(1, &mFB);
|
mGL->fDeleteFramebuffers(1, &mFB);
|
||||||
|
|
||||||
if (mOwnsTex)
|
if (mOwnsTex)
|
||||||
mGL->fDeleteTextures(1, &mTex);
|
if (mTex)
|
||||||
|
mGL->fDeleteTextures(1, &mTex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7754,10 +7754,23 @@ bool
|
||||||
BytecodeEmitter::emitLeftAssociative(ListNode* node)
|
BytecodeEmitter::emitLeftAssociative(ListNode* node)
|
||||||
{
|
{
|
||||||
// Left-associative operator chain.
|
// Left-associative operator chain.
|
||||||
if (!emitTree(node->head()))
|
|
||||||
return false;
|
|
||||||
JSOp op = node->getOp();
|
JSOp op = node->getOp();
|
||||||
ParseNode* nextExpr = node->head()->pn_next;
|
ParseNode* headExpr = node->head();
|
||||||
|
if (op == JSOP_IN && headExpr->isKind(PNK_NAME) && headExpr->as<NameNode>().isPrivateName()) {
|
||||||
|
// {Goanna} The only way a "naked" private name can show up as the leftmost side of an in-chain
|
||||||
|
// is from an ergonomic brand check (`this.#x in ...` would be a PNK_DOT child node).
|
||||||
|
// Instead of going through the emitTree machinery, we pretend that this identifier
|
||||||
|
// reference is actually a string, which allows us to use the JSOP_IN interpreter routines.
|
||||||
|
// This erroneously doesn't call updateLineNumberNotes, but this is not a big issue:
|
||||||
|
// the begin pos is correct as we're on the start of the current tree, the end is on the
|
||||||
|
// same line anyway.
|
||||||
|
if (!emitAtomOp(headExpr->as<NameNode>().atom(), JSOP_STRING))
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
if (!emitTree(headExpr))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ParseNode* nextExpr = headExpr->pn_next;
|
||||||
do {
|
do {
|
||||||
if (!emitTree(nextExpr))
|
if (!emitTree(nextExpr))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -965,6 +965,10 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
||||||
return node->isKind(PNK_NAME);
|
return node->isKind(PNK_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isPrivateName(Node node) {
|
||||||
|
return node->isKind(PNK_NAME) && node->as<NameNode>().isPrivateName();
|
||||||
|
}
|
||||||
|
|
||||||
bool isArgumentsAnyParentheses(Node node, ExclusiveContext* cx) {
|
bool isArgumentsAnyParentheses(Node node, ExclusiveContext* cx) {
|
||||||
return node->isKind(PNK_NAME) && node->as<NameNode>().atom() == cx->names().arguments;
|
return node->isKind(PNK_NAME) && node->as<NameNode>().atom() == cx->names().arguments;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -953,6 +953,10 @@ class NameNode : public ParseNode
|
||||||
JSAtom* atom() const {
|
JSAtom* atom() const {
|
||||||
return pn_u.name.atom;
|
return pn_u.name.atom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isPrivateName() const {
|
||||||
|
return atom()->asPropertyName()->latin1OrTwoByteChar(0) == '#';
|
||||||
|
}
|
||||||
|
|
||||||
ParseNode* initializer() const {
|
ParseNode* initializer() const {
|
||||||
return pn_u.name.initOrStmt;
|
return pn_u.name.initOrStmt;
|
||||||
|
|
|
||||||
|
|
@ -8951,6 +8951,15 @@ Parser<ParseHandler>::orExpr1(InHandling inHandling, YieldHandling yieldHandling
|
||||||
if (!tokenStream.getToken(&tok))
|
if (!tokenStream.getToken(&tok))
|
||||||
return null();
|
return null();
|
||||||
|
|
||||||
|
// Ensure that if we have a private name lhs we are legally constructing a
|
||||||
|
// `#x in obj` expression:
|
||||||
|
if (handler.isPrivateName(pn)) {
|
||||||
|
if (tok != TOK_IN) {
|
||||||
|
error(JSMSG_ILLEGAL_PRIVATE_NAME);
|
||||||
|
return null();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ParseNodeKind pnk;
|
ParseNodeKind pnk;
|
||||||
if (tok == TOK_IN ? inHandling == InAllowed : TokenKindIsBinaryOp(tok)) {
|
if (tok == TOK_IN ? inHandling == InAllowed : TokenKindIsBinaryOp(tok)) {
|
||||||
// We're definitely not in a destructuring context, so report any
|
// We're definitely not in a destructuring context, so report any
|
||||||
|
|
@ -8987,7 +8996,20 @@ Parser<ParseHandler>::orExpr1(InHandling inHandling, YieldHandling yieldHandling
|
||||||
// If we have not detected a mixing error at this point, record that
|
// If we have not detected a mixing error at this point, record that
|
||||||
// we have an unparenthesized expression, in case we have one later.
|
// we have an unparenthesized expression, in case we have one later.
|
||||||
unparenthesizedExpression = EnforcedParentheses::CoalesceExpr;
|
unparenthesizedExpression = EnforcedParentheses::CoalesceExpr;
|
||||||
break;
|
break;
|
||||||
|
case TOK_IN:
|
||||||
|
// if the LHS is a private name, and the operator is In,
|
||||||
|
// ensure we're construcing an ergonomic brand check of
|
||||||
|
// '#x in y', rather than having a higher precedence operator
|
||||||
|
// like + cause a different reduction, such as
|
||||||
|
// 1 + #x in y.
|
||||||
|
if (handler.isPrivateName(pn)) {
|
||||||
|
if (depth > 0 && Precedence(kindStack[depth - 1]) >= Precedence(PNK_IN)) {
|
||||||
|
error(JSMSG_ILLEGAL_PRIVATE_NAME);
|
||||||
|
return null();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// Do nothing in other cases.
|
// Do nothing in other cases.
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -104,6 +104,9 @@ class SyntaxParseHandler
|
||||||
// Node representing the "async" name, which may actually be a
|
// Node representing the "async" name, which may actually be a
|
||||||
// contextual keyword.
|
// contextual keyword.
|
||||||
NodePotentialAsyncKeyword,
|
NodePotentialAsyncKeyword,
|
||||||
|
|
||||||
|
// Node representing a private name. Handled mostly like NodeUnparenthesizedName.
|
||||||
|
NodePrivateName,
|
||||||
|
|
||||||
// Valuable for recognizing potential destructuring patterns.
|
// Valuable for recognizing potential destructuring patterns.
|
||||||
NodeUnparenthesizedArray,
|
NodeUnparenthesizedArray,
|
||||||
|
|
@ -212,6 +215,8 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
||||||
return NodePotentialAsyncKeyword;
|
return NodePotentialAsyncKeyword;
|
||||||
if (name == cx->names().eval)
|
if (name == cx->names().eval)
|
||||||
return NodeUnparenthesizedEvalName;
|
return NodeUnparenthesizedEvalName;
|
||||||
|
if (name->length() >= 1 && name->latin1OrTwoByteChar(0) == '#')
|
||||||
|
return NodePrivateName;
|
||||||
return NodeUnparenthesizedName;
|
return NodeUnparenthesizedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -614,7 +619,8 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
||||||
return node == NodeUnparenthesizedArgumentsName ||
|
return node == NodeUnparenthesizedArgumentsName ||
|
||||||
node == NodeUnparenthesizedEvalName ||
|
node == NodeUnparenthesizedEvalName ||
|
||||||
node == NodeUnparenthesizedName ||
|
node == NodeUnparenthesizedName ||
|
||||||
node == NodePotentialAsyncKeyword;
|
node == NodePotentialAsyncKeyword ||
|
||||||
|
node == NodePrivateName;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isNameAnyParentheses(Node node) {
|
bool isNameAnyParentheses(Node node) {
|
||||||
|
|
@ -625,6 +631,10 @@ FOR_EACH_PARSENODE_SUBCLASS(DECLARE_AS)
|
||||||
node == NodeParenthesizedName;
|
node == NodeParenthesizedName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isPrivateName(Node node) {
|
||||||
|
return node == NodePrivateName;
|
||||||
|
}
|
||||||
|
|
||||||
bool isArgumentsAnyParentheses(Node node, ExclusiveContext* cx) {
|
bool isArgumentsAnyParentheses(Node node, ExclusiveContext* cx) {
|
||||||
return node == NodeUnparenthesizedArgumentsName || node == NodeParenthesizedArgumentsName;
|
return node == NodeUnparenthesizedArgumentsName || node == NodeParenthesizedArgumentsName;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -364,6 +364,7 @@ MSG_DEF(JSMSG_BAD_NEW_OPTIONAL, 0, JSEXN_SYNTAXERR, "new keyword cannot b
|
||||||
MSG_DEF(JSMSG_BAD_OPTIONAL_TEMPLATE, 0, JSEXN_SYNTAXERR, "tagged template cannot be used with optional chain")
|
MSG_DEF(JSMSG_BAD_OPTIONAL_TEMPLATE, 0, JSEXN_SYNTAXERR, "tagged template cannot be used with optional chain")
|
||||||
MSG_DEF(JSMSG_ESCAPED_KEYWORD, 0, JSEXN_SYNTAXERR, "keywords must be written literally, without embedded escapes")
|
MSG_DEF(JSMSG_ESCAPED_KEYWORD, 0, JSEXN_SYNTAXERR, "keywords must be written literally, without embedded escapes")
|
||||||
MSG_DEF(JSMSG_FIELDS_NOT_SUPPORTED, 0, JSEXN_SYNTAXERR, "fields are not currently supported")
|
MSG_DEF(JSMSG_FIELDS_NOT_SUPPORTED, 0, JSEXN_SYNTAXERR, "fields are not currently supported")
|
||||||
|
MSG_DEF(JSMSG_ILLEGAL_PRIVATE_NAME, 0, JSEXN_SYNTAXERR, "private names aren't valid in this context")
|
||||||
|
|
||||||
// asm.js
|
// asm.js
|
||||||
MSG_DEF(JSMSG_USE_ASM_TYPE_FAIL, 1, JSEXN_TYPEERR, "asm.js type error: {0}")
|
MSG_DEF(JSMSG_USE_ASM_TYPE_FAIL, 1, JSEXN_TYPEERR, "asm.js type error: {0}")
|
||||||
|
|
|
||||||
|
|
@ -373,7 +373,7 @@ CSS_PROP_DISPLAY(
|
||||||
AnimationDelay,
|
AnimationDelay,
|
||||||
CSS_PROPERTY_PARSE_VALUE_LIST |
|
CSS_PROPERTY_PARSE_VALUE_LIST |
|
||||||
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
||||||
"",
|
"layout.css.animation.enabled",
|
||||||
VARIANT_TIME, // used by list parsing
|
VARIANT_TIME, // used by list parsing
|
||||||
nullptr,
|
nullptr,
|
||||||
CSS_PROP_NO_OFFSET,
|
CSS_PROP_NO_OFFSET,
|
||||||
|
|
@ -384,7 +384,7 @@ CSS_PROP_DISPLAY(
|
||||||
AnimationDirection,
|
AnimationDirection,
|
||||||
CSS_PROPERTY_PARSE_VALUE_LIST |
|
CSS_PROPERTY_PARSE_VALUE_LIST |
|
||||||
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
||||||
"",
|
"layout.css.animation.enabled",
|
||||||
VARIANT_KEYWORD, // used by list parsing
|
VARIANT_KEYWORD, // used by list parsing
|
||||||
kAnimationDirectionKTable,
|
kAnimationDirectionKTable,
|
||||||
CSS_PROP_NO_OFFSET,
|
CSS_PROP_NO_OFFSET,
|
||||||
|
|
@ -395,7 +395,7 @@ CSS_PROP_DISPLAY(
|
||||||
AnimationDuration,
|
AnimationDuration,
|
||||||
CSS_PROPERTY_PARSE_VALUE_LIST |
|
CSS_PROPERTY_PARSE_VALUE_LIST |
|
||||||
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
||||||
"",
|
"layout.css.animation.enabled",
|
||||||
VARIANT_TIME | VARIANT_NONNEGATIVE_DIMENSION, // used by list parsing
|
VARIANT_TIME | VARIANT_NONNEGATIVE_DIMENSION, // used by list parsing
|
||||||
nullptr,
|
nullptr,
|
||||||
CSS_PROP_NO_OFFSET,
|
CSS_PROP_NO_OFFSET,
|
||||||
|
|
@ -406,7 +406,7 @@ CSS_PROP_DISPLAY(
|
||||||
AnimationFillMode,
|
AnimationFillMode,
|
||||||
CSS_PROPERTY_PARSE_VALUE_LIST |
|
CSS_PROPERTY_PARSE_VALUE_LIST |
|
||||||
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
||||||
"",
|
"layout.css.animation.enabled",
|
||||||
VARIANT_KEYWORD, // used by list parsing
|
VARIANT_KEYWORD, // used by list parsing
|
||||||
kAnimationFillModeKTable,
|
kAnimationFillModeKTable,
|
||||||
CSS_PROP_NO_OFFSET,
|
CSS_PROP_NO_OFFSET,
|
||||||
|
|
@ -420,7 +420,7 @@ CSS_PROP_DISPLAY(
|
||||||
// http://lists.w3.org/Archives/Public/www-style/2011Mar/0355.html
|
// http://lists.w3.org/Archives/Public/www-style/2011Mar/0355.html
|
||||||
CSS_PROPERTY_VALUE_NONNEGATIVE |
|
CSS_PROPERTY_VALUE_NONNEGATIVE |
|
||||||
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
||||||
"",
|
"layout.css.animation.enabled",
|
||||||
VARIANT_KEYWORD | VARIANT_NUMBER, // used by list parsing
|
VARIANT_KEYWORD | VARIANT_NUMBER, // used by list parsing
|
||||||
kAnimationIterationCountKTable,
|
kAnimationIterationCountKTable,
|
||||||
CSS_PROP_NO_OFFSET,
|
CSS_PROP_NO_OFFSET,
|
||||||
|
|
@ -431,7 +431,7 @@ CSS_PROP_DISPLAY(
|
||||||
AnimationName,
|
AnimationName,
|
||||||
CSS_PROPERTY_PARSE_VALUE_LIST |
|
CSS_PROPERTY_PARSE_VALUE_LIST |
|
||||||
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
||||||
"",
|
"layout.css.animation.enabled",
|
||||||
// FIXME: The spec should say something about 'inherit' and 'initial'
|
// FIXME: The spec should say something about 'inherit' and 'initial'
|
||||||
// not being allowed.
|
// not being allowed.
|
||||||
VARIANT_NONE | VARIANT_IDENTIFIER_NO_INHERIT, // used by list parsing
|
VARIANT_NONE | VARIANT_IDENTIFIER_NO_INHERIT, // used by list parsing
|
||||||
|
|
@ -444,7 +444,7 @@ CSS_PROP_DISPLAY(
|
||||||
AnimationPlayState,
|
AnimationPlayState,
|
||||||
CSS_PROPERTY_PARSE_VALUE_LIST |
|
CSS_PROPERTY_PARSE_VALUE_LIST |
|
||||||
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
||||||
"",
|
"layout.css.animation.enabled",
|
||||||
VARIANT_KEYWORD, // used by list parsing
|
VARIANT_KEYWORD, // used by list parsing
|
||||||
kAnimationPlayStateKTable,
|
kAnimationPlayStateKTable,
|
||||||
CSS_PROP_NO_OFFSET,
|
CSS_PROP_NO_OFFSET,
|
||||||
|
|
@ -455,7 +455,7 @@ CSS_PROP_DISPLAY(
|
||||||
AnimationTimingFunction,
|
AnimationTimingFunction,
|
||||||
CSS_PROPERTY_PARSE_VALUE_LIST |
|
CSS_PROPERTY_PARSE_VALUE_LIST |
|
||||||
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
||||||
"",
|
"layout.css.animation.enabled",
|
||||||
VARIANT_KEYWORD | VARIANT_TIMING_FUNCTION, // used by list parsing
|
VARIANT_KEYWORD | VARIANT_TIMING_FUNCTION, // used by list parsing
|
||||||
kTransitionTimingFunctionKTable,
|
kTransitionTimingFunctionKTable,
|
||||||
CSS_PROP_NO_OFFSET,
|
CSS_PROP_NO_OFFSET,
|
||||||
|
|
@ -4284,7 +4284,7 @@ CSS_PROP_DISPLAY(
|
||||||
TransitionDelay,
|
TransitionDelay,
|
||||||
CSS_PROPERTY_PARSE_VALUE_LIST |
|
CSS_PROPERTY_PARSE_VALUE_LIST |
|
||||||
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
||||||
"",
|
"layout.css.transition.enabled",
|
||||||
VARIANT_TIME, // used by list parsing
|
VARIANT_TIME, // used by list parsing
|
||||||
nullptr,
|
nullptr,
|
||||||
CSS_PROP_NO_OFFSET,
|
CSS_PROP_NO_OFFSET,
|
||||||
|
|
@ -4295,7 +4295,7 @@ CSS_PROP_DISPLAY(
|
||||||
TransitionDuration,
|
TransitionDuration,
|
||||||
CSS_PROPERTY_PARSE_VALUE_LIST |
|
CSS_PROPERTY_PARSE_VALUE_LIST |
|
||||||
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
||||||
"",
|
"layout.css.transition.enabled",
|
||||||
VARIANT_TIME | VARIANT_NONNEGATIVE_DIMENSION, // used by list parsing
|
VARIANT_TIME | VARIANT_NONNEGATIVE_DIMENSION, // used by list parsing
|
||||||
nullptr,
|
nullptr,
|
||||||
CSS_PROP_NO_OFFSET,
|
CSS_PROP_NO_OFFSET,
|
||||||
|
|
@ -4306,7 +4306,7 @@ CSS_PROP_DISPLAY(
|
||||||
TransitionProperty,
|
TransitionProperty,
|
||||||
CSS_PROPERTY_PARSE_FUNCTION |
|
CSS_PROPERTY_PARSE_FUNCTION |
|
||||||
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
||||||
"",
|
"layout.css.transition.enabled",
|
||||||
VARIANT_IDENTIFIER | VARIANT_NONE | VARIANT_ALL, // used only in shorthand
|
VARIANT_IDENTIFIER | VARIANT_NONE | VARIANT_ALL, // used only in shorthand
|
||||||
nullptr,
|
nullptr,
|
||||||
CSS_PROP_NO_OFFSET,
|
CSS_PROP_NO_OFFSET,
|
||||||
|
|
@ -4317,7 +4317,7 @@ CSS_PROP_DISPLAY(
|
||||||
TransitionTimingFunction,
|
TransitionTimingFunction,
|
||||||
CSS_PROPERTY_PARSE_VALUE_LIST |
|
CSS_PROPERTY_PARSE_VALUE_LIST |
|
||||||
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
|
||||||
"",
|
"layout.css.transition.enabled",
|
||||||
VARIANT_KEYWORD | VARIANT_TIMING_FUNCTION, // used by list parsing
|
VARIANT_KEYWORD | VARIANT_TIMING_FUNCTION, // used by list parsing
|
||||||
kTransitionTimingFunctionKTable,
|
kTransitionTimingFunctionKTable,
|
||||||
CSS_PROP_NO_OFFSET,
|
CSS_PROP_NO_OFFSET,
|
||||||
|
|
|
||||||
|
|
@ -2486,6 +2486,12 @@ pref("layout.css.mix-blend-mode.enabled", true);
|
||||||
// Is support for isolation enabled?
|
// Is support for isolation enabled?
|
||||||
pref("layout.css.isolation.enabled", true);
|
pref("layout.css.isolation.enabled", true);
|
||||||
|
|
||||||
|
// Is support for CSS animation properties enabled?
|
||||||
|
pref("layout.css.animation.enabled", true);
|
||||||
|
|
||||||
|
// Is support for CSS transition properties enabled?
|
||||||
|
pref("layout.css.transition.enabled", true);
|
||||||
|
|
||||||
// Is support for CSS Filters enabled?
|
// Is support for CSS Filters enabled?
|
||||||
pref("layout.css.filters.enabled", true);
|
pref("layout.css.filters.enabled", true);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -520,7 +520,7 @@ private:
|
||||||
~nsOpenConn() { MOZ_COUNT_DTOR(nsOpenConn); }
|
~nsOpenConn() { MOZ_COUNT_DTOR(nsOpenConn); }
|
||||||
|
|
||||||
nsCString mAddress;
|
nsCString mAddress;
|
||||||
WebSocketChannel *mChannel;
|
RefPtr<WebSocketChannel> mChannel;
|
||||||
};
|
};
|
||||||
|
|
||||||
void ConnectNext(nsCString &hostName)
|
void ConnectNext(nsCString &hostName)
|
||||||
|
|
@ -1191,6 +1191,7 @@ WebSocketChannel::WebSocketChannel() :
|
||||||
mBufferSize(kIncomingBufferInitialSize),
|
mBufferSize(kIncomingBufferInitialSize),
|
||||||
mCurrentOut(nullptr),
|
mCurrentOut(nullptr),
|
||||||
mCurrentOutSent(0),
|
mCurrentOutSent(0),
|
||||||
|
mCompressorMutex("WebSocketChannel::mCompressorMutex"),
|
||||||
mDynamicOutputSize(0),
|
mDynamicOutputSize(0),
|
||||||
mDynamicOutput(nullptr),
|
mDynamicOutput(nullptr),
|
||||||
mPrivateBrowsing(false),
|
mPrivateBrowsing(false),
|
||||||
|
|
@ -1627,6 +1628,7 @@ WebSocketChannel::ProcessInput(uint8_t *buffer, uint32_t count)
|
||||||
if (rsvBits) {
|
if (rsvBits) {
|
||||||
// PMCE sets RSV1 bit in the first fragment when the non-control frame
|
// PMCE sets RSV1 bit in the first fragment when the non-control frame
|
||||||
// is deflated
|
// is deflated
|
||||||
|
MutexAutoLock lock(mCompressorMutex);
|
||||||
if (mPMCECompressor && rsvBits == kRsv1Bit && mFragmentAccumulator == 0 &&
|
if (mPMCECompressor && rsvBits == kRsv1Bit && mFragmentAccumulator == 0 &&
|
||||||
!(opcode & kControlFrameMask)) {
|
!(opcode & kControlFrameMask)) {
|
||||||
mPMCECompressor->SetMessageDeflated();
|
mPMCECompressor->SetMessageDeflated();
|
||||||
|
|
@ -1700,25 +1702,28 @@ WebSocketChannel::ProcessInput(uint8_t *buffer, uint32_t count)
|
||||||
LOG(("WebSocketChannel:: ignoring read frame code %d after completion\n",
|
LOG(("WebSocketChannel:: ignoring read frame code %d after completion\n",
|
||||||
opcode));
|
opcode));
|
||||||
} else if (opcode == nsIWebSocketFrame::OPCODE_TEXT) {
|
} else if (opcode == nsIWebSocketFrame::OPCODE_TEXT) {
|
||||||
bool isDeflated = mPMCECompressor && mPMCECompressor->IsMessageDeflated();
|
|
||||||
LOG(("WebSocketChannel:: %stext frame received\n",
|
|
||||||
isDeflated ? "deflated " : ""));
|
|
||||||
|
|
||||||
if (mListenerMT) {
|
if (mListenerMT) {
|
||||||
nsCString utf8Data;
|
nsCString utf8Data;
|
||||||
|
|
||||||
if (isDeflated) {
|
{ // lockscope
|
||||||
rv = mPMCECompressor->Inflate(payload, payloadLength, utf8Data);
|
MutexAutoLock lock(mCompressorMutex);
|
||||||
if (NS_FAILED(rv)) {
|
bool isDeflated = mPMCECompressor && mPMCECompressor->IsMessageDeflated();
|
||||||
return rv;
|
LOG(("WebSocketChannel:: %stext frame received\n",
|
||||||
}
|
isDeflated ? "deflated " : ""));
|
||||||
LOG(("WebSocketChannel:: message successfully inflated "
|
|
||||||
"[origLength=%d, newLength=%d]\n", payloadLength,
|
if (isDeflated) {
|
||||||
utf8Data.Length()));
|
rv = mPMCECompressor->Inflate(payload, payloadLength, utf8Data);
|
||||||
} else {
|
if (NS_FAILED(rv)) {
|
||||||
if (!utf8Data.Assign((const char *)payload, payloadLength,
|
return rv;
|
||||||
mozilla::fallible)) {
|
}
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
LOG(("WebSocketChannel:: message successfully inflated "
|
||||||
|
"[origLength=%d, newLength=%d]\n", payloadLength,
|
||||||
|
utf8Data.Length()));
|
||||||
|
} else {
|
||||||
|
if (!utf8Data.Assign((const char *)payload, payloadLength,
|
||||||
|
mozilla::fallible)) {
|
||||||
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1835,25 +1840,28 @@ WebSocketChannel::ProcessInput(uint8_t *buffer, uint32_t count)
|
||||||
mService->FrameReceived(mSerial, mInnerWindowID, frame.forget());
|
mService->FrameReceived(mSerial, mInnerWindowID, frame.forget());
|
||||||
}
|
}
|
||||||
} else if (opcode == nsIWebSocketFrame::OPCODE_BINARY) {
|
} else if (opcode == nsIWebSocketFrame::OPCODE_BINARY) {
|
||||||
bool isDeflated = mPMCECompressor && mPMCECompressor->IsMessageDeflated();
|
|
||||||
LOG(("WebSocketChannel:: %sbinary frame received\n",
|
|
||||||
isDeflated ? "deflated " : ""));
|
|
||||||
|
|
||||||
if (mListenerMT) {
|
if (mListenerMT) {
|
||||||
nsCString binaryData;
|
nsCString binaryData;
|
||||||
|
|
||||||
if (isDeflated) {
|
{ //lockscope
|
||||||
rv = mPMCECompressor->Inflate(payload, payloadLength, binaryData);
|
MutexAutoLock lock(mCompressorMutex);
|
||||||
if (NS_FAILED(rv)) {
|
bool isDeflated = mPMCECompressor && mPMCECompressor->IsMessageDeflated();
|
||||||
return rv;
|
LOG(("WebSocketChannel:: %sbinary frame received\n",
|
||||||
}
|
isDeflated ? "deflated " : ""));
|
||||||
LOG(("WebSocketChannel:: message successfully inflated "
|
|
||||||
"[origLength=%d, newLength=%d]\n", payloadLength,
|
if (isDeflated) {
|
||||||
binaryData.Length()));
|
rv = mPMCECompressor->Inflate(payload, payloadLength, binaryData);
|
||||||
} else {
|
if (NS_FAILED(rv)) {
|
||||||
if (!binaryData.Assign((const char *)payload, payloadLength,
|
return rv;
|
||||||
mozilla::fallible)) {
|
}
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
LOG(("WebSocketChannel:: message successfully inflated "
|
||||||
|
"[origLength=%d, newLength=%d]\n", payloadLength,
|
||||||
|
binaryData.Length()));
|
||||||
|
} else {
|
||||||
|
if (!binaryData.Assign((const char *)payload, payloadLength,
|
||||||
|
mozilla::fallible)) {
|
||||||
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2156,6 +2164,7 @@ WebSocketChannel::PrimeNewOutgoingMessage()
|
||||||
}
|
}
|
||||||
|
|
||||||
// deflate the payload if PMCE is negotiated
|
// deflate the payload if PMCE is negotiated
|
||||||
|
MutexAutoLock lock(mCompressorMutex);
|
||||||
if (mPMCECompressor &&
|
if (mPMCECompressor &&
|
||||||
(msgType == kMsgTypeString || msgType == kMsgTypeBinaryString)) {
|
(msgType == kMsgTypeString || msgType == kMsgTypeBinaryString)) {
|
||||||
if (mCurrentOut->DeflatePayload(mPMCECompressor)) {
|
if (mCurrentOut->DeflatePayload(mPMCECompressor)) {
|
||||||
|
|
@ -2447,7 +2456,10 @@ WebSocketChannel::StopSession(nsresult reason)
|
||||||
mCancelable = nullptr;
|
mCancelable = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
mPMCECompressor = nullptr;
|
{
|
||||||
|
MutexAutoLock lock(mCompressorMutex);
|
||||||
|
mPMCECompressor = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
if (!mCalledOnStop) {
|
if (!mCalledOnStop) {
|
||||||
mCalledOnStop = 1;
|
mCalledOnStop = 1;
|
||||||
|
|
@ -2702,6 +2714,7 @@ WebSocketChannel::HandleExtensions()
|
||||||
serverMaxWindowBits = 15;
|
serverMaxWindowBits = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MutexAutoLock lock(mCompressorMutex);
|
||||||
mPMCECompressor = new PMCECompression(clientNoContextTakeover,
|
mPMCECompressor = new PMCECompression(clientNoContextTakeover,
|
||||||
clientMaxWindowBits,
|
clientMaxWindowBits,
|
||||||
serverMaxWindowBits);
|
serverMaxWindowBits);
|
||||||
|
|
@ -3678,6 +3691,7 @@ WebSocketChannel::OnTransportAvailable(nsISocketTransport *aTransport,
|
||||||
serverMaxWindowBits = 15;
|
serverMaxWindowBits = 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MutexAutoLock lock(mCompressorMutex);
|
||||||
mPMCECompressor = new PMCECompression(serverNoContextTakeover,
|
mPMCECompressor = new PMCECompression(serverNoContextTakeover,
|
||||||
serverMaxWindowBits,
|
serverMaxWindowBits,
|
||||||
clientMaxWindowBits);
|
clientMaxWindowBits);
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
#include "nsIChannelEventSink.h"
|
#include "nsIChannelEventSink.h"
|
||||||
#include "nsIHttpChannelInternal.h"
|
#include "nsIHttpChannelInternal.h"
|
||||||
#include "nsIStringStream.h"
|
#include "nsIStringStream.h"
|
||||||
|
#include "mozilla/Mutex.h"
|
||||||
#include "BaseWebSocketChannel.h"
|
#include "BaseWebSocketChannel.h"
|
||||||
|
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
|
|
@ -288,6 +289,7 @@ private:
|
||||||
uint32_t mHdrOutToSend;
|
uint32_t mHdrOutToSend;
|
||||||
uint8_t *mHdrOut;
|
uint8_t *mHdrOut;
|
||||||
uint8_t mOutHeader[kCopyBreak + 16];
|
uint8_t mOutHeader[kCopyBreak + 16];
|
||||||
|
Mutex mCompressorMutex;
|
||||||
nsAutoPtr<PMCECompression> mPMCECompressor;
|
nsAutoPtr<PMCECompression> mPMCECompressor;
|
||||||
uint32_t mDynamicOutputSize;
|
uint32_t mDynamicOutputSize;
|
||||||
uint8_t *mDynamicOutput;
|
uint8_t *mDynamicOutput;
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ from mozbuild.frontend.data import (
|
||||||
FinalTargetFiles,
|
FinalTargetFiles,
|
||||||
GeneratedEventWebIDLFile,
|
GeneratedEventWebIDLFile,
|
||||||
GeneratedWebIDLFile,
|
GeneratedWebIDLFile,
|
||||||
|
PreprocessedIPDLFile,
|
||||||
PreprocessedTestWebIDLFile,
|
PreprocessedTestWebIDLFile,
|
||||||
PreprocessedWebIDLFile,
|
PreprocessedWebIDLFile,
|
||||||
SharedLibrary,
|
SharedLibrary,
|
||||||
|
|
@ -215,6 +216,21 @@ class BinariesCollection(object):
|
||||||
self.shared_libraries = []
|
self.shared_libraries = []
|
||||||
self.programs = []
|
self.programs = []
|
||||||
|
|
||||||
|
class IPDLCollection(object):
|
||||||
|
"""Collects IPDL files during the build."""
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.sources = set()
|
||||||
|
self.preprocessed_sources = set()
|
||||||
|
|
||||||
|
def all_sources(self):
|
||||||
|
return self.sources | self.preprocessed_sources
|
||||||
|
|
||||||
|
def all_regular_sources(self):
|
||||||
|
return self.sources
|
||||||
|
|
||||||
|
def all_preprocessed_sources(self):
|
||||||
|
return self.preprocessed_sources
|
||||||
|
|
||||||
class CommonBackend(BuildBackend):
|
class CommonBackend(BuildBackend):
|
||||||
"""Holds logic common to all build backends."""
|
"""Holds logic common to all build backends."""
|
||||||
|
|
@ -225,7 +241,7 @@ class CommonBackend(BuildBackend):
|
||||||
self._webidls = WebIDLCollection()
|
self._webidls = WebIDLCollection()
|
||||||
self._binaries = BinariesCollection()
|
self._binaries = BinariesCollection()
|
||||||
self._configs = set()
|
self._configs = set()
|
||||||
self._ipdl_sources = set()
|
self._ipdls = IPDLCollection()
|
||||||
|
|
||||||
def consume_object(self, obj):
|
def consume_object(self, obj):
|
||||||
self._configs.add(obj.config)
|
self._configs.add(obj.config)
|
||||||
|
|
@ -290,6 +306,10 @@ class CommonBackend(BuildBackend):
|
||||||
self._webidls.generated_sources.add(mozpath.join(obj.srcdir,
|
self._webidls.generated_sources.add(mozpath.join(obj.srcdir,
|
||||||
obj.basename))
|
obj.basename))
|
||||||
|
|
||||||
|
elif isinstance(obj, PreprocessedIPDLFile):
|
||||||
|
self._ipdls.preprocessed_sources.add(mozpath.join(
|
||||||
|
obj.srcdir, obj.basename))
|
||||||
|
|
||||||
elif isinstance(obj, PreprocessedWebIDLFile):
|
elif isinstance(obj, PreprocessedWebIDLFile):
|
||||||
# WebIDL isn't relevant to artifact builds.
|
# WebIDL isn't relevant to artifact builds.
|
||||||
if self.environment.is_artifact_build:
|
if self.environment.is_artifact_build:
|
||||||
|
|
@ -310,7 +330,7 @@ class CommonBackend(BuildBackend):
|
||||||
if self.environment.is_artifact_build:
|
if self.environment.is_artifact_build:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
self._ipdl_sources.add(mozpath.join(obj.srcdir, obj.basename))
|
self._ipdls.sources.add(mozpath.join(obj.srcdir, obj.basename))
|
||||||
|
|
||||||
elif isinstance(obj, UnifiedSources):
|
elif isinstance(obj, UnifiedSources):
|
||||||
# Unified sources aren't relevant to artifact builds.
|
# Unified sources aren't relevant to artifact builds.
|
||||||
|
|
@ -341,7 +361,9 @@ class CommonBackend(BuildBackend):
|
||||||
|
|
||||||
self._handle_webidl_collection(self._webidls)
|
self._handle_webidl_collection(self._webidls)
|
||||||
|
|
||||||
sorted_ipdl_sources = list(sorted(self._ipdl_sources))
|
sorted_ipdl_sources = list(sorted(self._ipdls.all_sources()))
|
||||||
|
sorted_nonstatic_ipdl_sources = list(sorted(self._ipdls.all_preprocessed_sources()))
|
||||||
|
sorted_static_ipdl_sources = list(sorted(self._ipdls.all_regular_sources()))
|
||||||
|
|
||||||
def files_from(ipdl):
|
def files_from(ipdl):
|
||||||
base = mozpath.basename(ipdl)
|
base = mozpath.basename(ipdl)
|
||||||
|
|
@ -364,7 +386,8 @@ class CommonBackend(BuildBackend):
|
||||||
files_per_unified_file=16))
|
files_per_unified_file=16))
|
||||||
|
|
||||||
self._write_unified_files(unified_source_mapping, ipdl_dir, poison_windows_h=False)
|
self._write_unified_files(unified_source_mapping, ipdl_dir, poison_windows_h=False)
|
||||||
self._handle_ipdl_sources(ipdl_dir, sorted_ipdl_sources, unified_source_mapping)
|
self._handle_ipdl_sources(ipdl_dir, sorted_ipdl_sources, sorted_nonstatic_ipdl_sources,
|
||||||
|
sorted_static_ipdl_sources, unified_source_mapping)
|
||||||
|
|
||||||
for config in self._configs:
|
for config in self._configs:
|
||||||
self.backend_input_files.add(config.source)
|
self.backend_input_files.add(config.source)
|
||||||
|
|
|
||||||
|
|
@ -1407,18 +1407,32 @@ class RecursiveMakeBackend(CommonBackend):
|
||||||
|
|
||||||
self._makefile_out_count += 1
|
self._makefile_out_count += 1
|
||||||
|
|
||||||
def _handle_ipdl_sources(self, ipdl_dir, sorted_ipdl_sources,
|
def _handle_ipdl_sources(self, ipdl_dir, sorted_ipdl_sources, sorted_nonstatic_ipdl_sources,
|
||||||
unified_ipdl_cppsrcs_mapping):
|
sorted_static_ipdl_sources, unified_ipdl_cppsrcs_mapping):
|
||||||
# Write out a master list of all IPDL source files.
|
# Write out a master list of all IPDL source files.
|
||||||
mk = Makefile()
|
mk = Makefile()
|
||||||
|
|
||||||
mk.add_statement('ALL_IPDLSRCS := %s' % ' '.join(sorted_ipdl_sources))
|
sorted_nonstatic_ipdl_basenames = list()
|
||||||
|
for source in sorted_nonstatic_ipdl_sources:
|
||||||
|
basename = os.path.basename(source)
|
||||||
|
sorted_nonstatic_ipdl_basenames.append(basename)
|
||||||
|
rule = mk.create_rule([basename])
|
||||||
|
rule.add_dependencies([source])
|
||||||
|
rule.add_commands([
|
||||||
|
'$(RM) $@',
|
||||||
|
'$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) '
|
||||||
|
'$< -o $@)'
|
||||||
|
])
|
||||||
|
|
||||||
|
mk.add_statement('ALL_IPDLSRCS := %s %s' % (' '.join(sorted_nonstatic_ipdl_basenames),
|
||||||
|
' '.join(sorted_static_ipdl_sources)))
|
||||||
|
|
||||||
self._add_unified_build_rules(mk, unified_ipdl_cppsrcs_mapping,
|
self._add_unified_build_rules(mk, unified_ipdl_cppsrcs_mapping,
|
||||||
unified_files_makefile_variable='CPPSRCS')
|
unified_files_makefile_variable='CPPSRCS')
|
||||||
|
|
||||||
mk.add_statement('IPDLDIRS := %s' % ' '.join(sorted(set(mozpath.dirname(p)
|
# Preprocessed ipdl files are generated in ipdl_dir.
|
||||||
for p in self._ipdl_sources))))
|
mk.add_statement('IPDLDIRS := %s %s' % (ipdl_dir, ' '.join(sorted(set(mozpath.dirname(p)
|
||||||
|
for p in sorted_static_ipdl_sources)))))
|
||||||
|
|
||||||
with self._write_file(mozpath.join(ipdl_dir, 'ipdlsrcs.mk')) as ipdls:
|
with self._write_file(mozpath.join(ipdl_dir, 'ipdlsrcs.mk')) as ipdls:
|
||||||
mk.dump(ipdls, removal_guard=False)
|
mk.dump(ipdls, removal_guard=False)
|
||||||
|
|
|
||||||
|
|
@ -298,8 +298,8 @@ class TupOnly(CommonBackend, PartialBackend):
|
||||||
outputs=[output],
|
outputs=[output],
|
||||||
)
|
)
|
||||||
|
|
||||||
def _handle_ipdl_sources(self, ipdl_dir, sorted_ipdl_sources,
|
def _handle_ipdl_sources(self, ipdl_dir, sorted_ipdl_sources, sorted_nonstatic_ipdl_sources,
|
||||||
unified_ipdl_cppsrcs_mapping):
|
sorted_static_ipdl_sources, unified_ipdl_cppsrcs_mapping):
|
||||||
# TODO: This isn't implemented yet in the tup backend, but it is called
|
# TODO: This isn't implemented yet in the tup backend, but it is called
|
||||||
# by the CommonBackend.
|
# by the CommonBackend.
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -177,8 +177,8 @@ class CompileDBBackend(CommonBackend):
|
||||||
def _handle_idl_manager(self, idl_manager):
|
def _handle_idl_manager(self, idl_manager):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def _handle_ipdl_sources(self, ipdl_dir, sorted_ipdl_sources,
|
def _handle_ipdl_sources(self, ipdl_dir, sorted_ipdl_sources, sorted_nonstatic_ipdl_sources,
|
||||||
unified_ipdl_cppsrcs_mapping):
|
sorted_static_ipdl_sources, unified_ipdl_cppsrcs_mapping):
|
||||||
for f in unified_ipdl_cppsrcs_mapping:
|
for f in unified_ipdl_cppsrcs_mapping:
|
||||||
self._build_db_line(ipdl_dir, None, self.environment, f[0],
|
self._build_db_line(ipdl_dir, None, self.environment, f[0],
|
||||||
'.cpp')
|
'.cpp')
|
||||||
|
|
|
||||||
|
|
@ -1441,6 +1441,13 @@ VARIABLES = {
|
||||||
not use this flag.
|
not use this flag.
|
||||||
"""),
|
"""),
|
||||||
|
|
||||||
|
'PREPROCESSED_IPDL_SOURCES': (StrictOrderingOnAppendList, list,
|
||||||
|
"""Preprocessed IPDL source files.
|
||||||
|
|
||||||
|
These files will be preprocessed, then parsed and converted to
|
||||||
|
``.cpp`` files.
|
||||||
|
"""),
|
||||||
|
|
||||||
'IPDL_SOURCES': (StrictOrderingOnAppendList, list,
|
'IPDL_SOURCES': (StrictOrderingOnAppendList, list,
|
||||||
"""IPDL source files.
|
"""IPDL source files.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -218,6 +218,18 @@ class IPDLFile(ContextDerived):
|
||||||
|
|
||||||
self.basename = path
|
self.basename = path
|
||||||
|
|
||||||
|
class PreprocessedIPDLFile(ContextDerived):
|
||||||
|
"""Describes an individual .ipdl source file that requires preprocessing."""
|
||||||
|
|
||||||
|
__slots__ = (
|
||||||
|
'basename',
|
||||||
|
)
|
||||||
|
|
||||||
|
def __init__(self, context, path):
|
||||||
|
ContextDerived.__init__(self, context)
|
||||||
|
|
||||||
|
self.basename = path
|
||||||
|
|
||||||
class WebIDLFile(ContextDerived):
|
class WebIDLFile(ContextDerived):
|
||||||
"""Describes an individual .webidl source file."""
|
"""Describes an individual .webidl source file."""
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ from .data import (
|
||||||
ObjdirFiles,
|
ObjdirFiles,
|
||||||
ObjdirPreprocessedFiles,
|
ObjdirPreprocessedFiles,
|
||||||
PerSourceFlag,
|
PerSourceFlag,
|
||||||
|
PreprocessedIPDLFile,
|
||||||
PreprocessedTestWebIDLFile,
|
PreprocessedTestWebIDLFile,
|
||||||
PreprocessedWebIDLFile,
|
PreprocessedWebIDLFile,
|
||||||
Program,
|
Program,
|
||||||
|
|
@ -872,6 +873,7 @@ class TreeMetadataEmitter(LoggingMixin):
|
||||||
('GENERATED_EVENTS_WEBIDL_FILES', GeneratedEventWebIDLFile),
|
('GENERATED_EVENTS_WEBIDL_FILES', GeneratedEventWebIDLFile),
|
||||||
('GENERATED_WEBIDL_FILES', GeneratedWebIDLFile),
|
('GENERATED_WEBIDL_FILES', GeneratedWebIDLFile),
|
||||||
('IPDL_SOURCES', IPDLFile),
|
('IPDL_SOURCES', IPDLFile),
|
||||||
|
('PREPROCESSED_IPDL_SOURCES', PreprocessedIPDLFile),
|
||||||
('PREPROCESSED_TEST_WEBIDL_FILES', PreprocessedTestWebIDLFile),
|
('PREPROCESSED_TEST_WEBIDL_FILES', PreprocessedTestWebIDLFile),
|
||||||
('PREPROCESSED_WEBIDL_FILES', PreprocessedWebIDLFile),
|
('PREPROCESSED_WEBIDL_FILES', PreprocessedWebIDLFile),
|
||||||
('TEST_WEBIDL_FILES', TestWebIDLFile),
|
('TEST_WEBIDL_FILES', TestWebIDLFile),
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# 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/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
PREPROCESSED_IPDL_SOURCES += [
|
||||||
|
'bar1.ipdl',
|
||||||
|
]
|
||||||
|
|
||||||
IPDL_SOURCES += [
|
IPDL_SOURCES += [
|
||||||
'bar.ipdl',
|
'bar.ipdl',
|
||||||
'bar2.ipdlh',
|
'bar2.ipdlh',
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# 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/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
PREPROCESSED_IPDL_SOURCES += [
|
||||||
|
'foo1.ipdl',
|
||||||
|
]
|
||||||
|
|
||||||
IPDL_SOURCES += [
|
IPDL_SOURCES += [
|
||||||
'foo.ipdl',
|
'foo.ipdl',
|
||||||
'foo2.ipdlh',
|
'foo2.ipdlh',
|
||||||
|
|
|
||||||
|
|
@ -656,7 +656,7 @@ class TestRecursiveMakeBackend(BackendTester):
|
||||||
self.assertEqual(m, m2)
|
self.assertEqual(m, m2)
|
||||||
|
|
||||||
def test_ipdl_sources(self):
|
def test_ipdl_sources(self):
|
||||||
"""Test that IPDL_SOURCES are written to ipdlsrcs.mk correctly."""
|
"""Test that PREPROCESSED_IPDL_SOURCES and IPDL_SOURCES are written to ipdlsrcs.mk correctly."""
|
||||||
env = self._consume('ipdl_sources', RecursiveMakeBackend)
|
env = self._consume('ipdl_sources', RecursiveMakeBackend)
|
||||||
|
|
||||||
manifest_path = mozpath.join(env.topobjdir,
|
manifest_path = mozpath.join(env.topobjdir,
|
||||||
|
|
@ -667,9 +667,9 @@ class TestRecursiveMakeBackend(BackendTester):
|
||||||
topsrcdir = env.topsrcdir.replace(os.sep, '/')
|
topsrcdir = env.topsrcdir.replace(os.sep, '/')
|
||||||
|
|
||||||
expected = [
|
expected = [
|
||||||
"ALL_IPDLSRCS := %s/bar/bar.ipdl %s/bar/bar2.ipdlh %s/foo/foo.ipdl %s/foo/foo2.ipdlh" % tuple([topsrcdir] * 4),
|
"ALL_IPDLSRCS := bar1.ipdl foo1.ipdl %s/bar/bar.ipdl %s/bar/bar2.ipdlh %s/foo/foo.ipdl %s/foo/foo2.ipdlh" % tuple([topsrcdir] * 4),
|
||||||
"CPPSRCS := UnifiedProtocols0.cpp",
|
"CPPSRCS := UnifiedProtocols0.cpp",
|
||||||
"IPDLDIRS := %s/bar %s/foo" % (topsrcdir, topsrcdir),
|
"IPDLDIRS := %s/ipc/ipdl %s/bar %s/foo" % (env.topobjdir, topsrcdir, topsrcdir),
|
||||||
]
|
]
|
||||||
|
|
||||||
found = [str for str in lines if str.startswith(('ALL_IPDLSRCS',
|
found = [str for str in lines if str.startswith(('ALL_IPDLSRCS',
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# 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/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
PREPROCESSED_IPDL_SOURCES += [
|
||||||
|
'bar1.ipdl',
|
||||||
|
]
|
||||||
|
|
||||||
IPDL_SOURCES += [
|
IPDL_SOURCES += [
|
||||||
'bar.ipdl',
|
'bar.ipdl',
|
||||||
'bar2.ipdlh',
|
'bar2.ipdlh',
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# 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/.
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
PREPROCESSED_IPDL_SOURCES += [
|
||||||
|
'foo1.ipdl',
|
||||||
|
]
|
||||||
|
|
||||||
IPDL_SOURCES += [
|
IPDL_SOURCES += [
|
||||||
'foo.ipdl',
|
'foo.ipdl',
|
||||||
'foo2.ipdlh',
|
'foo2.ipdlh',
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ from mozbuild.frontend.data import (
|
||||||
JARManifest,
|
JARManifest,
|
||||||
LinkageMultipleRustLibrariesError,
|
LinkageMultipleRustLibrariesError,
|
||||||
LocalInclude,
|
LocalInclude,
|
||||||
|
PreprocessedIPDLFile,
|
||||||
Program,
|
Program,
|
||||||
SdkFiles,
|
SdkFiles,
|
||||||
SharedLibrary,
|
SharedLibrary,
|
||||||
|
|
@ -688,9 +689,12 @@ class TestEmitterBasic(unittest.TestCase):
|
||||||
objs = self.read_topsrcdir(reader)
|
objs = self.read_topsrcdir(reader)
|
||||||
|
|
||||||
ipdls = []
|
ipdls = []
|
||||||
|
nonstatic_ipdls = []
|
||||||
for o in objs:
|
for o in objs:
|
||||||
if isinstance(o, IPDLFile):
|
if isinstance(o, IPDLFile):
|
||||||
ipdls.append('%s/%s' % (o.relativedir, o.basename))
|
ipdls.append('%s/%s' % (o.relativedir, o.basename))
|
||||||
|
elif isinstance(o, PreprocessedIPDLFile):
|
||||||
|
nonstatic_ipdls.append('%s/%s' % (o.relativedir, o.basename))
|
||||||
|
|
||||||
expected = [
|
expected = [
|
||||||
'bar/bar.ipdl',
|
'bar/bar.ipdl',
|
||||||
|
|
@ -699,7 +703,12 @@ class TestEmitterBasic(unittest.TestCase):
|
||||||
'foo/foo2.ipdlh',
|
'foo/foo2.ipdlh',
|
||||||
]
|
]
|
||||||
|
|
||||||
self.assertEqual(ipdls, expected)
|
expected = [
|
||||||
|
'bar/bar1.ipdl',
|
||||||
|
'foo/foo1.ipdl',
|
||||||
|
]
|
||||||
|
|
||||||
|
self.assertEqual(nonstatic_ipdls, expected)
|
||||||
|
|
||||||
def test_local_includes(self):
|
def test_local_includes(self):
|
||||||
"""Test that LOCAL_INCLUDES is emitted correctly."""
|
"""Test that LOCAL_INCLUDES is emitted correctly."""
|
||||||
|
|
|
||||||
|
|
@ -3090,7 +3090,8 @@ nsLocalFile::IsExecutable(bool* aResult)
|
||||||
"ws",
|
"ws",
|
||||||
"wsc",
|
"wsc",
|
||||||
"wsf",
|
"wsf",
|
||||||
"wsh"
|
"wsh",
|
||||||
|
"xll" // MS Excel dynamic link library
|
||||||
};
|
};
|
||||||
nsDependentSubstring ext = Substring(path, dotIdx + 1);
|
nsDependentSubstring ext = Substring(path, dotIdx + 1);
|
||||||
for (size_t i = 0; i < ArrayLength(executableExts); ++i) {
|
for (size_t i = 0; i < ArrayLength(executableExts); ++i) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue