This commit is contained in:
David Anderson 2012-08-07 15:13:28 -07:00
Родитель 3b407311ee c9d55575d1
Коммит 7ab97db10e
299 изменённых файлов: 5844 добавлений и 4550 удалений

Просмотреть файл

@ -70,7 +70,7 @@ XULSelectControlAccessible::SelectedItems()
xulMultiSelect->GetSelectedCount(&length);
for (PRInt32 index = 0; index < length; index++) {
nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
xulMultiSelect->GetSelectedItem(index, getter_AddRefs(itemElm));
xulMultiSelect->MultiGetSelectedItem(index, getter_AddRefs(itemElm));
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
Accessible* item = mDoc->GetAccessible(itemNode);
if (item)
@ -78,15 +78,15 @@ XULSelectControlAccessible::SelectedItems()
false);
}
} else { // Single select?
nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
mSelectControl->GetSelectedItem(getter_AddRefs(itemElm));
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
if(itemNode) {
Accessible* item = mDoc->GetAccessible(itemNode);
if (item)
selectedItems->AppendElement(static_cast<nsIAccessible*>(item),
false);
}
nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
mSelectControl->GetSelectedItem(getter_AddRefs(itemElm));
nsCOMPtr<nsINode> itemNode(do_QueryInterface(itemElm));
if (itemNode) {
Accessible* item = mDoc->GetAccessible(itemNode);
if (item)
selectedItems->AppendElement(static_cast<nsIAccessible*>(item),
false);
}
}
nsIMutableArray* items = nullptr;
@ -102,7 +102,7 @@ XULSelectControlAccessible::GetSelectedItem(PRUint32 aIndex)
nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm;
if (multiSelectControl)
multiSelectControl->GetSelectedItem(aIndex, getter_AddRefs(itemElm));
multiSelectControl->MultiGetSelectedItem(aIndex, getter_AddRefs(itemElm));
else if (aIndex == 0)
mSelectControl->GetSelectedItem(getter_AddRefs(itemElm));

Просмотреть файл

@ -1172,6 +1172,8 @@ pref("image.mem.max_decoded_image_kb", 256000);
// Example social provider
pref("social.manifest.motown", "{\"origin\":\"https://motown-dev.mozillalabs.com\",\"name\":\"MoTown\",\"workerURL\":\"https://motown-dev.mozillalabs.com/social/worker.js\",\"iconURL\":\"https://motown-dev.mozillalabs.com/images/motown-icon.png\",\"sidebarURL\":\"https://motown-dev.mozillalabs.com/social/sidebar\"}");
// Comma-separated list of nsIURI::prePaths that are allowed to activate
// built-in social functionality.
pref("social.activation.whitelist", "https://motown-dev.mozillalabs.com");
pref("social.sidebar.open", true);
pref("browser.social.whitelist", "");
pref("social.active", false);

Просмотреть файл

@ -113,7 +113,7 @@ let SocialUI = {
// Check that the associated document's origin is in our whitelist
let prePath = targetDoc.documentURIObject.prePath;
let whitelist = Services.prefs.getCharPref("browser.social.whitelist");
let whitelist = Services.prefs.getCharPref("social.activation.whitelist");
if (whitelist.split(",").indexOf(prePath) == -1)
return;

Просмотреть файл

@ -99,28 +99,32 @@ class ConfigEnvironment(object):
directory. It preprocesses files from the source directory and stores
the result in the object directory.
There are two types of files: config files and config headers,
each treated through a different member function.
There are two types of files: config files and config headers,
each treated through a different member function.
Creating a ConfigEnvironment requires a few arguments:
- topsrcdir and topobjdir are, respectively, the top source and
the top object directory.
- defines is a list of (name, value) tuples. In autoconf, these are
set with AC_DEFINE and AC_DEFINE_UNQUOTED
- non_global_defines are a list of names appearing in defines above
that are not meant to be exported in ACDEFINES and ALLDEFINES (see
below)
- substs is a list of (name, value) tuples. In autoconf, these are
set with AC_SUBST.
Creating a ConfigEnvironment requires a few arguments:
- topsrcdir and topobjdir are, respectively, the top source and
the top object directory.
- defines is a list of (name, value) tuples. In autoconf, these are
set with AC_DEFINE and AC_DEFINE_UNQUOTED
- non_global_defines are a list of names appearing in defines above
that are not meant to be exported in ACDEFINES and ALLDEFINES (see
below)
- substs is a list of (name, value) tuples. In autoconf, these are
set with AC_SUBST.
ConfigEnvironment automatically defines two additional substs variables
from all the defines not appearing in non_global_defines:
- ACDEFINES contains the defines in the form -DNAME=VALUE, for use on
preprocessor command lines. The order in which defines were given
when creating the ConfigEnvironment is preserved.
- ALLDEFINES contains the defines in the form #define NAME VALUE, in
sorted order, for use in config files, for an automatic listing of
defines.
ConfigEnvironment automatically defines two additional substs variables
from all the defines not appearing in non_global_defines:
- ACDEFINES contains the defines in the form -DNAME=VALUE, for use on
preprocessor command lines. The order in which defines were given
when creating the ConfigEnvironment is preserved.
- ALLDEFINES contains the defines in the form #define NAME VALUE, in
sorted order, for use in config files, for an automatic listing of
defines.
and another additional subst variable from all the other substs:
- ALLSUBSTS contains the substs in the form NAME = VALUE, in sorted
order, for use in autoconf.mk. It includes ACDEFINES, but doesn't
include ALLDEFINES.
ConfigEnvironment expects a "top_srcdir" subst to be set with the top
source directory, in msys format on windows. It is used to derive a
@ -136,6 +140,7 @@ class ConfigEnvironment(object):
self.topobjdir = topobjdir
global_defines = [name for name, value in defines if not name in non_global_defines]
self.substs['ACDEFINES'] = ' '.join(["-D%s=%s" % (name, shell_escape(self.defines[name])) for name in global_defines])
self.substs['ALLSUBSTS'] = '\n'.join(sorted(["%s = %s" % (name, self.substs[name]) for name in self.substs]))
self.substs['ALLDEFINES'] = '\n'.join(sorted(["#define %s %s" % (name, self.defines[name]) for name in global_defines]))
def get_relative_srcdir(self, file):

Просмотреть файл

@ -32,7 +32,7 @@ mk_add_options() {
do
# Escape shell characters, space, tab, dollar, quote, backslash,
# and substitute '@<word>@' with '$(<word>)'.
_opt=`echo "$_opt" | sed -e 's/\([\"\\]\)/\\\1/g; s/@\([^@]*\)@/\$(\1)/g;'`
_opt=`echo "$_opt" | sed -e 's/\([\"\\]\)/\\\\\1/g; s/@\([^@]*\)@/\$(\1)/g;'`
echo $_opt;
opts="${opts:+$opts^}$_opt";
done

Просмотреть файл

@ -807,7 +807,8 @@ class DeviceManagerSUT(DeviceManager):
retVal = None
if data:
retVal = data.strip()
if (self.debug >= 3): print "remote hash returned: '" + retVal + "'"
if self.debug >= 3:
print "remote hash returned: '%s'" % retVal
return retVal
# Gets the device root for the testing area on the device

Просмотреть файл

@ -0,0 +1,8 @@
# Pymake needs Windows-style paths. Use cmd.exe to hack around this.
mk_export_correct_style() {
if test -n "${_PYMAKE}"; then
mk_add_options "export $1=$(cmd.exe //c echo %$1%)"
else
mk_add_options "export $1=$(eval echo \$$1)"
fi
}

13
build/pymake/mkformat.py Executable file
Просмотреть файл

@ -0,0 +1,13 @@
#!/usr/bin/env python
import sys
import pymake.parser
filename = sys.argv[1]
source = None
with open(filename, 'rU') as fh:
source = fh.read()
statements = pymake.parser.parsestring(source, filename)
print statements.to_source()

Просмотреть файл

@ -62,10 +62,84 @@ def _if_else(c, t, f):
return t()
return f()
class StringExpansion(object):
class BaseExpansion(object):
"""Base class for expansions.
A make expansion is the parsed representation of a string, which may
contain references to other elements.
"""
@property
def is_static_string(self):
"""Returns whether the expansion is composed of static string content.
This is always True for StringExpansion. It will be True for Expansion
only if all elements of that Expansion are static strings.
"""
raise Exception('Must be implemented in child class.')
def functions(self, descend=False):
"""Obtain all functions inside this expansion.
This is a generator for pymake.functions.Function instances.
By default, this only returns functions existing as the primary
elements of this expansion. If `descend` is True, it will descend into
child expansions and extract all functions in the tree.
"""
# An empty generator. Yeah, it's weird.
for x in []:
yield x
def variable_references(self, descend=False):
"""Obtain all variable references in this expansion.
This is a generator for pymake.functionsVariableRef instances.
To retrieve the names of variables, simply query the `vname` field on
the returned instances. Most of the time these will be StringExpansion
instances.
"""
for f in self.functions(descend=descend):
if not isinstance(f, functions.VariableRef):
continue
yield f
@property
def is_filesystem_dependent(self):
"""Whether this expansion may query the filesystem for evaluation.
This effectively asks "is any function in this expansion dependent on
the filesystem.
"""
for f in self.functions(descend=True):
if f.is_filesystem_dependent:
return True
return False
@property
def is_shell_dependent(self):
"""Whether this expansion may invoke a shell for evaluation."""
for f in self.functions(descend=True):
if isinstance(f, functions.ShellFunction):
return True
return False
class StringExpansion(BaseExpansion):
"""An Expansion representing a static string.
This essentially wraps a single str instance.
"""
__slots__ = ('loc', 's',)
simple = True
def __init__(self, s, loc):
assert isinstance(s, str)
self.s = s
@ -94,6 +168,10 @@ class StringExpansion(object):
e.appendstr(self.s)
return e
@property
def is_static_string(self):
return True
def __len__(self):
return 1
@ -104,9 +182,31 @@ class StringExpansion(object):
def __repr__(self):
return "Exp<%s>(%r)" % (self.loc, self.s)
class Expansion(list):
"""
A representation of expanded data, such as that for a recursively-expanded variable, a command, etc.
def __eq__(self, other):
"""We only compare the string contents."""
return self.s == other
def __ne__(self, other):
return not self.__eq__(other)
def to_source(self, escape_variables=False, escape_comments=False):
s = self.s
if escape_comments:
s = s.replace('#', '\\#')
if escape_variables:
return s.replace('$', '$$')
return s
class Expansion(BaseExpansion, list):
"""A representation of expanded data.
This is effectively an ordered list of StringExpansion and
pymake.function.Function instances. Every item in the collection appears in
the same context in a make file.
"""
__slots__ = ('loc',)
@ -232,9 +332,91 @@ class Expansion(list):
def resolvesplit(self, makefile, variables, setting=[]):
return self.resolvestr(makefile, variables, setting).split()
@property
def is_static_string(self):
"""An Expansion is static if all its components are strings, not
functions."""
for e, is_func in self:
if is_func:
return False
return True
def functions(self, descend=False):
for e, is_func in self:
if is_func:
yield e
if descend:
for exp in e.expansions(descend=True):
for f in exp.functions(descend=True):
yield f
def __repr__(self):
return "<Expansion with elements: %r>" % ([e for e, isfunc in self],)
def to_source(self, escape_variables=False, escape_comments=False):
parts = []
for e, is_func in self:
if is_func:
parts.append(e.to_source())
continue
if escape_variables:
parts.append(e.replace('$', '$$'))
continue
parts.append(e)
return ''.join(parts)
def __eq__(self, other):
if not isinstance(other, (Expansion, StringExpansion)):
return False
# Expansions are equivalent if adjacent string literals normalize to
# the same value. So, we must normalize before any comparisons are
# made.
a = self.clone().finish()
if isinstance(other, StringExpansion):
if isinstance(a, StringExpansion):
return a == other
# A normalized Expansion != StringExpansion.
return False
b = other.clone().finish()
# b could be a StringExpansion now.
if isinstance(b, StringExpansion):
if isinstance(a, StringExpansion):
return a == b
# Our normalized Expansion != normalized StringExpansion.
return False
if len(a) != len(b):
return False
for i in xrange(len(self)):
e1, is_func1 = a[i]
e2, is_func2 = b[i]
if is_func1 != is_func2:
return False
if type(e1) != type(e2):
return False
if e1 != e2:
return False
return True
def __ne__(self, other):
return not self.__eq__(other)
class Variables(object):
"""
A mapping from variable names to variables. Variables have flavor, source, and value. The value is an
@ -1542,6 +1724,10 @@ class Makefile(object):
if len(np.rules):
self.context = process.getcontext(1)
flavor, source, value = self.variables.get('.DEFAULT_GOAL')
if value is not None:
self.defaulttarget = value.resolvestr(self, self.variables, ['.DEFAULT_GOAL']).strip()
self.error = False
def include(self, path, required=True, weak=False, loc=None):

Просмотреть файл

@ -9,6 +9,21 @@ from cStringIO import StringIO
log = logging.getLogger('pymake.data')
def emit_expansions(descend, *expansions):
"""Helper function to emit all expansions within an input set."""
for expansion in expansions:
yield expansion
if not descend or not isinstance(expansion, list):
continue
for e, is_func in expansion:
if is_func:
for exp in e.expansions(True):
yield exp
else:
yield e
class Function(object):
"""
An object that represents a function call. This class is always subclassed
@ -44,6 +59,60 @@ class Function(object):
assert isinstance(arg, (data.Expansion, data.StringExpansion))
self._arguments.append(arg)
def to_source(self):
"""Convert the function back to make file "source" code."""
if not hasattr(self, 'name'):
raise Exception("%s must implement to_source()." % self.__class__)
# The default implementation simply prints the function name and all
# the arguments joined by a comma.
# According to the GNU make manual Section 8.1, whitespace around
# arguments is *not* part of the argument's value. So, we trim excess
# white space so we have consistent behavior.
args = []
curly = False
for i, arg in enumerate(self._arguments):
arg = arg.to_source()
if i == 0:
arg = arg.lstrip()
# Are balanced parens even OK?
if arg.count('(') != arg.count(')'):
curly = True
args.append(arg)
if curly:
return '${%s %s}' % (self.name, ','.join(args))
return '$(%s %s)' % (self.name, ','.join(args))
def expansions(self, descend=False):
"""Obtain all expansions contained within this function.
By default, only expansions directly part of this function are
returned. If descend is True, we will descend into child expansions and
return all of the composite parts.
This is a generator for pymake.data.BaseExpansion instances.
"""
# Our default implementation simply returns arguments. More advanced
# functions like variable references may need their own implementation.
return emit_expansions(descend, *self._arguments)
@property
def is_filesystem_dependent(self):
"""Exposes whether this function depends on the filesystem for results.
If True, the function touches the filesystem as part of evaluation.
This only tests whether the function itself uses the filesystem. If
this function has arguments that are functions that touch the
filesystem, this will return False.
"""
return False
def __len__(self):
return len(self._arguments)
@ -53,14 +122,53 @@ class Function(object):
','.join([repr(a) for a in self._arguments]),
)
def __eq__(self, other):
if not hasattr(self, 'name'):
raise Exception("%s must implement __eq__." % self.__class__)
if type(self) != type(other):
return False
if self.name != other.name:
return False
if len(self._arguments) != len(other._arguments):
return False
for i in xrange(len(self._arguments)):
# According to the GNU make manual Section 8.1, whitespace around
# arguments is *not* part of the argument's value. So, we do a
# whitespace-agnostic comparison.
if i == 0:
a = self._arguments[i]
a.lstrip()
b = other._arguments[i]
b.lstrip()
if a != b:
return False
continue
if self._arguments[i] != other._arguments[i]:
return False
return True
def __ne__(self, other):
return not self.__eq__(other)
class VariableRef(Function):
AUTOMATIC_VARIABLES = set(['@', '%', '<', '?', '^', '+', '|', '*'])
__slots__ = ('vname', 'loc')
def __init__(self, loc, vname):
self.loc = loc
assert isinstance(vname, (data.Expansion, data.StringExpansion))
self.vname = vname
def setup(self):
assert False, "Shouldn't get here"
@ -76,9 +184,27 @@ class VariableRef(Function):
value.resolve(makefile, variables, fd, setting + [vname])
def to_source(self):
if isinstance(self.vname, data.StringExpansion):
if self.vname.s in self.AUTOMATIC_VARIABLES:
return '$%s' % self.vname.s
return '$(%s)' % self.vname.s
return '$(%s)' % self.vname.to_source()
def expansions(self, descend=False):
return emit_expansions(descend, self.vname)
def __repr__(self):
return "VariableRef<%s>(%r)" % (self.loc, self.vname)
def __eq__(self, other):
if not isinstance(other, VariableRef):
return False
return self.vname == other.vname
class SubstitutionRef(Function):
"""$(VARNAME:.c=.o) and $(VARNAME:%.c=%.o)"""
@ -114,10 +240,27 @@ class SubstitutionRef(Function):
fd.write(' '.join([f.subst(substto, word, False)
for word in value.resolvesplit(makefile, variables, setting + [vname])]))
def to_source(self):
return '$(%s:%s=%s)' % (
self.vname.to_source(),
self.substfrom.to_source(),
self.substto.to_source())
def expansions(self, descend=False):
return emit_expansions(descend, self.vname, self.substfrom,
self.substto)
def __repr__(self):
return "SubstitutionRef<%s>(%r:%r=%r)" % (
self.loc, self.vname, self.substfrom, self.substto,)
def __eq__(self, other):
if not isinstance(other, SubstitutionRef):
return False
return self.vname == other.vname and self.substfrom == other.substfrom \
and self.substto == other.substto
class SubstFunction(Function):
name = 'subst'
minargs = 3
@ -352,7 +495,7 @@ class BasenameFunction(Function):
util.joiniter(fd, self.basenames(self._arguments[0].resolvesplit(makefile, variables, setting)))
class AddSuffixFunction(Function):
name = 'addprefix'
name = 'addsuffix'
minargs = 2
maxargs = 2
@ -364,7 +507,7 @@ class AddSuffixFunction(Function):
fd.write(' '.join([w + suffix for w in self._arguments[1].resolvesplit(makefile, variables, setting)]))
class AddPrefixFunction(Function):
name = 'addsuffix'
name = 'addprefix'
minargs = 2
maxargs = 2
@ -407,7 +550,9 @@ class WildcardFunction(Function):
for p in patterns
for x in glob(makefile.workdir, p)]))
__slots__ = Function.__slots__
@property
def is_filesystem_dependent(self):
return True
class RealpathFunction(Function):
name = 'realpath'
@ -418,6 +563,9 @@ class RealpathFunction(Function):
fd.write(' '.join([os.path.realpath(os.path.join(makefile.workdir, path)).replace('\\', '/')
for path in self._arguments[0].resolvesplit(makefile, variables, setting)]))
def is_filesystem_dependent(self):
return True
class AbspathFunction(Function):
name = 'abspath'
minargs = 1

Просмотреть файл

@ -102,11 +102,26 @@ class Statement(object):
Represents parsed make file syntax.
This is an abstract base class. Child classes are expected to implement
`execute()`.
basic methods defined below.
"""
def execute(self, makefile, context):
raise Exception("Must implement execute() in child classes.")
"""Executes this Statement within a make file execution context."""
raise Exception("%s must implement execute()." % self.__class__)
def to_source(self):
"""Obtain the make file "source" representation of the Statement.
This converts an individual Statement back to a string that can again
be parsed into this Statement.
"""
raise Exception("%s must implement to_source()." % self.__class__)
def __eq__(self, other):
raise Exception("%s must implement __eq__." % self.__class__)
def __ne__(self, other):
return self.__eq__(other)
class DummyRule(object):
__slots__ = ()
@ -172,6 +187,29 @@ class Rule(Statement):
def dump(self, fd, indent):
print >>fd, "%sRule %s: %s" % (indent, self.targetexp, self.depexp)
def to_source(self):
sep = ':'
if self.doublecolon:
sep = '::'
deps = self.depexp.to_source()
if len(deps) > 0 and not deps[0].isspace():
sep += ' '
return '\n%s%s%s' % (
self.targetexp.to_source(escape_variables=True),
sep,
deps)
def __eq__(self, other):
if not isinstance(other, Rule):
return False
return self.targetexp == other.targetexp \
and self.depexp == other.depexp \
and self.doublecolon == other.doublecolon
class StaticPatternRule(Statement):
"""
Static pattern rules are rules which specify multiple targets based on a
@ -227,6 +265,33 @@ class StaticPatternRule(Statement):
def dump(self, fd, indent):
print >>fd, "%sStaticPatternRule %s: %s: %s" % (indent, self.targetexp, self.patternexp, self.depexp)
def to_source(self):
sep = ':'
if self.doublecolon:
sep = '::'
pattern = self.patternexp.to_source()
deps = self.depexp.to_source()
if len(pattern) > 0 and pattern[0] not in (' ', '\t'):
sep += ' '
return '\n%s%s%s:%s' % (
self.targetexp.to_source(escape_variables=True),
sep,
pattern,
deps)
def __eq__(self, other):
if not isinstance(other, StaticPatternRule):
return False
return self.targetexp == other.targetexp \
and self.patternexp == other.patternexp \
and self.depexp == other.depexp \
and self.doublecolon == other.doublecolon
class Command(Statement):
"""
Commands are things that get executed by a rule.
@ -254,6 +319,23 @@ class Command(Statement):
def dump(self, fd, indent):
print >>fd, "%sCommand %s" % (indent, self.exp,)
def to_source(self):
# Commands have some interesting quirks when it comes to source
# formatting. First, they can be multi-line. Second, a tab needs to be
# inserted at the beginning of every line. Finally, there might be
# variable references inside the command. This means we need to escape
# variable references inside command strings. Luckily, this is handled
# by the Expansion.
s = self.exp.to_source(escape_variables=True)
return '\n'.join(['\t%s' % line for line in s.split('\n')])
def __eq__(self, other):
if not isinstance(other, Command):
return False
return self.exp == other.exp
class SetVariable(Statement):
"""
Represents a variable assignment.
@ -336,6 +418,66 @@ class SetVariable(Statement):
def dump(self, fd, indent):
print >>fd, "%sSetVariable<%s> %s %s\n%s %r" % (indent, self.valueloc, self.vnameexp, self.token, indent, self.value)
def __eq__(self, other):
if not isinstance(other, SetVariable):
return False
return self.vnameexp == other.vnameexp \
and self.token == other.token \
and self.value == other.value \
and self.targetexp == other.targetexp \
and self.source == other.source
def to_source(self):
chars = []
for i in xrange(0, len(self.value)):
c = self.value[i]
# Literal # is escaped in variable assignment otherwise it would be
# a comment.
if c == '#':
# If a backslash precedes this, we need to escape it as well.
if i > 0 and self.value[i-1] == '\\':
chars.append('\\')
chars.append('\\#')
continue
chars.append(c)
value = ''.join(chars)
prefix = ''
if self.source == data.Variables.SOURCE_OVERRIDE:
prefix = 'override '
# SetVariable come in two flavors: simple and target-specific.
# We handle the target-specific syntax first.
if self.targetexp is not None:
return '%s: %s %s %s' % (
self.targetexp.to_source(),
self.vnameexp.to_source(),
self.token,
value)
# The variable could be multi-line or have leading whitespace. For
# regular variable assignment, whitespace after the token but before
# the value is ignored. If we see leading whitespace in the value here,
# the variable must have come from a define.
if value.count('\n') > 0 or (len(value) and value[0].isspace()):
# The parser holds the token in vnameexp for whatever reason.
return '%sdefine %s\n%s\nendef' % (
prefix,
self.vnameexp.to_source(),
value)
return '%s%s %s %s' % (
prefix,
self.vnameexp.to_source(),
self.token,
value)
class Condition(object):
"""
An abstract "condition", either ifeq or ifdef, perhaps negated.
@ -347,6 +489,12 @@ class Condition(object):
def evaluate(self, makefile)
"""
def __eq__(self, other):
raise Exception("%s must implement __eq__." % __class__)
def __ne__(self, other):
return not self.__eq__(other)
class EqCondition(Condition):
"""
Represents an ifeq or ifneq conditional directive.
@ -375,6 +523,14 @@ class EqCondition(Condition):
def __str__(self):
return "ifeq (expected=%s) %s %s" % (self.expected, self.exp1, self.exp2)
def __eq__(self, other):
if not isinstance(other, EqCondition):
return False
return self.exp1 == other.exp1 \
and self.exp2 == other.exp2 \
and self.expected == other.expected
class IfdefCondition(Condition):
"""
Represents an ifdef or ifndef conditional directive.
@ -404,6 +560,12 @@ class IfdefCondition(Condition):
def __str__(self):
return "ifdef (expected=%s) %s" % (self.expected, self.exp)
def __eq__(self, other):
if not isinstance(other, IfdefCondition):
return False
return self.exp == other.exp and self.expected == other.expected
class ElseCondition(Condition):
"""
Represents the transition between branches in a ConditionBlock.
@ -416,6 +578,9 @@ class ElseCondition(Condition):
def __str__(self):
return "else"
def __eq__(self, other):
return isinstance(other, ElseCondition)
class ConditionBlock(Statement):
"""
A set of related Conditions.
@ -473,6 +638,106 @@ class ConditionBlock(Statement):
print >>fd, "%s ~Condition" % (indent,)
print >>fd, "%s~ConditionBlock" % (indent,)
def to_source(self):
lines = []
index = 0
for condition, statements in self:
lines.append(ConditionBlock.condition_source(condition, index))
index += 1
for statement in statements:
lines.append(statement.to_source())
lines.append('endif')
return '\n'.join(lines)
def __eq__(self, other):
if not isinstance(other, ConditionBlock):
return False
if len(self) != len(other):
return False
for i in xrange(0, len(self)):
our_condition, our_statements = self[i]
other_condition, other_statements = other[i]
if our_condition != other_condition:
return False
if our_statements != other_statements:
return False
return True
@staticmethod
def condition_source(statement, index):
"""Convert a condition to its source representation.
The index argument defines the index of this condition inside a
ConditionBlock. If it is greater than 0, an "else" will be prepended
to the result, if necessary.
"""
prefix = ''
if isinstance(statement, (EqCondition, IfdefCondition)) and index > 0:
prefix = 'else '
if isinstance(statement, IfdefCondition):
s = statement.exp.s
if statement.expected:
return '%sifdef %s' % (prefix, s)
return '%sifndef %s' % (prefix, s)
if isinstance(statement, EqCondition):
args = [
statement.exp1.to_source(escape_comments=True),
statement.exp2.to_source(escape_comments=True)]
use_quotes = False
single_quote_present = False
double_quote_present = False
for i, arg in enumerate(args):
if len(arg) > 0 and (arg[0].isspace() or arg[-1].isspace()):
use_quotes = True
if "'" in arg:
single_quote_present = True
if '"' in arg:
double_quote_present = True
# Quote everything if needed.
if single_quote_present and double_quote_present:
raise Exception('Cannot format condition with multiple quotes.')
if use_quotes:
for i, arg in enumerate(args):
# Double to single quotes.
if single_quote_present:
args[i] = '"' + arg + '"'
else:
args[i] = "'" + arg + "'"
body = None
if use_quotes:
body = ' '.join(args)
else:
body = '(%s)' % ','.join(args)
if statement.expected:
return '%sifeq %s' % (prefix, body)
return '%sifneq %s' % (prefix, body)
if isinstance(statement, ElseCondition):
return 'else'
raise Exception('Unhandled Condition statement: %s' %
statement.__class__)
def __iter__(self):
return iter(self._groups)
@ -508,6 +773,20 @@ class Include(Statement):
def dump(self, fd, indent):
print >>fd, "%sInclude %s" % (indent, self.exp)
def to_source(self):
prefix = ''
if not self.required:
prefix = '-'
return '%sinclude %s' % (prefix, self.exp.to_source())
def __eq__(self, other):
if not isinstance(other, Include):
return False
return self.exp == other.exp and self.required == other.required
class VPathDirective(Statement):
"""
Represents the vpath directive.
@ -541,6 +820,15 @@ class VPathDirective(Statement):
def dump(self, fd, indent):
print >>fd, "%sVPath %s" % (indent, self.exp)
def to_source(self):
return 'vpath %s' % self.exp.to_source()
def __eq__(self, other):
if not isinstance(other, VPathDirective):
return False
return self.exp == other.exp
class ExportDirective(Statement):
"""
Represents the "export" directive.
@ -577,6 +865,17 @@ class ExportDirective(Statement):
def dump(self, fd, indent):
print >>fd, "%sExport (single=%s) %s" % (indent, self.single, self.exp)
def to_source(self):
return ('export %s' % self.exp.to_source()).rstrip()
def __eq__(self, other):
if not isinstance(other, ExportDirective):
return False
# single is irrelevant because it just says whether the next Statement
# contains a variable definition.
return self.exp == other.exp
class UnexportDirective(Statement):
"""
Represents the "unexport" directive.
@ -596,6 +895,15 @@ class UnexportDirective(Statement):
def dump(self, fd, indent):
print >>fd, "%sUnexport %s" % (indent, self.exp)
def to_source(self):
return 'unexport %s' % self.exp.to_source()
def __eq__(self, other):
if not isinstance(other, UnexportDirective):
return False
return self.exp == other.exp
class EmptyDirective(Statement):
"""
Represents a standalone statement, usually an Expansion.
@ -619,6 +927,15 @@ class EmptyDirective(Statement):
def dump(self, fd, indent):
print >>fd, "%sEmptyDirective: %s" % (indent, self.exp)
def to_source(self):
return self.exp.to_source()
def __eq__(self, other):
if not isinstance(other, EmptyDirective):
return False
return self.exp == other.exp
class _EvalContext(object):
__slots__ = ('currule', 'weak')
@ -656,6 +973,9 @@ class StatementList(list):
self.dump(fd, '')
return fd.getvalue()
def to_source(self):
return '\n'.join([s.to_source() for s in self])
def iterstatements(stmts):
for s in stmts:
yield s

Просмотреть файл

@ -1,4 +1,4 @@
import pymake.data, pymake.util
import pymake.data, pymake.functions, pymake.util
import unittest
import re
from cStringIO import StringIO
@ -74,5 +74,164 @@ class LRUTest(unittest.TestCase):
self.assertEqual(goti, di,
"debugitems, iteration %i, got %r expected %r" % (i, goti, di))
class EqualityTest(unittest.TestCase):
def test_string_expansion(self):
s1 = pymake.data.StringExpansion('foo bar', None)
s2 = pymake.data.StringExpansion('foo bar', None)
self.assertEqual(s1, s2)
def test_expansion_simple(self):
s1 = pymake.data.Expansion(None)
s2 = pymake.data.Expansion(None)
self.assertEqual(s1, s2)
s1.appendstr('foo')
s2.appendstr('foo')
self.assertEqual(s1, s2)
def test_expansion_string_finish(self):
"""Adjacent strings should normalize to same value."""
s1 = pymake.data.Expansion(None)
s2 = pymake.data.Expansion(None)
s1.appendstr('foo')
s2.appendstr('foo')
s1.appendstr(' bar')
s1.appendstr(' baz')
s2.appendstr(' bar baz')
self.assertEqual(s1, s2)
def test_function(self):
s1 = pymake.data.Expansion(None)
s2 = pymake.data.Expansion(None)
n1 = pymake.data.StringExpansion('FOO', None)
n2 = pymake.data.StringExpansion('FOO', None)
v1 = pymake.functions.VariableRef(None, n1)
v2 = pymake.functions.VariableRef(None, n2)
s1.appendfunc(v1)
s2.appendfunc(v2)
self.assertEqual(s1, s2)
class StringExpansionTest(unittest.TestCase):
def test_base_expansion_interface(self):
s1 = pymake.data.StringExpansion('FOO', None)
self.assertTrue(s1.is_static_string)
funcs = list(s1.functions())
self.assertEqual(len(funcs), 0)
funcs = list(s1.functions(True))
self.assertEqual(len(funcs), 0)
refs = list(s1.variable_references())
self.assertEqual(len(refs), 0)
class ExpansionTest(unittest.TestCase):
def test_is_static_string(self):
e1 = pymake.data.Expansion()
e1.appendstr('foo')
self.assertTrue(e1.is_static_string)
e1.appendstr('bar')
self.assertTrue(e1.is_static_string)
vname = pymake.data.StringExpansion('FOO', None)
func = pymake.functions.VariableRef(None, vname)
e1.appendfunc(func)
self.assertFalse(e1.is_static_string)
def test_get_functions(self):
e1 = pymake.data.Expansion()
e1.appendstr('foo')
vname1 = pymake.data.StringExpansion('FOO', None)
vname2 = pymake.data.StringExpansion('BAR', None)
func1 = pymake.functions.VariableRef(None, vname1)
func2 = pymake.functions.VariableRef(None, vname2)
e1.appendfunc(func1)
e1.appendfunc(func2)
funcs = list(e1.functions())
self.assertEqual(len(funcs), 2)
func3 = pymake.functions.SortFunction(None)
func3.append(vname1)
e1.appendfunc(func3)
funcs = list(e1.functions())
self.assertEqual(len(funcs), 3)
refs = list(e1.variable_references())
self.assertEqual(len(refs), 2)
def test_get_functions_descend(self):
e1 = pymake.data.Expansion()
vname1 = pymake.data.StringExpansion('FOO', None)
func1 = pymake.functions.VariableRef(None, vname1)
e2 = pymake.data.Expansion()
e2.appendfunc(func1)
func2 = pymake.functions.SortFunction(None)
func2.append(e2)
e1.appendfunc(func2)
funcs = list(e1.functions())
self.assertEqual(len(funcs), 1)
funcs = list(e1.functions(True))
self.assertEqual(len(funcs), 2)
self.assertTrue(isinstance(funcs[0], pymake.functions.SortFunction))
def test_is_filesystem_dependent(self):
e = pymake.data.Expansion()
vname1 = pymake.data.StringExpansion('FOO', None)
func1 = pymake.functions.VariableRef(None, vname1)
e.appendfunc(func1)
self.assertFalse(e.is_filesystem_dependent)
func2 = pymake.functions.WildcardFunction(None)
func2.append(vname1)
e.appendfunc(func2)
self.assertTrue(e.is_filesystem_dependent)
def test_is_filesystem_dependent_descend(self):
sort = pymake.functions.SortFunction(None)
wildcard = pymake.functions.WildcardFunction(None)
e = pymake.data.StringExpansion('foo/*', None)
wildcard.append(e)
e = pymake.data.Expansion(None)
e.appendfunc(wildcard)
sort.append(e)
e = pymake.data.Expansion(None)
e.appendfunc(sort)
self.assertTrue(e.is_filesystem_dependent)
if __name__ == '__main__':
unittest.main()

Просмотреть файл

@ -0,0 +1,7 @@
not-default:
@echo TEST-FAIL
default:
@echo TEST-PASS
.DEFAULT_GOAL := default

Просмотреть файл

@ -0,0 +1,289 @@
# This file contains test code for the formatting of parsed statements back to
# make file "source." It essentially verifies to to_source() functions
# scattered across the tree.
import glob
import logging
import os.path
import unittest
from pymake.data import Expansion
from pymake.data import StringExpansion
from pymake.functions import BasenameFunction
from pymake.functions import SubstitutionRef
from pymake.functions import VariableRef
from pymake.functions import WordlistFunction
from pymake.parserdata import Include
from pymake.parserdata import SetVariable
from pymake.parser import parsestring
from pymake.parser import SyntaxError
class TestBase(unittest.TestCase):
pass
class VariableRefTest(TestBase):
def test_string_name(self):
e = StringExpansion('foo', None)
v = VariableRef(None, e)
self.assertEqual(v.to_source(), '$(foo)')
def test_special_variable(self):
e = StringExpansion('<', None)
v = VariableRef(None, e)
self.assertEqual(v.to_source(), '$<')
def test_expansion_simple(self):
e = Expansion()
e.appendstr('foo')
e.appendstr('bar')
v = VariableRef(None, e)
self.assertEqual(v.to_source(), '$(foobar)')
class StandardFunctionTest(TestBase):
def test_basename(self):
e1 = StringExpansion('foo', None)
v = VariableRef(None, e1)
e2 = Expansion(None)
e2.appendfunc(v)
b = BasenameFunction(None)
b.append(e2)
self.assertEqual(b.to_source(), '$(basename $(foo))')
def test_wordlist(self):
e1 = StringExpansion('foo', None)
e2 = StringExpansion('bar ', None)
e3 = StringExpansion(' baz', None)
w = WordlistFunction(None)
w.append(e1)
w.append(e2)
w.append(e3)
self.assertEqual(w.to_source(), '$(wordlist foo,bar , baz)')
def test_curly_brackets(self):
e1 = Expansion(None)
e1.appendstr('foo')
e2 = Expansion(None)
e2.appendstr('foo ( bar')
f = WordlistFunction(None)
f.append(e1)
f.append(e2)
self.assertEqual(f.to_source(), '${wordlist foo,foo ( bar}')
class StringExpansionTest(TestBase):
def test_simple(self):
e = StringExpansion('foobar', None)
self.assertEqual(e.to_source(), 'foobar')
e = StringExpansion('$var', None)
self.assertEqual(e.to_source(), '$var')
def test_escaping(self):
e = StringExpansion('$var', None)
self.assertEqual(e.to_source(escape_variables=True), '$$var')
e = StringExpansion('this is # not a comment', None)
self.assertEqual(e.to_source(escape_comments=True),
'this is \# not a comment')
def test_empty(self):
e = StringExpansion('', None)
self.assertEqual(e.to_source(), '')
e = StringExpansion(' ', None)
self.assertEqual(e.to_source(), ' ')
class ExpansionTest(TestBase):
def test_single_string(self):
e = Expansion()
e.appendstr('foo')
self.assertEqual(e.to_source(), 'foo')
def test_multiple_strings(self):
e = Expansion()
e.appendstr('hello')
e.appendstr('world')
self.assertEqual(e.to_source(), 'helloworld')
def test_string_escape(self):
e = Expansion()
e.appendstr('$var')
self.assertEqual(e.to_source(), '$var')
self.assertEqual(e.to_source(escape_variables=True), '$$var')
e = Expansion()
e.appendstr('foo')
e.appendstr(' $bar')
self.assertEqual(e.to_source(escape_variables=True), 'foo $$bar')
class SubstitutionRefTest(TestBase):
def test_simple(self):
name = StringExpansion('foo', None)
c = StringExpansion('%.c', None)
o = StringExpansion('%.o', None)
s = SubstitutionRef(None, name, c, o)
self.assertEqual(s.to_source(), '$(foo:%.c=%.o)')
class SetVariableTest(TestBase):
def test_simple(self):
v = SetVariable(StringExpansion('foo', None), '=', 'bar', None, None)
self.assertEqual(v.to_source(), 'foo = bar')
def test_multiline(self):
s = 'hello\nworld'
foo = StringExpansion('FOO', None)
v = SetVariable(foo, '=', s, None, None)
self.assertEqual(v.to_source(), 'define FOO\nhello\nworld\nendef')
def test_multiline_immediate(self):
source = 'define FOO :=\nhello\nworld\nendef'
statements = parsestring(source, 'foo.mk')
self.assertEqual(statements.to_source(), source)
def test_target_specific(self):
foo = StringExpansion('FOO', None)
bar = StringExpansion('BAR', None)
v = SetVariable(foo, '+=', 'value', None, bar)
self.assertEqual(v.to_source(), 'BAR: FOO += value')
class IncludeTest(TestBase):
def test_include(self):
e = StringExpansion('rules.mk', None)
i = Include(e, True, False)
self.assertEqual(i.to_source(), 'include rules.mk')
i = Include(e, False, False)
self.assertEqual(i.to_source(), '-include rules.mk')
class IfdefTest(TestBase):
def test_simple(self):
source = 'ifdef FOO\nbar := $(value)\nendif'
statements = parsestring(source, 'foo.mk')
self.assertEqual(statements[0].to_source(), source)
def test_nested(self):
source = 'ifdef FOO\nifdef BAR\nhello = world\nendif\nendif'
statements = parsestring(source, 'foo.mk')
self.assertEqual(statements[0].to_source(), source)
def test_negation(self):
source = 'ifndef FOO\nbar += value\nendif'
statements = parsestring(source, 'foo.mk')
self.assertEqual(statements[0].to_source(), source)
class IfeqTest(TestBase):
def test_simple(self):
source = 'ifeq ($(foo),bar)\nhello = $(world)\nendif'
statements = parsestring(source, 'foo.mk')
self.assertEqual(statements[0].to_source(), source)
def test_negation(self):
source = 'ifneq (foo,bar)\nhello = world\nendif'
statements = parsestring(source, 'foo.mk')
self.assertEqual(statements.to_source(), source)
class ConditionBlocksTest(TestBase):
def test_mixed_conditions(self):
source = 'ifdef FOO\nifeq ($(FOO),bar)\nvar += $(value)\nendif\nendif'
statements = parsestring(source, 'foo.mk')
self.assertEqual(statements.to_source(), source)
def test_extra_statements(self):
source = 'ifdef FOO\nF := 1\nifdef BAR\nB += 1\nendif\nC = 1\nendif'
statements = parsestring(source, 'foo.mk')
self.assertEqual(statements.to_source(), source)
def test_whitespace_preservation(self):
source = "ifeq ' x' 'x '\n$(error stripping)\nendif"
statements = parsestring(source, 'foo.mk')
self.assertEqual(statements.to_source(), source)
source = 'ifneq (x , x)\n$(error stripping)\nendif'
statements = parsestring(source, 'foo.mk')
self.assertEqual(statements.to_source(),
'ifneq (x,x)\n$(error stripping)\nendif')
class MakefileCorupusTest(TestBase):
"""Runs the make files from the pymake corpus through the formatter.
All the above tests are child's play compared to this.
"""
# Our reformatting isn't perfect. We ignore files with known failures until
# we make them work.
# TODO Address these formatting corner cases.
_IGNORE_FILES = [
# We are thrown off by backslashes at end of lines.
'comment-parsing.mk',
'escape-chars.mk',
'include-notfound.mk',
]
def _get_test_files(self):
ourdir = os.path.dirname(os.path.abspath(__file__))
for makefile in glob.glob(os.path.join(ourdir, '*.mk')):
if os.path.basename(makefile) in self._IGNORE_FILES:
continue
source = None
with open(makefile, 'rU') as fh:
source = fh.read()
try:
yield (makefile, source, parsestring(source, makefile))
except SyntaxError:
continue
def test_reparse_consistency(self):
for filename, source, statements in self._get_test_files():
reformatted = statements.to_source()
# We should be able to parse the reformatted source fine.
new_statements = parsestring(reformatted, filename)
# If we do the formatting again, the representation shouldn't
# change. i.e. the only lossy change should be the original
# (whitespace and some semantics aren't preserved).
reformatted_again = new_statements.to_source()
self.assertEqual(reformatted, reformatted_again,
'%s has lossless reformat.' % filename)
self.assertEqual(len(statements), len(new_statements))
for i in xrange(0, len(statements)):
original = statements[i]
formatted = new_statements[i]
self.assertEqual(original, formatted, '%s %d: %s != %s' % (filename,
i, original, formatted))
if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
unittest.main()

Просмотреть файл

@ -0,0 +1,54 @@
import unittest
import pymake.data
import pymake.functions
class VariableRefTest(unittest.TestCase):
def test_get_expansions(self):
e = pymake.data.StringExpansion('FOO', None)
f = pymake.functions.VariableRef(None, e)
exps = list(f.expansions())
self.assertEqual(len(exps), 1)
class GetExpansionsTest(unittest.TestCase):
def test_get_arguments(self):
f = pymake.functions.SubstFunction(None)
e1 = pymake.data.StringExpansion('FOO', None)
e2 = pymake.data.StringExpansion('BAR', None)
e3 = pymake.data.StringExpansion('BAZ', None)
f.append(e1)
f.append(e2)
f.append(e3)
exps = list(f.expansions())
self.assertEqual(len(exps), 3)
def test_descend(self):
f = pymake.functions.StripFunction(None)
e = pymake.data.Expansion(None)
e1 = pymake.data.StringExpansion('FOO', None)
f1 = pymake.functions.VariableRef(None, e1)
e.appendfunc(f1)
f2 = pymake.functions.WildcardFunction(None)
e2 = pymake.data.StringExpansion('foo/*', None)
f2.append(e2)
e.appendfunc(f2)
f.append(e)
exps = list(f.expansions())
self.assertEqual(len(exps), 1)
exps = list(f.expansions(True))
self.assertEqual(len(exps), 3)
self.assertFalse(f.is_filesystem_dependent)
if __name__ == '__main__':
unittest.main()

Просмотреть файл

@ -54,20 +54,30 @@ class TestFileAvoidWrite(unittest.TestCase):
class TestEnvironment(unittest.TestCase):
def test_auto_substs(self):
'''Test the automatically set values of ACDEFINES and ALLDEFINES.
'''Test the automatically set values of ACDEFINES, ALLDEFINES
and ALLSUBSTS.
'''
env = ConfigEnvironment(
defines = [ ('foo', 'bar'), ('baz', 'qux 42'),
('abc', 'def'), ('extra', 'foobar') ],
non_global_defines = ['extra', 'ignore'])
non_global_defines = ['extra', 'ignore'],
substs = [ ('FOO', 'bar'), ('ABC', 'def'),
('bar', 'baz qux'), ('zzz', '"abc def"') ])
# non_global_defines should be filtered out in ACDEFINES and
# ALLDEFINES.
# Original order of the defines need to be respected in ACDEFINES
self.assertEqual(env.substs['ACDEFINES'], '-Dfoo=bar -Dbaz=qux\\ 42 -Dabc=def')
self.assertEqual(env.substs['ACDEFINES'], '''-Dfoo=bar -Dbaz=qux\ 42 -Dabc=def''')
# ALLDEFINES, on the other hand, needs to be sorted
self.assertEqual(env.substs['ALLDEFINES'], '''#define abc def
#define baz qux 42
#define foo bar''')
# Likewise for ALLSUBSTS, which also mustn't contain ALLDEFINES
# but contain ACDEFINES
self.assertEqual(env.substs['ALLSUBSTS'], '''ABC = def
ACDEFINES = -Dfoo=bar -Dbaz=qux\ 42 -Dabc=def
FOO = bar
bar = baz qux
zzz = "abc def"''')
def test_config_file(self):
'''Test the creation of config files.

Просмотреть файл

@ -4,9 +4,10 @@ export LIB=/d/msvs10/vc/lib:/d/msvs10/vc/atlmfc/lib:/d/sdks/v7.0/lib:/d/msvs8/VC
export PATH="/d/msvs10/VSTSDB/Deploy:/d/msvs10/Common7/IDE/:/d/msvs10/VC/BIN:/d/msvs10/Common7/Tools:/d/msvs10/VC/VCPackages:${PATH}"
export WIN32_REDIST_DIR=/d/msvs10/VC/redist/x86/Microsoft.VC100.CRT
. $topsrcdir/build/mozconfig.vs2010-common
mk_add_options "export LIB=$LIB"
mk_add_options "export LIBPATH=$LIBPATH"
mk_add_options "export PATH=$PATH"
mk_add_options "export INCLUDE=$INCLUDE"
mk_add_options "export WIN32_REDIST_DIR=$WIN32_REDIST_DIR"
mk_export_correct_style LIB
mk_export_correct_style LIBPATH
mk_export_correct_style PATH
mk_export_correct_style INCLUDE
mk_export_correct_style WIN32_REDIST_DIR

Просмотреть файл

@ -5,9 +5,12 @@ export WIN32_REDIST_DIR=/c/tools/msvs10/VC/redist/x86/Microsoft.VC100.CRT
export MOZ_TOOLS=C:/mozilla-build/moztools
export PATH="/c/tools/msvs10/Common7/IDE:/c/tools/msvs10/VC/BIN:/c/tools/msvs10/Common7/Tools:/c/tools/msvs10/VC/VCPackages:/c/mozilla-build/moztools:/c/Tools/sdks/v7.0/bin:${PATH}"
mk_add_options "export LIB=$LIB"
mk_add_options "export LIBPATH=$LIBPATH"
mk_add_options "export PATH=$PATH"
mk_add_options "export INCLUDE=$INCLUDE"
mk_add_options "export WIN32_REDIST_DIR=$WIN32_REDIST_DIR"
. $topsrcdir/build/mozconfig.vs2010-common
mk_export_correct_style LIB
mk_export_correct_style LIBPATH
mk_export_correct_style PATH
mk_export_correct_style INCLUDE
mk_export_correct_style WIN32_REDIST_DIR
mk_add_options "export MOZ_TOOLS=$MOZ_TOOLS"

Просмотреть файл

@ -8,9 +8,10 @@ export WIN32_REDIST_DIR=/c/tools/msvs10/VC/redist/x64/Microsoft.VC100.CRT
# https://connect.microsoft.com/VisualStudio/feedback/details/686117/
export LD=/c/tools/msvs10/VC/BIN/x86_amd64/link.exe
. $topsrcdir/build/mozconfig.vs2010-common
mk_add_options "export LIB=$LIB"
mk_add_options "export LIBPATH=$LIBPATH"
mk_add_options "export PATH=$PATH"
mk_add_options "export INCLUDE=$INCLUDE"
mk_add_options "export WIN32_REDIST_DIR=$WIN32_REDIST_DIR"
mk_export_correct_style LIB
mk_export_correct_style LIBPATH
mk_export_correct_style PATH
mk_export_correct_style INCLUDE
mk_export_correct_style WIN32_REDIST_DIR

Просмотреть файл

@ -103,7 +103,7 @@ endef
# As $(shell) doesn't preserve newlines, use sed to replace them with an
# unlikely sequence (||), which is then replaced back to newlines by make
# before evaluation.
$(eval $(subst ||,$(CR),$(shell $(TOPSRCDIR)/$(MOZCONFIG_LOADER) $(TOPSRCDIR) 2> $(TOPSRCDIR)/.mozconfig.out | sed 's/$$/||/')))
$(eval $(subst ||,$(CR),$(shell _PYMAKE=$(.PYMAKE) $(TOPSRCDIR)/$(MOZCONFIG_LOADER) $(TOPSRCDIR) 2> $(TOPSRCDIR)/.mozconfig.out | sed 's/$$/||/')))
ifndef MOZ_OBJDIR
MOZ_OBJDIR = obj-$(CONFIG_GUESS)
@ -402,7 +402,20 @@ cleansrcdir:
build/autoconf/clean-config.sh; \
fi;
## Sanity check $X and js/src/$X are in sync
# Because SpiderMonkey can be distributed and built independently
# of the Mozilla source tree, it contains its own copies of many of
# the files used by the top-level Mozilla build process, from the
# 'config' and 'build' subtrees.
#
# To make it simpler to keep the copies in sync, we follow the policy
# that the SpiderMonkey copies must always be exact copies of those in
# the containing Mozilla tree. If you've made a change in one, it
# belongs in the other as well. If the change isn't right for both
# places, then that's something to bring up with the other developers.
#
# Some files are reasonable to diverge; for example,
# js/src/config/autoconf.mk.in doesn't need most of the stuff in
# config/autoconf.mk.in.
.PHONY: check-sync-dirs
check-sync-dirs: check-sync-dirs-build check-sync-dirs-config
check-sync-dirs-%:

Просмотреть файл

@ -1,668 +1,2 @@
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# A netscape style .mk file for autoconf builds
target = @target@
ac_configure_args = @ac_configure_args@
MOZILLA_VERSION = @MOZILLA_VERSION@
FIREFOX_VERSION = @FIREFOX_VERSION@
MOZ_BUILD_APP = @MOZ_BUILD_APP@
MOZ_APP_NAME = @MOZ_APP_NAME@
MOZ_APP_DISPLAYNAME = @MOZ_APP_DISPLAYNAME@
MOZ_APP_BASENAME = @MOZ_APP_BASENAME@
MOZ_APP_VENDOR = @MOZ_APP_VENDOR@
MOZ_APP_PROFILE = @MOZ_APP_PROFILE@
MOZ_APP_ID = @MOZ_APP_ID@
MAR_CHANNEL_ID = @MAR_CHANNEL_ID@
ACCEPTED_MAR_CHANNEL_IDS = @ACCEPTED_MAR_CHANNEL_IDS@
MOZ_PROFILE_MIGRATOR = @MOZ_PROFILE_MIGRATOR@
MOZ_EXTENSION_MANAGER = @MOZ_EXTENSION_MANAGER@
MOZ_APP_UA_NAME = @MOZ_APP_UA_NAME@
MOZ_UA_OS_AGNOSTIC = @MOZ_UA_OS_AGNOSTIC@
MOZ_APP_VERSION = @MOZ_APP_VERSION@
MOZ_APP_MAXVERSION = @MOZ_APP_MAXVERSION@
MOZ_MACBUNDLE_NAME = @MOZ_MACBUNDLE_NAME@
MOZ_MACBUNDLE_ID = @MOZ_MACBUNDLE_ID@
MOZ_APP_STATIC_INI = @MOZ_APP_STATIC_INI@
MOZ_PKG_SPECIAL = @MOZ_PKG_SPECIAL@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
includedir = @includedir@
libdir = @libdir@
datadir = @datadir@
mandir = @mandir@
LIBXUL_SDK = @LIBXUL_SDK@
MOZ_FS_LAYOUT = @MOZ_FS_LAYOUT@
L10NBASEDIR = @L10NBASEDIR@
LIBXUL_DIST = @LIBXUL_DIST@
SYSTEM_LIBXUL = @SYSTEM_LIBXUL@
XULRUNNER_STUB_NAME = @XULRUNNER_STUB_NAME@
MOZ_CHROME_FILE_FORMAT = @MOZ_CHROME_FILE_FORMAT@
MOZ_OMNIJAR = @MOZ_OMNIJAR@
OMNIJAR_NAME = @OMNIJAR_NAME@
MOZ_WIDGET_TOOLKIT = @MOZ_WIDGET_TOOLKIT@
MOZ_GFX_OPTIMIZE_MOBILE = @MOZ_GFX_OPTIMIZE_MOBILE@
MOZ_X11 = @MOZ_X11@
MOZ_PANGO = @MOZ_PANGO@
MOZ_JS_LIBS = @MOZ_JS_LIBS@
MOZ_DEBUG = @MOZ_DEBUG@
MOZ_DEBUG_SYMBOLS = @MOZ_DEBUG_SYMBOLS@
MOZ_DEBUG_ENABLE_DEFS = @MOZ_DEBUG_ENABLE_DEFS@
MOZ_DEBUG_DISABLE_DEFS = @MOZ_DEBUG_DISABLE_DEFS@
MOZ_DEBUG_FLAGS = @MOZ_DEBUG_FLAGS@
MOZ_DEBUG_LDFLAGS=@MOZ_DEBUG_LDFLAGS@
MOZ_EXTENSIONS = @MOZ_EXTENSIONS@
MOZ_JSDEBUGGER = @MOZ_JSDEBUGGER@
MOZ_IPDL_TESTS = @MOZ_IPDL_TESTS@
MOZ_MEMORY = @MOZ_MEMORY@
MOZ_JEMALLOC = @MOZ_JEMALLOC@
MOZ_PROFILING = @MOZ_PROFILING@
MOZ_ENABLE_PROFILER_SPS = @MOZ_ENABLE_PROFILER_SPS@
MOZ_JPROF = @MOZ_JPROF@
MOZ_SHARK = @MOZ_SHARK@
MOZ_CALLGRIND = @MOZ_CALLGRIND@
MOZ_VALGRIND = @MOZ_VALGRIND@
MOZ_VTUNE = @MOZ_VTUNE@
MOZ_ETW = @MOZ_ETW@
DEHYDRA_PATH = @DEHYDRA_PATH@
MOZ_USING_CCACHE = @MOZ_USING_CCACHE@
CLANG_CXX = @CLANG_CXX@
MOZ_LINKER = @MOZ_LINKER@
MOZ_OLD_LINKER = @MOZ_OLD_LINKER@
MOZ_ENABLE_SZIP = @MOZ_ENABLE_SZIP@
NS_TRACE_MALLOC = @NS_TRACE_MALLOC@
USE_ELF_DYNSTR_GC = @USE_ELF_DYNSTR_GC@
USE_ELF_HACK = @USE_ELF_HACK@
STDCXX_COMPAT = @STDCXX_COMPAT@
MOZ_LIBSTDCXX_TARGET_VERSION=@MOZ_LIBSTDCXX_TARGET_VERSION@
MOZ_LIBSTDCXX_HOST_VERSION=@MOZ_LIBSTDCXX_HOST_VERSION@
INCREMENTAL_LINKER = @INCREMENTAL_LINKER@
MACOSX_DEPLOYMENT_TARGET = @MACOSX_DEPLOYMENT_TARGET@
ENABLE_TESTS = @ENABLE_TESTS@
ENABLE_MARIONETTE = @ENABLE_MARIONETTE@
IBMBIDI = @IBMBIDI@
MOZ_UNIVERSALCHARDET = @MOZ_UNIVERSALCHARDET@
ACCESSIBILITY = @ACCESSIBILITY@
MOZ_BRANDING_DIRECTORY = @MOZ_BRANDING_DIRECTORY@
MOZ_MAINTENANCE_SERVICE = @MOZ_MAINTENANCE_SERVICE@
MOZ_VERIFY_MAR_SIGNATURE = @MOZ_VERIFY_MAR_SIGNATURE@
MOZ_ENABLE_SIGNMAR = @MOZ_ENABLE_SIGNMAR@
MOZ_UPDATER = @MOZ_UPDATER@
MOZ_UPDATE_CHANNEL = @MOZ_UPDATE_CHANNEL@
MOZ_UPDATE_PACKAGING = @MOZ_UPDATE_PACKAGING@
MOZ_DISABLE_PARENTAL_CONTROLS = @MOZ_DISABLE_PARENTAL_CONTROLS@
NS_ENABLE_TSF = @NS_ENABLE_TSF@
MOZ_SPELLCHECK = @MOZ_SPELLCHECK@
MOZ_ANDROID_HISTORY = @MOZ_ANDROID_HISTORY@
MOZ_WEBSMS_BACKEND = @MOZ_WEBSMS_BACKEND@
MOZ_JAVA_COMPOSITOR = @MOZ_JAVA_COMPOSITOR@
MOZ_ONLY_TOUCH_EVENTS = @MOZ_ONLY_TOUCH_EVENTS@
MOZ_PROFILELOCKING = @MOZ_PROFILELOCKING@
MOZ_FEEDS = @MOZ_FEEDS@
MOZ_TOOLKIT_SEARCH = @MOZ_TOOLKIT_SEARCH@
MOZ_PLACES = @MOZ_PLACES@
MOZ_SAFE_BROWSING = @MOZ_SAFE_BROWSING@
MOZ_URL_CLASSIFIER = @MOZ_URL_CLASSIFIER@
MOZ_ZIPWRITER = @MOZ_ZIPWRITER@
MOZ_OGG = @MOZ_OGG@
MOZ_RAW = @MOZ_RAW@
MOZ_SYDNEYAUDIO = @MOZ_SYDNEYAUDIO@
MOZ_SPEEX_RESAMPLER = @MOZ_SPEEX_RESAMPLER@
MOZ_CUBEB = @MOZ_CUBEB@
MOZ_WAVE = @MOZ_WAVE@
MOZ_MEDIA = @MOZ_MEDIA@
MOZ_VORBIS = @MOZ_VORBIS@
MOZ_TREMOR = @MOZ_TREMOR@
MOZ_OPUS = @MOZ_OPUS@
MOZ_WEBM = @MOZ_WEBM@
MOZ_MEDIA_PLUGINS = @MOZ_MEDIA_PLUGINS@
MOZ_OMX_PLUGIN = @MOZ_OMX_PLUGIN@
MOZ_GSTREAMER = @MOZ_GSTREAMER@
MOZ_VP8 = @MOZ_VP8@
MOZ_VP8_ERROR_CONCEALMENT = @MOZ_VP8_ERROR_CONCEALMENT@
MOZ_VP8_ENCODER = @MOZ_VP8_ENCODER@
VPX_AS = @VPX_AS@
VPX_ASFLAGS = @VPX_ASFLAGS@
VPX_DASH_C_FLAG = @VPX_DASH_C_FLAG@
VPX_AS_CONVERSION = @VPX_AS_CONVERSION@
VPX_ASM_SUFFIX = @VPX_ASM_SUFFIX@
VPX_X86_ASM = @VPX_X86_ASM@
VPX_ARM_ASM = @VPX_ARM_ASM@
VPX_NEED_OBJ_INT_EXTRACT = @VPX_NEED_OBJ_INT_EXTRACT@
LIBJPEG_TURBO_AS = @LIBJPEG_TURBO_AS@
LIBJPEG_TURBO_ASFLAGS = @LIBJPEG_TURBO_ASFLAGS@
LIBJPEG_TURBO_X86_ASM = @LIBJPEG_TURBO_X86_ASM@
LIBJPEG_TURBO_X64_ASM = @LIBJPEG_TURBO_X64_ASM@
LIBJPEG_TURBO_ARM_ASM = @LIBJPEG_TURBO_ARM_ASM@
NS_PRINTING = @NS_PRINTING@
MOZ_PDF_PRINTING = @MOZ_PDF_PRINTING@
MOZ_CRASHREPORTER = @MOZ_CRASHREPORTER@
MOZ_CRASHREPORTER_INJECTOR = @MOZ_CRASHREPORTER_INJECTOR@
MOZ_HELP_VIEWER = @MOZ_HELP_VIEWER@
MOC = @MOC@
RCC = @RCC@
MOZ_NSS_PATCH = @MOZ_NSS_PATCH@
MOZ_WEBGL = @MOZ_WEBGL@
MOZ_ANGLE_RENDERER = @MOZ_ANGLE_RENDERER@
MOZ_DIRECTX_SDK_PATH = @MOZ_DIRECTX_SDK_PATH@
MOZ_DIRECTX_SDK_CPU_SUFFIX = @MOZ_DIRECTX_SDK_CPU_SUFFIX@
MOZ_D3DX9_VERSION = @MOZ_D3DX9_VERSION@
MOZ_D3DX9_CAB = @MOZ_D3DX9_CAB@
MOZ_D3DCOMPILER_CAB = @MOZ_D3DCOMPILER_CAB@
MOZ_D3DX9_DLL = @MOZ_D3DX9_DLL@
MOZ_D3DCOMPILER_DLL = @MOZ_D3DCOMPILER_DLL@
MOZ_GL_PROVIDER = @MOZ_GL_PROVIDER@
MOZ_GL_DEFAULT_PROVIDER = @MOZ_GL_DEFAULT_PROVIDER@
MOZ_WEBRTC = @MOZ_WEBRTC@
JAVA=@JAVA@
JAVAC=@JAVAC@
JAR=@JAR@
TAR=@TAR@
MAKENSISU=@MAKENSISU@
# The MOZ_UI_LOCALE var is used to build a particular locale. Do *not*
# use the var to change any binary files. Do *not* use this var unless you
# write rules for the "clean-locale" and "locale" targets.
MOZ_UI_LOCALE = @MOZ_UI_LOCALE@
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS = @MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS@
MOZ_COMPONENT_NSPR_LIBS=@MOZ_COMPONENT_NSPR_LIBS@
MOZ_FIX_LINK_PATHS=@MOZ_FIX_LINK_PATHS@
XPCOM_FROZEN_LDOPTS=@XPCOM_FROZEN_LDOPTS@
XPCOM_LIBS=@XPCOM_LIBS@
LIBXUL_LIBS=@LIBXUL_LIBS@
ENABLE_STRIP = @ENABLE_STRIP@
PKG_SKIP_STRIP = @PKG_SKIP_STRIP@
STRIP_FLAGS = @STRIP_FLAGS@
MOZ_POST_DSO_LIB_COMMAND = @MOZ_POST_DSO_LIB_COMMAND@
MOZ_POST_PROGRAM_COMMAND = @MOZ_POST_PROGRAM_COMMAND@
MOZ_BUILD_ROOT = @MOZ_BUILD_ROOT@
MOZ_XUL = @MOZ_XUL@
NECKO_PROTOCOLS = @NECKO_PROTOCOLS@
NECKO_COOKIES = @NECKO_COOKIES@
NECKO_WIFI = @NECKO_WIFI@
MOZ_AUTH_EXTENSION = @MOZ_AUTH_EXTENSION@
MOZ_NATIVE_HUNSPELL = @MOZ_NATIVE_HUNSPELL@
MOZ_HUNSPELL_LIBS = @MOZ_HUNSPELL_LIBS@
MOZ_HUNSPELL_CFLAGS = @MOZ_HUNSPELL_CFLAGS@
MOZ_NATIVE_LIBEVENT = @MOZ_NATIVE_LIBEVENT@
MOZ_LIBEVENT_LIBS = @MOZ_LIBEVENT_LIBS@
MOZ_LIBEVENT_INCLUDES = @MOZ_LIBEVENT_INCLUDES@
MOZ_NATIVE_LIBVPX = @MOZ_NATIVE_LIBVPX@
MOZ_LIBVPX_LIBS = @MOZ_LIBVPX_LIBS@
MOZ_LIBVPX_CFLAGS = @MOZ_LIBVPX_CFLAGS@
MOZ_NATIVE_ZLIB = @MOZ_NATIVE_ZLIB@
MOZ_NATIVE_BZ2 = @MOZ_NATIVE_BZ2@
MOZ_NATIVE_JPEG = @MOZ_NATIVE_JPEG@
MOZ_NATIVE_PNG = @MOZ_NATIVE_PNG@
MOZ_TREE_CAIRO = @MOZ_TREE_CAIRO@
MOZ_TREE_PIXMAN = @MOZ_TREE_PIXMAN@
MOZ_UPDATE_XTERM = @MOZ_UPDATE_XTERM@
MOZ_PERMISSIONS = @MOZ_PERMISSIONS@
MOZ_XTF = @MOZ_XTF@
MOZ_FLEXBOX = @MOZ_FLEXBOX@
MOZ_CAIRO_CFLAGS = @MOZ_CAIRO_CFLAGS@
MOZ_PIXMAN_CFLAGS = @MOZ_PIXMAN_CFLAGS@
MOZ_PREF_EXTENSIONS = @MOZ_PREF_EXTENSIONS@
MOZ_CAIRO_LIBS = @MOZ_CAIRO_LIBS@
MOZ_CAIRO_OSLIBS = @MOZ_CAIRO_OSLIBS@
MOZ_PIXMAN_LIBS = @MOZ_PIXMAN_LIBS@
MOZ_ENABLE_GNOMEUI = @MOZ_ENABLE_GNOMEUI@
MOZ_GNOMEUI_CFLAGS = @MOZ_GNOMEUI_CFLAGS@
MOZ_GNOMEUI_LIBS = @MOZ_GNOMEUI_LIBS@
MOZ_ENABLE_STARTUP_NOTIFICATION = @MOZ_ENABLE_STARTUP_NOTIFICATION@
MOZ_STARTUP_NOTIFICATION_CFLAGS = @MOZ_STARTUP_NOTIFICATION_CFLAGS@
MOZ_STARTUP_NOTIFICATION_LIBS = @MOZ_STARTUP_NOTIFICATION_LIBS@
MOZ_ENABLE_GNOMEVFS = @MOZ_ENABLE_GNOMEVFS@
MOZ_GNOMEVFS_CFLAGS = @MOZ_GNOMEVFS_CFLAGS@
MOZ_GNOMEVFS_LIBS = @MOZ_GNOMEVFS_LIBS@
MOZ_ENABLE_GCONF = @MOZ_ENABLE_GCONF@
MOZ_GCONF_CFLAGS = @MOZ_GCONF_CFLAGS@
MOZ_GCONF_LIBS = @MOZ_GCONF_LIBS@
MOZ_ENABLE_GNOME_COMPONENT = @MOZ_ENABLE_GNOME_COMPONENT@
MOZ_ENABLE_GIO = @MOZ_ENABLE_GIO@
MOZ_GIO_CFLAGS = @MOZ_GIO_CFLAGS@
MOZ_GIO_LIBS = @MOZ_GIO_LIBS@
MOZ_NATIVE_NSPR = @MOZ_NATIVE_NSPR@
MOZ_NATIVE_NSS = @MOZ_NATIVE_NSS@
MOZ_B2G_RIL = @MOZ_B2G_RIL@
MOZ_B2G_BT = @MOZ_B2G_BT@
MOZ_B2G_CAMERA = @MOZ_B2G_CAMERA@
MOZ_SYS_MSG = @MOZ_SYS_MSG@
MOZ_ASAN = @MOZ_ASAN@
MOZ_CFLAGS_NSS = @MOZ_CFLAGS_NSS@
MOZ_NO_WLZDEFS = @MOZ_NO_WLZDEFS@
BUILD_CTYPES = @BUILD_CTYPES@
COMPILE_ENVIRONMENT = @COMPILE_ENVIRONMENT@
CROSS_COMPILE = @CROSS_COMPILE@
WCHAR_CFLAGS = @WCHAR_CFLAGS@
OS_CPPFLAGS = @OS_CPPFLAGS@
OS_CFLAGS = @OS_CFLAGS@
OS_CXXFLAGS = @OS_CXXFLAGS@
OS_LDFLAGS = @OS_LDFLAGS@
OS_COMPILE_CFLAGS = @OS_COMPILE_CFLAGS@
OS_COMPILE_CXXFLAGS = @OS_COMPILE_CXXFLAGS@
OS_LIBS = @OS_LIBS@
ACDEFINES = @ACDEFINES@
WARNINGS_AS_ERRORS = @WARNINGS_AS_ERRORS@
MOZ_OPTIMIZE = @MOZ_OPTIMIZE@
MOZ_FRAMEPTR_FLAGS = @MOZ_FRAMEPTR_FLAGS@
MOZ_OPTIMIZE_FLAGS = @MOZ_OPTIMIZE_FLAGS@
MOZ_PGO_OPTIMIZE_FLAGS = @MOZ_PGO_OPTIMIZE_FLAGS@
MOZ_OPTIMIZE_LDFLAGS = @MOZ_OPTIMIZE_LDFLAGS@
MOZ_OPTIMIZE_SIZE_TWEAK = @MOZ_OPTIMIZE_SIZE_TWEAK@
MOZ_ALLOW_HEAP_EXECUTE_FLAGS = @MOZ_ALLOW_HEAP_EXECUTE_FLAGS@
PROFILE_GEN_CFLAGS = @PROFILE_GEN_CFLAGS@
PROFILE_GEN_LDFLAGS = @PROFILE_GEN_LDFLAGS@
PROFILE_USE_CFLAGS = @PROFILE_USE_CFLAGS@
PROFILE_USE_LDFLAGS = @PROFILE_USE_LDFLAGS@
XCFLAGS = @XCFLAGS@
XLDFLAGS = @XLDFLAGS@
XLIBS = @XLIBS@
XEXT_LIBS = @XEXT_LIBS@
XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@
XSS_LIBS = @XSS_LIBS@
MOZ_THUMB2 = @MOZ_THUMB2@
MOZ_EGL_XRENDER_COMPOSITE = @MOZ_EGL_XRENDER_COMPOSITE@
WIN_TOP_SRC = @WIN_TOP_SRC@
AR = @AR@
AR_FLAGS = @AR_FLAGS@
AR_EXTRACT = @AR_EXTRACT@
AR_LIST = @AR_LIST@
AR_DELETE = @AR_DELETE@
AS = @AS@
ASFLAGS = @ASFLAGS@
AS_DASH_C_FLAG = @AS_DASH_C_FLAG@
LD = @LD@
RC = @RC@
RCFLAGS = @RCFLAGS@
MC = @MC@
WINDRES = @WINDRES@
IMPLIB = @IMPLIB@
FILTER = @FILTER@
BIN_FLAGS = @BIN_FLAGS@
MIDL = @MIDL@
MIDL_FLAGS = @MIDL_FLAGS@
_MSC_VER = @_MSC_VER@
DLL_PREFIX = @DLL_PREFIX@
LIB_PREFIX = @LIB_PREFIX@
OBJ_SUFFIX = @OBJ_SUFFIX@
LIB_SUFFIX = @LIB_SUFFIX@
DLL_SUFFIX = @DLL_SUFFIX@
BIN_SUFFIX = @BIN_SUFFIX@
ASM_SUFFIX = @ASM_SUFFIX@
IMPORT_LIB_SUFFIX = @IMPORT_LIB_SUFFIX@
LIBS_DESC_SUFFIX = @LIBS_DESC_SUFFIX@
USE_N32 = @USE_N32@
HAVE_64BIT_OS = @HAVE_64BIT_OS@
CC = @CC@
CXX = @CXX@
CPP = @CPP@
TOOLCHAIN_PREFIX = @TOOLCHAIN_PREFIX@
CC_VERSION = @CC_VERSION@
CXX_VERSION = @CXX_VERSION@
GNU_AS = @GNU_AS@
GNU_LD = @GNU_LD@
GNU_CC = @GNU_CC@
GNU_CXX = @GNU_CXX@
INTEL_CC = @INTEL_CC@
INTEL_CXX = @INTEL_CXX@
STL_FLAGS = @STL_FLAGS@
WRAP_STL_INCLUDES = @WRAP_STL_INCLUDES@
MOZ_MSVC_STL_WRAP__Throw= @MOZ_MSVC_STL_WRAP__Throw@
MOZ_MSVC_STL_WRAP__RAISE= @MOZ_MSVC_STL_WRAP__RAISE@
HOST_CC = @HOST_CC@
HOST_CXX = @HOST_CXX@
HOST_CFLAGS = @HOST_CFLAGS@
HOST_CXXFLAGS = @HOST_CXXFLAGS@
HOST_LDFLAGS = @HOST_LDFLAGS@
HOST_OPTIMIZE_FLAGS = @HOST_OPTIMIZE_FLAGS@
HOST_NSPR_MDCPUCFG = @HOST_NSPR_MDCPUCFG@
HOST_AR = @HOST_AR@
HOST_AR_FLAGS = @HOST_AR_FLAGS@
HOST_LD = @HOST_LD@
HOST_RANLIB = @HOST_RANLIB@
HOST_BIN_SUFFIX = @HOST_BIN_SUFFIX@
HOST_OS_ARCH = @HOST_OS_ARCH@
host_cpu = @host_cpu@
host_vendor = @host_vendor@
host_os = @host_os@
TARGET_NSPR_MDCPUCFG = @TARGET_NSPR_MDCPUCFG@
TARGET_CPU = @TARGET_CPU@
TARGET_VENDOR = @TARGET_VENDOR@
TARGET_OS = @TARGET_OS@
TARGET_MD_ARCH = @TARGET_MD_ARCH@
TARGET_XPCOM_ABI = @TARGET_XPCOM_ABI@
AUTOCONF = @AUTOCONF@
GMAKE = @GMAKE@
PERL = @PERL@
PYTHON = @PYTHON@
RANLIB = @RANLIB@
OBJCOPY = @OBJCOPY@
UNZIP = @UNZIP@
ZIP = @ZIP@
XARGS = @XARGS@
STRIP = @STRIP@
DOXYGEN = @DOXYGEN@
PBBUILD_BIN = @PBBUILD_BIN@
SDP = @SDP@
NSINSTALL_BIN = @NSINSTALL_BIN@
WGET = @WGET@
RPMBUILD = @RPMBUILD@
MOZ_JPEG_CFLAGS = @MOZ_JPEG_CFLAGS@
MOZ_JPEG_LIBS = @MOZ_JPEG_LIBS@
MOZ_ZLIB_CFLAGS = @MOZ_ZLIB_CFLAGS@
MOZ_ZLIB_LIBS = @MOZ_ZLIB_LIBS@
MOZ_BZ2_CFLAGS = @MOZ_BZ2_CFLAGS@
MOZ_BZ2_LIBS = @MOZ_BZ2_LIBS@
MOZ_PNG_CFLAGS = @MOZ_PNG_CFLAGS@
MOZ_PNG_LIBS = @MOZ_PNG_LIBS@
QCMS_LIBS = @QCMS_LIBS@
MOZ_HARFBUZZ_LIBS = @MOZ_HARFBUZZ_LIBS@
MOZ_GRAPHITE_LIBS = @MOZ_GRAPHITE_LIBS@
MOZ_GRAPHITE = @MOZ_GRAPHITE@
MOZ_OTS_LIBS = @MOZ_OTS_LIBS@
MOZ_SKIA_LIBS = @MOZ_SKIA_LIBS@
MOZ_ENABLE_SKIA = @MOZ_ENABLE_SKIA@
MOZ_NATIVE_SQLITE = @MOZ_NATIVE_SQLITE@
SQLITE_CFLAGS = @SQLITE_CFLAGS@
SQLITE_LIBS = @SQLITE_LIBS@
NSPR_CONFIG = @NSPR_CONFIG@
NSPR_CFLAGS = @NSPR_CFLAGS@
NSPR_LIBS = @NSPR_LIBS@
NSS_CONFIG = @NSS_CONFIG@
NSS_CFLAGS = @NSS_CFLAGS@
NSS_LIBS = @NSS_LIBS@
NSS_DEP_LIBS = @NSS_DEP_LIBS@
NSS_DISABLE_DBM = @NSS_DISABLE_DBM@
XPCOM_GLUE_LDOPTS = @XPCOM_GLUE_LDOPTS@
XPCOM_STANDALONE_GLUE_LDOPTS = @XPCOM_STANDALONE_GLUE_LDOPTS@
XPCOM_STATICRUNTIME_GLUE_LDOPTS = @XPCOM_STATICRUNTIME_GLUE_LDOPTS@
XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS = @XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS@
USE_DEPENDENT_LIBS = @USE_DEPENDENT_LIBS@
# UNIX98 iconv support
LIBICONV = @LIBICONV@
# MKSHLIB_FORCE_ALL is used to force the linker to include all object
# files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker
# to normal behavior. Makefile's that create shared libraries out of
# archives use these flags to force in all of the .o files in the
# archives into the shared library.
WRAP_LDFLAGS = @WRAP_LDFLAGS@
DSO_CFLAGS = @DSO_CFLAGS@
DSO_PIC_CFLAGS = @DSO_PIC_CFLAGS@
MKSHLIB = @MKSHLIB@
MKCSHLIB = @MKCSHLIB@
MKSHLIB_FORCE_ALL = @MKSHLIB_FORCE_ALL@
MKSHLIB_UNFORCE_ALL = @MKSHLIB_UNFORCE_ALL@
DSO_LDOPTS = @DSO_LDOPTS@
DLL_SUFFIX = @DLL_SUFFIX@
NO_LD_ARCHIVE_FLAGS = @NO_LD_ARCHIVE_FLAGS@
GTK_CONFIG = @GTK_CONFIG@
TK_CFLAGS = @TK_CFLAGS@
TK_LIBS = @TK_LIBS@
CAIRO_FT_CFLAGS = @CAIRO_FT_CFLAGS@
MOZ_TREE_FREETYPE = @MOZ_TREE_FREETYPE@
MOZ_ENABLE_CAIRO_FT = @MOZ_ENABLE_CAIRO_FT@
MOZ_ENABLE_GTK2 = @MOZ_ENABLE_GTK2@
MOZ_ENABLE_QT = @MOZ_ENABLE_QT@
MOZ_ENABLE_XREMOTE = @MOZ_ENABLE_XREMOTE@
MOZ_ENABLE_DWRITE_FONT = @MOZ_ENABLE_DWRITE_FONT@
MOZ_ENABLE_D2D_SURFACE = @MOZ_ENABLE_D2D_SURFACE@
MOZ_ENABLE_D3D9_LAYER = @MOZ_ENABLE_D3D9_LAYER@
MOZ_ENABLE_D3D10_LAYER = @MOZ_ENABLE_D3D10_LAYER@
MOZ_METRO = @MOZ_METRO@
MAKEPRI = @MAKEPRI@
CRTDLLVERSION = @CRTDLLVERSION@
CRTEXPDLLVERSION = @CRTEXPDLLVERSION@
MOZ_GTK2_CFLAGS = @MOZ_GTK2_CFLAGS@
MOZ_GTK2_LIBS = @MOZ_GTK2_LIBS@
MOZ_QT_CFLAGS = @MOZ_QT_CFLAGS@
MOZ_QT_LIBS = @MOZ_QT_LIBS@
MOZ_ENABLE_QTNETWORK = @MOZ_ENABLE_QTNETWORK@
MOZ_ENABLE_QMSYSTEM2 = @MOZ_ENABLE_QMSYSTEM2@
MOZ_ENABLE_QTMOBILITY = @MOZ_ENABLE_QTMOBILITY@
MOZ_ENABLE_CONTENTACTION = @MOZ_ENABLE_CONTENTACTION@
MOZ_ENABLE_MEEGOTOUCHSHARE = @MOZ_ENABLE_MEEGOTOUCHSHARE@
MOZ_ENABLE_CONTENTMANAGER = @MOZ_ENABLE_CONTENTMANAGER@
MOZ_DBUS_CFLAGS = @MOZ_DBUS_CFLAGS@
MOZ_DBUS_LIBS = @MOZ_DBUS_LIBS@
MOZ_DBUS_GLIB_CFLAGS = @MOZ_DBUS_GLIB_CFLAGS@
MOZ_DBUS_GLIB_LIBS = @MOZ_DBUS_GLIB_LIBS@
MOZ_ENABLE_DBUS = @MOZ_ENABLE_DBUS@
MOZ_GTHREAD_CFLAGS = @MOZ_GTHREAD_CFLAGS@
MOZ_GTHREAD_LIBS = @MOZ_GTHREAD_LIBS@
FT2_CFLAGS = @FT2_CFLAGS@
FT2_LIBS = @FT2_LIBS@
MOZ_PANGO_CFLAGS = @MOZ_PANGO_CFLAGS@
MOZ_PANGO_LIBS = @MOZ_PANGO_LIBS@
XT_LIBS = @XT_LIBS@
MOZ_LIBPROXY_CFLAGS = @MOZ_LIBPROXY_CFLAGS@
MOZ_LIBPROXY_LIBS = @MOZ_LIBPROXY_LIBS@
MOZ_ENABLE_LIBPROXY = @MOZ_ENABLE_LIBPROXY@
MOZ_LIBNOTIFY_CFLAGS = @MOZ_LIBNOTIFY_CFLAGS@
MOZ_LIBNOTIFY_LIBS = @MOZ_LIBNOTIFY_LIBS@
MOZ_ENABLE_LIBNOTIFY = @MOZ_ENABLE_LIBNOTIFY@
MOZ_ALSA_LIBS = @MOZ_ALSA_LIBS@
MOZ_ALSA_CFLAGS = @MOZ_ALSA_CFLAGS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_LIBS = @GLIB_LIBS@
GLIB_GMODULE_LIBS = @GLIB_GMODULE_LIBS@
MOZ_NATIVE_MAKEDEPEND = @MOZ_NATIVE_MAKEDEPEND@
CL_INCLUDES_PREFIX = @CL_INCLUDES_PREFIX@
MOZ_AUTO_DEPS = @MOZ_AUTO_DEPS@
COMPILER_DEPEND = @COMPILER_DEPEND@
MDDEPDIR := @MDDEPDIR@
CC_WRAPPER = @CC_WRAPPER@
CXX_WRAPPER = @CXX_WRAPPER@
MOZ_DEMANGLE_SYMBOLS = @MOZ_DEMANGLE_SYMBOLS@
OS_TARGET=@OS_TARGET@
OS_ARCH=@OS_ARCH@
OS_RELEASE=@OS_RELEASE@
OS_TEST=@OS_TEST@
CPU_ARCH=@CPU_ARCH@
INTEL_ARCHITECTURE=@INTEL_ARCHITECTURE@
# For Solaris build
SOLARIS_SUNPRO_CC = @SOLARIS_SUNPRO_CC@
SOLARIS_SUNPRO_CXX = @SOLARIS_SUNPRO_CXX@
# For AIX build
AIX_OBJMODEL = @AIX_OBJMODEL@
# For OS/2 build
MOZ_OS2_TOOLS = @MOZ_OS2_TOOLS@
MOZ_OS2_HIGH_MEMORY = @MOZ_OS2_HIGH_MEMORY@
MOZ_PSM=@MOZ_PSM@
MOZILLA_OFFICIAL = @MOZILLA_OFFICIAL@
# Win32 options
MOZ_BROWSE_INFO = @MOZ_BROWSE_INFO@
MOZ_TOOLS_DIR = @MOZ_TOOLS_DIR@
MSMANIFEST_TOOL = @MSMANIFEST_TOOL@
WIN32_REDIST_DIR = @WIN32_REDIST_DIR@
MOZ_GLUE_LDFLAGS = @MOZ_GLUE_LDFLAGS@
MOZ_GLUE_PROGRAM_LDFLAGS = @MOZ_GLUE_PROGRAM_LDFLAGS@
WIN32_CRT_LIBS = @WIN32_CRT_LIBS@
# This is used to pass jemalloc flags to NSS
DLLFLAGS = @DLLFLAGS@
# Codesighs tools option, enables win32 mapfiles.
MOZ_MAPINFO = @MOZ_MAPINFO@
MOZ_PHOENIX = @MOZ_PHOENIX@
MOZ_XULRUNNER = @MOZ_XULRUNNER@
MOZ_DISTRIBUTION_ID = @MOZ_DISTRIBUTION_ID@
MOZ_PLATFORM_MAEMO = @MOZ_PLATFORM_MAEMO@
MOZ_PLATFORM_MAEMO_CFLAGS = @MOZ_PLATFORM_MAEMO_CFLAGS@
MOZ_PLATFORM_MAEMO_LIBS = @MOZ_PLATFORM_MAEMO_LIBS@
MOZ_MAEMO_LIBLOCATION = @MOZ_MAEMO_LIBLOCATION@
MOZ_ENABLE_LIBCONIC = @MOZ_ENABLE_LIBCONIC@
LIBCONIC_CFLAGS = @LIBCONIC_CFLAGS@
LIBCONIC_LIBS = @LIBCONIC_LIBS@
GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@
GSTREAMER_LIBS = @GSTREAMER_LIBS@
MACOS_SDK_DIR = @MACOS_SDK_DIR@
NEXT_ROOT = @NEXT_ROOT@
GCC_VERSION = @GCC_VERSION@
UNIVERSAL_BINARY= @UNIVERSAL_BINARY@
MOZ_CAN_RUN_PROGRAMS = @MOZ_CAN_RUN_PROGRAMS@
HAVE_DTRACE= @HAVE_DTRACE@
VISIBILITY_FLAGS = @VISIBILITY_FLAGS@
WRAP_SYSTEM_INCLUDES = @WRAP_SYSTEM_INCLUDES@
HAVE_ARM_SIMD = @HAVE_ARM_SIMD@
HAVE_ARM_NEON = @HAVE_ARM_NEON@
HAVE_GCC_ALIGN_ARG_POINTER = @HAVE_GCC_ALIGN_ARG_POINTER@
HAVE_COMPILER_FLAG_MSSSE3 = @HAVE_COMPILER_FLAG_MSSSE3@
MOZ_THEME_FASTSTRIPE = @MOZ_THEME_FASTSTRIPE@
MOZ_SERVICES_AITC = @MOZ_SERVICES_AITC@
MOZ_SERVICES_NOTIFICATIONS = @MOZ_SERVICES_NOTIFICATIONS@
MOZ_SERVICES_SYNC = @MOZ_SERVICES_SYNC@
MOZ_WEBAPP_RUNTIME = @MOZ_WEBAPP_RUNTIME@
MOZ_OFFICIAL_BRANDING = @MOZ_OFFICIAL_BRANDING@
HAVE_CLOCK_MONOTONIC = @HAVE_CLOCK_MONOTONIC@
REALTIME_LIBS = @REALTIME_LIBS@
MOZ_APP_COMPONENT_LIBS = @MOZ_APP_COMPONENT_LIBS@
MOZ_APP_EXTRA_LIBS = @MOZ_APP_EXTRA_LIBS@
ANDROID_NDK = @ANDROID_NDK@
ANDROID_TOOLCHAIN = @ANDROID_TOOLCHAIN@
ANDROID_PLATFORM = @ANDROID_PLATFORM@
ANDROID_SDK = @ANDROID_SDK@
ANDROID_PLATFORM_TOOLS = @ANDROID_PLATFORM_TOOLS@
ANDROID_VERSION = @ANDROID_VERSION@
ANDROID_SOURCE = @ANDROID_SOURCE@
STLPORT_SOURCES = @STLPORT_SOURCES@
ANDROID_PACKAGE_NAME = @ANDROID_PACKAGE_NAME@
JS_SHARED_LIBRARY = @JS_SHARED_LIBRARY@
MOZ_INSTRUMENT_EVENT_LOOP = @MOZ_INSTRUMENT_EVENT_LOOP@
MOZ_SYSTEM_PLY = @MOZ_SYSTEM_PLY@
MOZ_PACKAGE_JSSHELL = @MOZ_PACKAGE_JSSHELL@
MOZ_LINKER_EXTRACT = @MOZ_LINKER_EXTRACT@
MOZ_PER_WINDOW_PRIVATE_BROWSING = @MOZ_PER_WINDOW_PRIVATE_BROWSING@
@ALLSUBSTS@
include $(topsrcdir)/config/baseconfig.mk

Просмотреть файл

@ -57,14 +57,17 @@ mkdir_deps =$(foreach dir,$(getargv),$(call slash_strip,$(dir)/.mkdir.done))
%/.mkdir.done: # mkdir -p -p => mkdir -p
$(subst $(space)-p,$(null),$(MKDIR)) -p $(dir $@)
@$(TOUCH) $@
# Make the timestamp old enough for not being a problem with symbolic links
# targets depending on it. Use Jan 3, 1970 to accomodate any timezone where
# 197001010000 would translate to something older than epoch.
@touch -t 197001030000 $@
# A handful of makefiles are attempting "mkdir dot". Likely not intended
# or stale logic so add a stub target to handle the request and warn for now.
.mkdir.done:
ifndef NOWARN_AUTOTARGETS # {
@echo "WARNING: $(MKDIR) -dot- requested by $(MAKE) -C $(CURDIR) $(MAKECMDGOALS)"
@$(TOUCH) $@
@touch -t 197001030000 $@
endif #}
INCLUDED_AUTOTARGETS_MK = 1

Просмотреть файл

@ -32,7 +32,7 @@ ifdef SDK_HEADERS
EXPORTS += $(SDK_HEADERS)
endif
REPORT_BUILD = @echo $(notdir $<)
REPORT_BUILD = $(info $(notdir $<))
ifeq ($(OS_ARCH),OS2)
EXEC =
@ -45,12 +45,18 @@ ifdef SYSTEM_LIBXUL
SKIP_COPY_XULRUNNER=1
endif
# ELOG prints out failed command when building silently (gmake -s).
# ELOG prints out failed command when building silently (gmake -s). Pymake
# prints out failed commands anyway, so ELOG just makes things worse by
# forcing shell invocations.
ifndef .PYMAKE
ifneq (,$(findstring s, $(filter-out --%, $(MAKEFLAGS))))
ELOG := $(EXEC) sh $(BUILD_TOOLS)/print-failed-commands.sh
else
ELOG :=
endif
endif # -s
else
ELOG :=
endif # ifndef .PYMAKE
_VPATH_SRCS = $(abspath $<)
@ -101,7 +107,7 @@ ifdef CPP_UNIT_TESTS
CPPSRCS += $(CPP_UNIT_TESTS)
SIMPLE_PROGRAMS += $(CPP_UNIT_TESTS:.cpp=$(BIN_SUFFIX))
INCLUDES += -I$(DIST)/include/testing
LIBS += $(XPCOM_GLUE_LDOPTS) $(NSPR_LIBS) $(MOZ_JS_LIBS)
LIBS += $(XPCOM_GLUE_LDOPTS) $(NSPR_LIBS) $(MOZ_JS_LIBS) $(if $(JS_SHARED_LIBRARY),,$(MOZ_ZLIB_LIBS))
# ...and run them the usual way
check::
@ -336,8 +342,8 @@ XPIDL_GEN_DIR = _xpidlgen
ifdef MOZ_UPDATE_XTERM
# Its good not to have a newline at the end of the titlebar string because it
# makes the make -s output easier to read. Echo -n does not work on all
# platforms, but we can trick sed into doing it.
UPDATE_TITLE = sed -e "s!Y!$(1) in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(2)!" $(MOZILLA_DIR)/config/xterm.str;
# platforms, but we can trick printf into doing it.
UPDATE_TITLE = printf "\033]0;%s in %s\007" $(1) $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$(2) ;
endif
define SUBMAKE # $(call SUBMAKE,target,directory)
@ -1226,17 +1232,9 @@ PREF_PPFLAGS = --line-endings=crlf
endif
ifndef NO_DIST_INSTALL
$(FINAL_TARGET)/$(PREF_DIR):
$(NSINSTALL) -D $@
libs:: $(FINAL_TARGET)/$(PREF_DIR)
libs:: $(PREF_JS_EXPORTS)
$(EXIT_ON_ERROR) \
for i in $^; do \
dest=$(FINAL_TARGET)/$(PREF_DIR)/`basename $$i`; \
$(RM) -f $$dest; \
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \
done
PREF_JS_EXPORTS_PATH := $(FINAL_TARGET)/$(PREF_DIR)
PREF_JS_EXPORTS_FLAGS := $(PREF_PPFLAGS)
PP_TARGETS += PREF_JS_EXPORTS
endif
endif
@ -1316,6 +1314,7 @@ libs:: $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt
ifndef NO_DIST_INSTALL
$(call install_cmd,$(IFLAGS1) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $(FINAL_TARGET)/components)
ifndef NO_INTERFACES_MANIFEST
libs:: $(call mkdir_deps,$(FINAL_TARGET)/components)
@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/components/interfaces.manifest "interfaces $(XPIDL_MODULE).xpt"
@$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/chrome.manifest "manifest components/interfaces.manifest"
endif
@ -1366,22 +1365,15 @@ endif
endif
ifdef EXTRA_PP_COMPONENTS
libs:: $(EXTRA_PP_COMPONENTS)
ifndef NO_DIST_INSTALL
$(EXIT_ON_ERROR) \
$(NSINSTALL) -D $(FINAL_TARGET)/components; \
for i in $^; do \
fname=`basename $$i`; \
dest=$(FINAL_TARGET)/components/$${fname}; \
$(RM) -f $$dest; \
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \
done
EXTRA_PP_COMPONENTS_PATH := $(FINAL_TARGET)/components
PP_TARGETS += EXTRA_PP_COMPONENTS
endif
endif
EXTRA_MANIFESTS = $(filter %.manifest,$(EXTRA_COMPONENTS) $(EXTRA_PP_COMPONENTS))
ifneq (,$(EXTRA_MANIFESTS))
libs::
libs:: $(call mkdir_deps,$(FINAL_TARGET))
$(PYTHON) $(MOZILLA_DIR)/config/buildlist.py $(FINAL_TARGET)/chrome.manifest $(patsubst %,"manifest components/%",$(notdir $(EXTRA_MANIFESTS)))
endif
@ -1399,17 +1391,10 @@ endif
endif
ifdef EXTRA_PP_JS_MODULES
libs:: $(EXTRA_PP_JS_MODULES)
ifndef NO_DIST_INSTALL
$(EXIT_ON_ERROR) \
$(NSINSTALL) -D $(JS_MODULES_PATH); \
for i in $^; do \
dest=$(JS_MODULES_PATH)/`basename $$i`; \
$(RM) -f $$dest; \
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \
done
EXTRA_PP_JS_MODULES_PATH := $(JS_MODULES_PATH)
PP_TARGETS += EXTRA_PP_JS_MODULES
endif
endif
################################################################################
@ -1480,31 +1465,15 @@ endif
endif
ifneq ($(DIST_FILES),)
$(DIST)/bin:
$(NSINSTALL) -D $@
libs:: $(DIST)/bin
libs:: $(DIST_FILES)
@$(EXIT_ON_ERROR) \
for f in $^; do \
dest=$(FINAL_TARGET)/`basename $$f`; \
$(RM) -f $$dest; \
$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py \
$(XULAPP_DEFINES) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \
$$f > $$dest; \
done
DIST_FILES_PATH := $(FINAL_TARGET)
DIST_FILES_FLAGS := $(XULAPP_DEFINES)
PP_TARGETS += DIST_FILES
endif
ifneq ($(DIST_CHROME_FILES),)
libs:: $(DIST_CHROME_FILES)
@$(EXIT_ON_ERROR) \
for f in $^; do \
dest=$(FINAL_TARGET)/chrome/`basename $$f`; \
$(RM) -f $$dest; \
$(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py \
$(XULAPP_DEFINES) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \
$$f > $$dest; \
done
DIST_CHROME_FILES_PATH := $(FINAL_TARGET)/chrome
DIST_CHROME_FILES_FLAGS := $(XULAPP_DEFINES)
PP_TARGETS += DIST_CHROME_FILES
endif
ifneq ($(XPI_PKGNAME),)
@ -1662,6 +1631,58 @@ TAGS:: $(CSRCS) $(CPPSRCS) $(HEADERS)
endif
endif
################################################################################
# Install/copy rules
#
# The INSTALL_TARGETS variable contains a list of all install target
# categories. Each category defines a list of files, an install destination,
# and whether the files are executables or not.
#
# FOO_FILES := foo bar
# FOO_EXECUTABLES := baz
# FOO_DEST := target_path
# INSTALL_TARGETS += FOO
define install_file_template
libs:: $(2)/$(notdir $(1))
$(2)/$(notdir $(1)): $(1) $$(call mkdir_deps,$(2))
$(INSTALL) $(3) $$< $${@D}
endef
$(foreach category,$(INSTALL_TARGETS),\
$(if $($(category)_DEST),,$(error Missing $(category)_DEST))\
$(foreach file,$($(category)_FILES),\
$(eval $(call install_file_template,$(file),$($(category)_DEST),$(IFLAGS1)))\
)\
$(foreach file,$($(category)_EXECUTABLES),\
$(eval $(call install_file_template,$(file),$($(category)_DEST),$(IFLAGS2)))\
)\
)
################################################################################
# Preprocessing rules
#
# The PP_TARGETS variable contains a list of all preprocessing target
# categories. Each category defines a target path, and optional extra flags
# like the following:
#
# FOO_PATH := target_path
# FOO_FLAGS := -Dsome_flag
# PP_TARGETS += FOO
# preprocess_file_template defines preprocessing rules.
# $(call preprocess_file_template, source_file, target_path, extra_flags)
define preprocess_file_template
$(2)/$(notdir $(1)): $(1) $$(call mkdir_deps,$(2)) $$(GLOBAL_DEPS)
$$(RM) $$@
$$(PYTHON) $$(topsrcdir)/config/Preprocessor.py $(3) $$(DEFINES) $$(ACDEFINES) $$(XULPPFLAGS) $$< > $$@
libs:: $(2)/$(notdir $(1))
endef
$(foreach category,$(PP_TARGETS),\
$(foreach file,$($(category)),\
$(eval $(call preprocess_file_template,$(file),$($(category)_PATH),$($(category)_FLAGS)))\
)\
)
################################################################################
# Special gmake rules.
################################################################################
@ -1761,4 +1782,3 @@ include $(topsrcdir)/config/makefiles/autotargets.mk
ifneq ($(NULL),$(AUTO_DEPS))
default all libs tools export:: $(AUTO_DEPS)
endif

Просмотреть файл

@ -1 +0,0 @@
]0;gmake: Y

Просмотреть файл

@ -195,10 +195,10 @@ if test -n "$gonkdir" ; then
CPPFLAGS="-DANDROID -isystem $gonkdir/bionic/libc/$ARCH_DIR/include -isystem $gonkdir/bionic/libc/include/ -isystem $gonkdir/bionic/libc/kernel/common -isystem $gonkdir/bionic/libc/kernel/$ARCH_DIR -isystem $gonkdir/bionic/libm/include -I$gonkdir/frameworks/base/opengl/include -I$gonkdir/frameworks/base/native/include -I$gonkdir/hardware/libhardware/include -I$gonkdir/hardware/libhardware_legacy/include -I$gonkdir/system -I$gonkdir/system/core/include -isystem $gonkdir/bionic -I$gonkdir/frameworks/base/include -I$gonkdir/external/dbus $CPPFLAGS -I$gonkdir/frameworks/base/services/sensorservice -I$gonkdir/frameworks/base/services/camera"
CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions $CXXFLAGS $STLPORT_CPPFLAGS"
LIBS="$LIBS $STLPORT_LIBS"
dnl Add -llog by default, since we use it all over the place.
LDFLAGS="-mandroid -L$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib -Wl,-rpath-link=$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib --sysroot=$gonkdir/out/target/product/$GONK_PRODUCT/obj/ -llog $LDFLAGS"
LIBS="$LIBS -llog $STLPORT_LIBS"
LDFLAGS="-mandroid -L$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib -Wl,-rpath-link=$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib --sysroot=$gonkdir/out/target/product/$GONK_PRODUCT/obj/ $LDFLAGS"
dnl prevent cross compile section from using these flags as host flags
if test -z "$HOST_CPPFLAGS" ; then
@ -1993,16 +1993,6 @@ case "$target" in
MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
;;
*-freebsd*)
if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
DLL_SUFFIX=".so.1.0"
DSO_LDOPTS="-shared"
fi
if test ! "$GNU_CC"; then
DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
fi
;;
ia64*-hpux*)
DLL_SUFFIX=".so"
if test ! "$GNU_CC"; then
@ -3194,11 +3184,9 @@ then
*-*-freebsd*)
AC_DEFINE(_REENTRANT)
AC_DEFINE(_THREAD_SAFE)
dnl -pthread links in -lc_r, so don't specify it explicitly.
dnl -pthread links in -lpthread, so don't specify it explicitly.
if test "$ac_cv_have_dash_pthread" = "yes"; then
_PTHREAD_LDFLAGS="-pthread"
else
_PTHREAD_LDFLAGS="-lc_r"
fi
;;
@ -4800,13 +4788,13 @@ if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
then
AC_SUBST(MOZ_PANGO)
PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION)
AC_SUBST(MOZ_PANGO_CFLAGS)
AC_SUBST(MOZ_PANGO_LIBS)
if test "$MOZ_PANGO"
then
PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION)
AC_SUBST(MOZ_PANGO_CFLAGS)
AC_SUBST(MOZ_PANGO_LIBS)
AC_DEFINE(MOZ_PANGO)
else
PKG_CHECK_MODULES(FT2, freetype2 > 6.1.0)
@ -6970,7 +6958,11 @@ else
*-android*|*-linuxandroid*)
AC_DEFINE(MOZ_MEMORY_LINUX)
AC_DEFINE(MOZ_MEMORY_ANDROID)
_WRAP_MALLOC=1
if test -z "$gonkdir"; then
_WRAP_MALLOC=1
else
AC_DEFINE(MOZ_MEMORY_GONK)
fi
MOZ_GLUE_LDFLAGS=
;;
*-*linux*)
@ -7788,17 +7780,6 @@ MOZ_ENABLE_SKIA=1,
MOZ_ENABLE_SKIA=)
if test "$USE_FC_FREETYPE"; then
PKG_CHECK_MODULES(_FONTCONFIG, fontconfig,
[
if test "$MOZ_PANGO"; then
MOZ_PANGO_CFLAGS="$MOZ_PANGO_CFLAGS $_FONTCONFIG_CFLAGS"
MOZ_PANGO_LIBS="$MOZ_PANGO_LIBS $_FONTCONFIG_LIBS"
else
FT2_CFLAGS="$FT2_CFLAGS $_FONTCONFIG_CFLAGS"
FT2_LIBS="$FT2_LIBS $_FONTCONFIG_LIBS"
fi
])
if test "$COMPILE_ENVIRONMENT"; then
dnl ========================================================
dnl = Check for freetype2 and its functionality
@ -7843,6 +7824,17 @@ if test "$USE_FC_FREETYPE"; then
else
AC_DEFINE(HAVE_FONTCONFIG_FCFREETYPE_H)
fi
PKG_CHECK_MODULES(_FONTCONFIG, fontconfig,
[
if test "$MOZ_PANGO"; then
MOZ_PANGO_CFLAGS="$MOZ_PANGO_CFLAGS $_FONTCONFIG_CFLAGS"
MOZ_PANGO_LIBS="$MOZ_PANGO_LIBS $_FONTCONFIG_LIBS"
else
FT2_CFLAGS="$FT2_CFLAGS $_FONTCONFIG_CFLAGS"
FT2_LIBS="$FT2_LIBS $_FONTCONFIG_LIBS"
fi
])
fi
dnl ========================================================
@ -8990,7 +8982,6 @@ if test -z "$MOZ_NATIVE_NSPR"; then
fi
ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
ac_configure_args="$ac_configure_args --prefix=$dist"
ac_configure_args="$ac_configure_args --with-sync-build-files=$_topsrcdir"
if test "$MOZ_MEMORY"; then
ac_configure_args="$ac_configure_args --enable-jemalloc"
fi

Просмотреть файл

@ -110,6 +110,6 @@ load 715056.html
load 741163-1.html
load 766426.html
load 771639.html
asserts(0-1) load 752226-1.html
asserts(0-1) load 752226-2.html
load 752226-1.html
load 752226-2.html
HTTP(..) load xhr_abortinprogress.html

Просмотреть файл

@ -7,13 +7,15 @@
#ifndef mozilla_dom_Element_h__
#define mozilla_dom_Element_h__
#include "mozilla/dom/FragmentOrElement.h"
#include "nsEventStates.h"
#include "mozilla/dom/FragmentOrElement.h" // for base class
#include "nsChangeHint.h" // for enum
#include "nsEventStates.h" // for member
class nsEventStateManager;
class nsGlobalWindow;
class nsFocusManager;
class nsGlobalWindow;
class nsICSSDeclaration;
class nsISMILAttr;
// Element-specific flags
enum {

Просмотреть файл

@ -12,50 +12,29 @@
#ifndef FragmentOrElement_h___
#define FragmentOrElement_h___
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"
#include "nsIContent.h"
#include "nsIDOMElement.h"
#include "nsIDOMDocumentFragment.h"
#include "nsILinkHandler.h"
#include "nsNodeUtils.h"
#include "nsAttrAndChildArray.h"
#include "mozFlushType.h"
#include "nsDOMAttributeMap.h"
#include "nsIWeakReference.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIDocument.h"
#include "nsIDOMNodeSelector.h"
#include "nsIDOMXPathNSResolver.h"
#include "nsPresContext.h"
#include "nsIDOMDOMStringMap.h"
#include "nsContentList.h"
#include "nsDOMClassInfoID.h" // DOMCI_DATA
#include "nsIDOMTouchEvent.h"
#include "nsIInlineEventHandlers.h"
#include "mozilla/CORSMode.h"
#include "mozilla/Attributes.h"
#include "nsAttrAndChildArray.h" // member
#include "nsCOMPtr.h" // member
#include "nsCycleCollectionParticipant.h" // NS_DECL_CYCLE_*
#include "nsIContent.h" // base class
#include "nsIDOMNodeSelector.h" // base class
#include "nsIDOMTouchEvent.h" // base class (nsITouchEventReceiver)
#include "nsIDOMXPathNSResolver.h" // base class
#include "nsIInlineEventHandlers.h" // base class
#include "nsINodeList.h" // base class
#include "nsIWeakReference.h" // base class
#include "nsNodeUtils.h" // class member nsNodeUtils::CloneNodeImpl
#include "nsISMILAttr.h"
class nsIDOMAttr;
class nsIDOMEventListener;
class nsIFrame;
class nsIDOMNamedNodeMap;
class nsICSSDeclaration;
class nsIDOMCSSStyleDeclaration;
class nsIURI;
class nsINodeInfo;
class nsIControllers;
class nsEventListenerManager;
class nsIScrollableFrame;
class nsAttrValueOrString;
class nsContentList;
class nsDOMTokenList;
class ContentUnbinder;
struct nsRect;
typedef PRUptrdiff PtrBits;
class nsContentList;
class nsDOMAttributeMap;
class nsDOMTokenList;
class nsIControllers;
class nsICSSDeclaration;
class nsIDocument;
class nsIDOMDOMStringMap;
class nsIDOMNamedNodeMap;
class nsINodeInfo;
class nsIURI;
/**
* Class that implements the nsIDOMNodeList interface (a list of children of

Просмотреть файл

@ -5,33 +5,22 @@
#ifndef nsIContent_h___
#define nsIContent_h___
#include "nsCOMPtr.h" // for already_AddRefed
#include "nsStringGlue.h"
#include "nsCaseTreatment.h"
#include "nsChangeHint.h"
#include "nsINode.h"
#include "nsIDocument.h" // for IsInHTMLDocument
#include "nsCSSProperty.h"
#include "nsCaseTreatment.h" // for enum, cannot be forward-declared
#include "nsCOMPtr.h" // for already_AddRefed in constructor
#include "nsIDocument.h" // for use in inline function (IsInHTMLDocument)
#include "nsINode.h" // for base class
// Forward declarations
class nsAString;
class nsIAtom;
class nsIDOMEvent;
class nsIContent;
class nsEventListenerManager;
class nsIURI;
class nsRuleWalker;
class nsAttrValue;
class nsAttrName;
class nsTextFragment;
class nsIDocShell;
class nsIFrame;
class nsISMILAttr;
class nsIDOMCSSStyleDeclaration;
namespace mozilla {
namespace css {
class StyleRule;
} // namespace css
namespace widget {
struct IMEState;
} // namespace widget

Просмотреть файл

@ -5,80 +5,65 @@
#ifndef nsIDocument_h___
#define nsIDocument_h___
#include "nsINode.h"
#include "nsStringGlue.h"
#include "nsIDocumentObserver.h" // for nsUpdateType
#include "nsCOMPtr.h"
#include "nsCOMArray.h"
#include "nsIURI.h"
#include "nsILoadGroup.h"
#include "nsCRT.h"
#include "mozFlushType.h"
#include "nsIAtom.h"
#include "nsCompatibility.h"
#include "nsTObserverArray.h"
#include "nsTHashtable.h"
#include "nsHashKeys.h"
#include "nsIVariant.h"
#include "nsIObserver.h"
#include "nsGkAtoms.h"
#include "nsAutoPtr.h"
#include "nsPIDOMWindow.h"
#include "nsSMILAnimationController.h"
#include "nsIScriptGlobalObject.h"
#include "nsIDocumentEncoder.h"
#include "nsIFrameRequestCallback.h"
#include "nsEventStates.h"
#include "nsIStructuredCloneContainer.h"
#include "nsILoadContext.h"
#include "mozFlushType.h" // for enum
#include "nsAutoPtr.h" // for member
#include "nsCOMArray.h" // for member
#include "nsCRT.h" // for NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
#include "nsCompatibility.h" // for member
#include "nsCOMPtr.h" // for member
#include "nsGkAtoms.h" // for static class members
#include "nsIDocumentEncoder.h" // for member (in nsCOMPtr)
#include "nsIDocumentObserver.h" // for typedef (nsUpdateType)
#include "nsIFrameRequestCallback.h" // for member (in nsCOMPtr)
#include "nsILoadContext.h" // for member (in nsCOMPtr)
#include "nsILoadGroup.h" // for member (in nsCOMPtr)
#include "nsINode.h" // for base class
#include "nsIScriptGlobalObject.h" // for member (in nsCOMPtr)
#include "nsIStructuredCloneContainer.h" // for member (in nsCOMPtr)
#include "nsPIDOMWindow.h" // for use in inline functions
#include "nsPropertyTable.h" // for member
#include "nsTHashtable.h" // for member
class nsIRequest;
class nsPIDOMWindow;
class nsIStreamListener;
class nsIBFCacheEntry;
class nsIContent;
class nsPresContext;
class nsIPresShell;
class nsIDocShell;
class nsStyleSet;
class nsIStyleSheet;
class nsIStyleRule;
class nsCSSStyleSheet;
class nsIViewManager;
class nsIDOMEvent;
class nsIDOMEventTarget;
class nsDeviceContext;
class nsIParser;
class nsIDOMNode;
class nsIDOMElement;
class nsIDOMDocumentFragment;
class nsILineBreaker;
class nsIWordBreaker;
class nsISelection;
class nsIChannel;
class nsIPrincipal;
class nsIDOMDocument;
class nsIDOMDocumentType;
class nsScriptLoader;
class nsIContentSink;
class nsHTMLStyleSheet;
class nsHTMLCSSStyleSheet;
class nsILayoutHistoryState;
class nsIVariant;
class nsIDOMUserDataHandler;
template<class E> class nsCOMArray;
class nsIDocumentObserver;
class nsBindingManager;
class nsIDOMNodeList;
class mozAutoSubtreeModified;
struct JSObject;
class nsFrameLoader;
class nsIBoxObject;
class imgIRequest;
class nsISHEntry;
class nsAString;
class nsBindingManager;
class nsCSSStyleSheet;
class nsDOMNavigationTiming;
class nsWindowSizes;
class nsEventStates;
class nsFrameLoader;
class nsHTMLCSSStyleSheet;
class nsHTMLStyleSheet;
class nsIAtom;
class nsIBFCacheEntry;
class nsIBoxObject;
class nsIChannel;
class nsIContent;
class nsIContentSink;
class nsIDocShell;
class nsIDocumentObserver;
class nsIDOMDocument;
class nsIDOMDocumentFragment;
class nsIDOMDocumentType;
class nsIDOMElement;
class nsIDOMEventTarget;
class nsIDOMNodeList;
class nsILayoutHistoryState;
class nsIObjectLoadingContent;
class nsIObserver;
class nsIPresShell;
class nsIPrincipal;
class nsIRequest;
class nsIStreamListener;
class nsIStyleRule;
class nsIStyleSheet;
class nsIURI;
class nsIVariant;
class nsIViewManager;
class nsPresContext;
class nsScriptLoader;
class nsSMILAnimationController;
class nsStyleSet;
class nsWindowSizes;
namespace mozilla {
namespace css {

Просмотреть файл

@ -6,20 +6,16 @@
#ifndef nsINode_h___
#define nsINode_h___
#include "nsIDOMEventTarget.h"
#include "nsEvent.h"
#include "nsPropertyTable.h"
#include "nsTObserverArray.h"
#include "nsINodeInfo.h"
#include "nsCOMPtr.h"
#include "nsWrapperCache.h"
#include "nsIProgrammingLanguage.h" // for ::JAVASCRIPT
#include "nsDOMError.h"
#include "nsDOMString.h"
#include "jspubtd.h"
#include "nsWindowMemoryReporter.h"
#include "nsIVariant.h"
#include "nsGkAtoms.h"
#include "nsCOMPtr.h" // for member, local
#include "nsGkAtoms.h" // for nsGkAtoms::baseURIProperty
#include "nsIDOMEventTarget.h" // for base class
#include "nsINodeInfo.h" // member (in nsCOMPtr)
#include "nsIVariant.h" // for use in GetUserData()
#include "nsNodeInfoManager.h" // for use in NodePrincipal()
#include "nsPropertyTable.h" // for typedefs
#include "nsTObserverArray.h" // for member
#include "nsWindowMemoryReporter.h" // for NS_DECL_SIZEOF_EXCLUDING_THIS
#include "nsWrapperCache.h" // for base class
// Including 'windows.h' will #define GetClassInfo to something else.
#ifdef XP_WIN
@ -28,26 +24,23 @@
#endif
#endif
class nsAttrAndChildArray;
class nsChildContentList;
class nsIContent;
class nsIDocument;
class nsIDOMEvent;
class nsIDOMNode;
class nsIDOMElement;
class nsIDOMNode;
class nsIDOMNodeList;
class nsIDOMUserDataHandler;
class nsIEditor;
class nsIFrame;
class nsIMutationObserver;
class nsINodeList;
class nsIPresShell;
class nsEventChainVisitor;
class nsEventChainPreVisitor;
class nsEventChainPostVisitor;
class nsEventListenerManager;
class nsIPrincipal;
class nsIMutationObserver;
class nsChildContentList;
class nsNodeWeakReference;
class nsIURI;
class nsNodeSupportsWeakRefTearoff;
class nsIEditor;
class nsIDOMUserDataHandler;
class nsAttrAndChildArray;
class nsNodeWeakReference;
class nsXPCClassInfo;
namespace mozilla {
@ -56,6 +49,12 @@ class Element;
} // namespace dom
} // namespace mozilla
namespace JS {
class Value;
}
inline void SetDOMStringToNull(nsAString& aString);
enum {
// This bit will be set if the node has a listener manager.
NODE_HAS_LISTENERMANAGER = 0x00000001U,
@ -150,19 +149,6 @@ enum {
NODE_TYPE_SPECIFIC_BITS_OFFSET = 20
};
// Useful inline function for getting a node given an nsIContent and an
// nsIDocument. Returns the first argument cast to nsINode if it is non-null,
// otherwise returns the second (which may be null). We use type variables
// instead of nsIContent* and nsIDocument* because the actual types must be
// known for the cast to work.
template<class C, class D>
inline nsINode* NODE_FROM(C& aContent, D& aDocument)
{
if (aContent)
return static_cast<nsINode*>(aContent);
return static_cast<nsINode*>(aDocument);
}
/**
* Class used to detect unexpected mutations. To use the class create an
* nsMutationGuard on the stack before unexpected mutations could occur.
@ -1559,6 +1545,19 @@ protected:
nsSlots* mSlots;
};
// Useful inline function for getting a node given an nsIContent and an
// nsIDocument. Returns the first argument cast to nsINode if it is non-null,
// otherwise returns the second (which may be null). We use type variables
// instead of nsIContent* and nsIDocument* because the actual types must be
// known for the cast to work.
template<class C, class D>
inline nsINode* NODE_FROM(C& aContent, D& aDocument)
{
if (aContent)
return static_cast<nsINode*>(aContent);
return static_cast<nsINode*>(aDocument);
}
extern const nsIID kThisPtrOffsetsSID;

Просмотреть файл

@ -23,20 +23,19 @@
#ifndef nsINodeInfo_h___
#define nsINodeInfo_h___
#include "nsISupports.h"
#include "nsIAtom.h"
#include "nsINameSpaceManager.h"
#include "nsNodeInfoManager.h"
#include "nsCOMPtr.h"
#include "nsCOMPtr.h" // for member
#include "nsIAtom.h" // for member (in nsCOMPtr)
#include "nsINameSpaceManager.h" // for kNameSpaceID_*
#include "nsISupports.h" // for base class
#ifdef MOZILLA_INTERNAL_API
#include "nsDOMString.h"
#endif
// Forward declarations
class nsIDocument;
class nsIURI;
class nsIPrincipal;
class nsNodeInfoManager;
// IID for the nsINodeInfo interface
#define NS_INODEINFO_IID \

Просмотреть файл

@ -24,6 +24,9 @@ interface nsIURI;
[scriptable, uuid(e3e284a3-b4a8-49ef-af6b-c8c4a158db86)]
interface nsIObjectLoadingContent : nsISupports
{
/**
* See notes in nsObjectLoadingContent.h
*/
const unsigned long TYPE_LOADING = 0;
const unsigned long TYPE_IMAGE = 1;
const unsigned long TYPE_PLUGIN = 2;

Просмотреть файл

@ -395,7 +395,7 @@ interface nsIXHRSendable : nsISupports {
/**
* @deprecated
*/
[deprecated, scriptable, uuid(8ae70a39-edf1-40b4-a992-472d23421c25)]
[scriptable, uuid(8ae70a39-edf1-40b4-a992-472d23421c25)]
interface nsIJSXMLHttpRequest : nsISupports {
};

Просмотреть файл

@ -6,6 +6,7 @@
#include "nsDOMMutationObserver.h"
#include "nsDOMClassInfoID.h"
#include "nsDOMError.h"
#include "nsIClassInfo.h"
#include "nsIXPCScriptable.h"
#include "nsIScriptGlobalObject.h"

Просмотреть файл

@ -33,6 +33,7 @@
#include "nsDOMEventTargetHelper.h"
#include "mozilla/Attributes.h"
#include "nsDOMClassInfoID.h"
#include "nsDOMError.h"
using namespace mozilla;

Просмотреть файл

@ -10,6 +10,7 @@
#include "ContentChild.h"
#include "ContentParent.h"
#include "nsContentUtils.h"
#include "nsDOMError.h"
#include "nsIXPConnect.h"
#include "jsapi.h"
#include "nsJSUtils.h"
@ -31,6 +32,9 @@
#ifdef ANDROID
#include <android/log.h>
#endif
#ifdef XP_WIN
#include <windows.h>
#endif
using namespace mozilla;
using namespace mozilla::dom;
@ -293,6 +297,11 @@ nsFrameMessageManager::Dump(const nsAString& aStr)
{
#ifdef ANDROID
__android_log_print(ANDROID_LOG_INFO, "Gecko", "%s", NS_ConvertUTF16toUTF8(aStr).get());
#endif
#ifdef XP_WIN
if (IsDebuggerPresent()) {
OutputDebugStringW(PromiseFlatString(aStr).get());
}
#endif
fputs(NS_ConvertUTF16toUTF8(aStr).get(), stdout);
fflush(stdout);

Просмотреть файл

@ -48,6 +48,7 @@ class nsIDOMCSSStyleDeclaration;
class nsIURI;
class nsINodeInfo;
class nsIControllers;
class nsEventChainVisitor;
class nsEventListenerManager;
class nsIScrollableFrame;
class nsAttrValueOrString;

Просмотреть файл

@ -12,7 +12,7 @@
#ifndef nsGkAtoms_h___
#define nsGkAtoms_h___
#include "nsIAtom.h"
class nsIAtom;
class nsGkAtoms {
public:

Просмотреть файл

@ -10,24 +10,22 @@
#ifndef nsNodeInfoManager_h___
#define nsNodeInfoManager_h___
#include "nsCOMPtr.h" // for already_AddRefed
#include "plhash.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/Attributes.h"
#include "mozilla/Attributes.h" // for MOZ_FINAL
#include "nsCOMPtr.h" // for member
#include "nsCycleCollectionParticipant.h" // for NS_DECL_CYCLE_*
#include "plhash.h" // for typedef PLHashNumber
class nsAString;
class nsBindingManager;
class nsIAtom;
class nsIDocument;
class nsINodeInfo;
class nsNodeInfo;
class nsIPrincipal;
class nsIURI;
class nsDocument;
class nsIDOMDocumentType;
class nsIDOMDocument;
class nsAString;
class nsIDOMNamedNodeMap;
class nsXULPrototypeDocument;
class nsBindingManager;
class nsINodeInfo;
class nsIPrincipal;
class nsNodeInfo;
struct PLHashEntry;
struct PLHashTable;
template<class T> struct already_AddRefed;
class nsNodeInfoManager MOZ_FINAL : public nsISupports
{

Просмотреть файл

@ -6,8 +6,8 @@
#ifndef nsNodeUtils_h___
#define nsNodeUtils_h___
#include "nsINode.h"
#include "nsIContent.h"
#include "nsIContent.h" // for use in inline function (ParentChainChanged)
#include "nsIMutationObserver.h" // for use in inline function (ParentChainChanged)
struct CharacterDataChangeInfo;
struct JSContext;

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -31,36 +31,6 @@ class AutoFallback;
class AutoSetInstantiatingToFalse;
class nsObjectFrame;
enum PluginSupportState {
ePluginUnsupported, // The plugin is not supported (e.g. not installed)
ePluginDisabled, // The plugin has been explicitly disabled by the user
ePluginBlocklisted, // The plugin is blocklisted and disabled
ePluginOutdated, // The plugin is considered outdated, but not disabled
ePluginOtherState, // Something else (e.g. uninitialized or not a plugin)
ePluginCrashed,
ePluginClickToPlay, // The plugin is disabled until the user clicks on it
ePluginVulnerableUpdatable, // The plugin is vulnerable (update available)
ePluginVulnerableNoUpdate // The plugin is vulnerable (no update available)
};
/**
* INVARIANTS OF THIS CLASS
* - mChannel is non-null between asyncOpen and onStopRequest (NOTE: Only needs
* to be valid until onStopRequest is called on mFinalListener, not
* necessarily until the channel calls onStopRequest on us)
* - mChannel corresponds to the channel that gets passed to the
* nsIRequestObserver/nsIStreamListener methods
* - mChannel can be cancelled and ODA calls will stop
* - mFinalListener is non-null (only) after onStartRequest has been called on
* it and before onStopRequest has been called on it
* (i.e. calling onStopRequest doesn't violate the nsIRequestObserver
* contract)
* - mFrameLoader is null while this node is not in a document (XXX this
* invariant only exists due to nsFrameLoader suckage and needs to go away)
* - mInstantiating is true while in LoadObject (it may be true in other
* cases as well). Only the function that set mInstantiating should trigger
* frame construction or notifications like ContentStatesChanged or flushes.
*/
class nsObjectLoadingContent : public nsImageLoadingContent
, public nsIStreamListener
, public nsIFrameLoaderOwner
@ -68,9 +38,9 @@ class nsObjectLoadingContent : public nsImageLoadingContent
, public nsIInterfaceRequestor
, public nsIChannelEventSink
{
friend class AutoNotifier;
friend class AutoFallback;
friend class AutoSetInstantiatingToFalse;
friend class AutoSetLoadingToFalse;
friend class InDocCheckEvent;
friend class nsStopPluginRunnable;
friend class nsAsyncInstantiateEvent;
@ -78,11 +48,33 @@ class nsObjectLoadingContent : public nsImageLoadingContent
// This enum's values must be the same as the constants on
// nsIObjectLoadingContent
enum ObjectType {
eType_Loading = TYPE_LOADING, ///< Type not yet known
eType_Image = TYPE_IMAGE, ///< This content is an image
eType_Plugin = TYPE_PLUGIN, ///< This content is a plugin
eType_Document = TYPE_DOCUMENT, ///< This is a document type (e.g. HTML)
eType_Null = TYPE_NULL ///< Type can't be handled
// Loading, type not yet known. We may be waiting for a channel to open.
eType_Loading = TYPE_LOADING,
// Content is a *non-svg* image
eType_Image = TYPE_IMAGE,
// Content is a plugin
eType_Plugin = TYPE_PLUGIN,
// Content is a subdocument, possibly SVG
eType_Document = TYPE_DOCUMENT,
// No content loaded (fallback). May be showing alternate content or
// a custom error handler - *including* click-to-play dialogs
eType_Null = TYPE_NULL
};
enum FallbackType {
eFallbackUnsupported, // The content type is not supported (e.g. plugin
// not installed)
eFallbackAlternate, // Showing alternate content
eFallbackDisabled, // The plugin exists, but is disabled
eFallbackBlocklisted, // The plugin is blocklisted and disabled
eFallbackOutdated, // The plugin is considered outdated, but not
// disabled
eFallbackCrashed, // The plugin has crashed
eFallbackSuppressed, // Suppressed by security policy
eFallbackUserDisabled, // Blocked by content policy
eFallbackClickToPlay, // The plugin is disabled until the user clicks on
// it
eFallbackVulnerableUpdatable, // The plugin is vulnerable (update avail)
eFallbackVulnerableNoUpdate // The plugin is vulnerable (no update avail)
};
nsObjectLoadingContent();
@ -102,110 +94,106 @@ class nsObjectLoadingContent : public nsImageLoadingContent
using nsImageLoadingContent::OnStopRequest;
#endif
ObjectType Type() { return mType; }
/**
* Object state. This is a bitmask consisting of a subset of
* NS_EVENT_STATE_BROKEN, NS_EVENT_STATE_USERDISABLED and
* NS_EVENT_STATE_SUPPRESSED representing the current state of the object.
* Object state. This is a bitmask of NS_EVENT_STATEs epresenting the
* current state of the object.
*/
nsEventStates ObjectState() const;
ObjectType Type() { return mType; }
void SetIsNetworkCreated(bool aNetworkCreated)
{
mNetworkCreated = aNetworkCreated;
}
// Can flush layout.
nsresult InstantiatePluginInstance(const char* aMimeType, nsIURI* aURI);
/**
* Immediately instantiate a plugin instance. This is a no-op if
* mType != eType_Plugin or a plugin is already running.
*/
nsresult InstantiatePluginInstance();
/**
* Notify this class the document state has changed
* Called by nsDocument so we may suspend plugins in inactive documents)
*/
void NotifyOwnerDocumentActivityChanged();
/**
* Used by pluginHost to know if we're loading with a channel, so it
* will not open its own.
*/
bool SrcStreamLoading() { return mSrcStreamLoading; };
protected:
/**
* Load the object from the given URI.
* @param aURI The URI to load.
* @param aNotify If true, nsIDocumentObserver state change notifications
* will be sent as needed.
* @param aTypeHint MIME Type hint. Overridden by the server unless this
* class has the eOverrideServerType capability.
* @param aForceLoad If true, the object will be refetched even if the URI
* is the same as the currently-loaded object.
* @note Prefer the nsIURI-taking version of this function if a URI object
* is already available.
* @see the URI-taking version of this function for a detailed description
* of how a plugin will be found.
*/
nsresult LoadObject(const nsAString& aURI,
bool aNotify,
const nsCString& aTypeHint = EmptyCString(),
bool aForceLoad = false);
/**
* Loads the object from the given URI.
* Begins loading the object when called
*
* The URI and type can both be null; if the URI is null a plugin will be
* instantiated in the hope that there is a <param> with a useful URI
* somewhere around. Other attributes of |this| QI'd to nsIContent will be
* inspected. This function attempts hard to find a suitable plugin.
* Attributes of |this| QI'd to nsIContent will be inspected, depending on
* the node type. This function currently assumes it is a <applet>,
* <object>, or <embed> tag.
*
* The instantiated plugin depends on three values:
* - The passed-in URI
* - The passed-in type hint
* The instantiated plugin depends on:
* - The URI (<embed src>, <object data>)
* - The type 'hint' (type attribute)
* - The mime type returned by opening the URI
* - Enabled plugins claiming the ultimate mime type
* - The capabilities returned by GetCapabilities
* - The classid attribute, if eSupportClassID is among the capabilities
* and such an attribute is present..
*
* Supported class ID attributes override any other value.
*
* If no class ID is present and aForceType is true, the handler given by
* aTypeHint will be instantiated for this content.
* If the URI is null or not supported, and a type hint is given, the plugin
* corresponding to that type is instantiated.
* If eAllowPluginSkipChannel is true, we may skip opening the URI if our
* type hint points to a valid plugin, deferring that responsibility to the
* plugin.
* Similarly, if no URI is provided, but a type hint for a valid plugin is
* present, that plugin will be instantiated
*
* Otherwise a request to that URI is made and the type sent by the server
* is used to find a suitable handler.
* is used to find a suitable handler, EXCEPT when:
* - The type hint refers to a *supported* plugin, in which case that
* plugin will be instantiated regardless of the server provided type
* - The server returns a binary-stream type, and our type hint refers to
* a valid non-document type, we will use the type hint
*
* @param aForceLoad If true, the object will be refetched even if the URI
* is the same as the currently-loaded object.
* @param aNotify If we should send notifications. If false, content
* loading may be deferred while appropriate frames are
* created
* @param aForceLoad If we should reload this content (and re-attempt the
* channel open) even if our parameters did not change
*/
nsresult LoadObject(nsIURI* aURI,
bool aNotify,
const nsCString& aTypeHint = EmptyCString(),
nsresult LoadObject(bool aNotify,
bool aForceLoad = false);
enum Capabilities {
eSupportImages = PR_BIT(0), // Images are supported (imgILoader)
eSupportPlugins = PR_BIT(1), // Plugins are supported (nsIPluginHost)
eSupportDocuments = PR_BIT(2), // Documents are supported
// (nsIDocumentLoaderFactory)
// This flag always includes SVG
eSupportSVG = PR_BIT(3), // SVG is supported (image/svg+xml)
eSupportClassID = PR_BIT(4), // The classid attribute is supported
eOverrideServerType = PR_BIT(5) // The server-sent MIME type is ignored
// (ignored if no type is specified)
eSupportImages = PR_BIT(0), // Images are supported (imgILoader)
eSupportPlugins = PR_BIT(1), // Plugins are supported (nsIPluginHost)
eSupportDocuments = PR_BIT(2), // Documents are supported
// (nsIDocumentLoaderFactory)
// This flag always includes SVG
eSupportSVG = PR_BIT(3), // SVG is supported (image/svg+xml)
eSupportClassID = PR_BIT(4), // The classid attribute is supported
// Allows us to load a plugin if it matches a MIME type or file extension
// registered to a plugin without opening its specified URI first. Can
// result in launching plugins for URIs that return differing content
// types. Plugins without URIs may instantiate regardless.
// XXX(johns) this is our legacy behavior on <embed> tags, whereas object
// will always open a channel and check its MIME if a URI is present.
eAllowPluginSkipChannel = PR_BIT(5)
};
/**
* Returns the list of capabilities this content node supports. This is a
* bitmask consisting of flags from the Capabilities enum.
*
* The default implementation supports all types but no classids.
* The default implementation supports all types but not
* eSupportClassID or eAllowPluginSkipChannel
*/
virtual PRUint32 GetCapabilities() const;
/**
* Fall back to rendering the alternative content.
* Destroys all loaded documents/plugins and releases references
*/
void Fallback(bool aNotify);
/**
* Subclasses must call this function when they are removed from the
* document.
*
* XXX This is a temporary workaround for docshell suckyness
*/
void RemovedFromDocument();
void DestroyContent();
static void Traverse(nsObjectLoadingContent *tmp,
nsCycleCollectionTraversalCallback &cb);
@ -222,30 +210,127 @@ class nsObjectLoadingContent : public nsImageLoadingContent
bool aNullParent = true);
private:
// Object parameter changes returned by UpdateObjectParameters
enum ParameterUpdateFlags {
eParamNoChange = 0,
// Parameters that potentially affect the channel changed
// - mOriginalURI, mOriginalContentType
eParamChannelChanged = PR_BIT(0),
// Parameters that affect displayed content changed
// - mURI, mContentType, mType, mBaseURI
eParamStateChanged = PR_BIT(1)
};
/**
* Loads fallback content with the specified FallbackType
*
* @param aType FallbackType value for type of fallback we're loading
* @param aNotify Send notifications and events. If false, caller is
* responsible for doing so
*/
void LoadFallback(FallbackType aType, bool aNotify);
/**
* Internal version of LoadObject that should only be used by this class
* aLoadingChannel is passed by the LoadObject call from OnStartRequest,
* primarily for sanity-preservation
*/
nsresult LoadObject(bool aNotify,
bool aForceLoad,
nsIRequest *aLoadingChannel);
/**
* Introspects the object and sets the following member variables:
* - mOriginalContentType : This is the type attribute on the element
* - mOriginalURI : The src or data attribute on the element
* - mURI : The final URI, considering mChannel if
* mChannelLoaded is set
* - mContentType : The final content type, considering mChannel if
* mChannelLoaded is set
* - mBaseURI : The object's base URI, which may be set by the
* object (codebase attribute)
* - mType : The type the object is determined to be based
* on the above
*
* NOTE The class assumes that mType is the currently loaded type at various
* points, so the caller of this function must take the appropriate
* actions to ensure this
*
* NOTE This function does not perform security checks, only determining the
* requested type and parameters of the object.
*
* @return Returns a bitmask of ParameterUpdateFlags values
*/
ParameterUpdateFlags UpdateObjectParameters();
void NotifyContentObjectWrapper();
/**
* Check whether the given request represents a successful load.
* Opens the channel pointed to by mURI into mChannel.
*
* @param aPolicyType The value to be passed to channelPolicy->SetLoadType
*/
static bool IsSuccessfulRequest(nsIRequest* aRequest);
nsresult OpenChannel(PRInt32 aPolicyType);
/**
* Check whether the URI can be handled internally.
* Closes and releases references to mChannel and, if opened, mFinalListener
*/
static bool CanHandleURI(nsIURI* aURI);
nsresult CloseChannel();
/**
* Checks whether the given type is a supported document type.
* If this object is allowed to play plugin content, or if it would display
* click-to-play instead.
* NOTE that this does not actually check if the object is a loadable plugin
*/
bool ShouldPlay(FallbackType &aReason);
/**
* Checks if a URI passes security checks and content policy, relative to
* the current document's principal
*
* @param aURI The URI to consider
* @param aContentPolicy [in/out] A pointer to the initial content
* policy, that will be updated to contain the
* final determined policy
* @param aContentPolicyType The 'contentType' parameter passed to
* NS_CheckContentLoadPolicy
*
* @return true if this URI is acceptable for loading
*/
bool CheckURILoad(nsIURI *aURI,
PRInt16 *aContentPolicy,
PRInt32 aContentPolicyType);
/**
* Checks if the current mURI and mBaseURI pass content policy and security
* checks for loading
*
* @param aContentPolicy [in/out] A pointer to the initial content
* policy, that will be updated to contain the
* final determined policy if a URL is rejected
* @param aContentPolicyType The 'contentType' parameter passed to
* NS_CheckContentLoadPolicy
*
* @return true if the URIs are acceptable for loading
*/
bool CheckObjectURIs(PRInt16 *aContentPolicy, PRInt32 aContentPolicyType);
/**
* Checks whether the given type is a supported document type
*
* NOTE Does not take content policy or capabilities into account
*/
bool IsSupportedDocument(const nsCString& aType);
/**
* Unload the currently loaded content. This removes all state related to
* the displayed content and sets the type to eType_Null.
* Note: This does not send any notifications.
* Unloads all content and resets the object to a completely unloaded state
*
* NOTE Calls StopPluginInstance() and may spin the event loop
*
* @param aResetState Reset the object type to 'loading' and destroy channel
* as well
*/
void UnloadContent();
void UnloadObject(bool aResetState = true);
/**
* Notifies document observes about a new type/state of this object.
@ -261,141 +346,112 @@ class nsObjectLoadingContent : public nsImageLoadingContent
bool aSync, bool aNotify);
/**
* Fires the "Plugin not found" event. This function doesn't do any checks
* whether it should be fired, the caller should do that.
* Fires the nsPluginErrorEvent. This function doesn't do any checks
* whether it should be fired, or whether the given state translates to a
* meaningful event
*/
static void FirePluginError(nsIContent* thisContent, PluginSupportState state);
void FirePluginError(FallbackType aFallbackType);
/**
* Returns a ObjectType value corresponding to the type of content we would
* support the given MIME type as, taking capabilities and plugin state
* into account
*
* NOTE this does not consider whether the content would be suppressed by
* click-to-play or other content policy checks
*/
ObjectType GetTypeOfContent(const nsCString& aMIMEType);
/**
* For a classid, returns the MIME type that can be used to instantiate
* a plugin for this ID.
*
* @param aClassID The class ID in question
* @param aType [out] The corresponding type, if the call is successful
* @return NS_ERROR_NOT_AVAILABLE Unsupported class ID.
*/
nsresult TypeForClassID(const nsAString& aClassID, nsACString& aType);
/**
* Gets the base URI to be used for this object. This differs from
* nsIContent::GetBaseURI in that it takes codebase attributes into
* account.
*/
void GetObjectBaseURI(nsIContent* thisContent, nsIURI** aURI);
/**
* Gets the frame that's associated with this content node.
* Does not flush.
*/
nsObjectFrame* GetExistingFrame();
/**
* Handle being blocked by a content policy. aStatus is the nsresult
* return value of the Should* call, while aRetval is what it returned in
* its out parameter.
*/
void HandleBeingBlockedByContentPolicy(nsresult aStatus,
PRInt16 aRetval);
/**
* Get the plugin support state for the given content node and MIME type.
* This is used for purposes of determining whether to fire PluginNotFound
* events etc. aContentType is the MIME type we ended up with.
*
* This should only be called if the type of this content is eType_Null.
*/
PluginSupportState GetPluginSupportState(nsIContent* aContent, const nsCString& aContentType);
/**
* If the plugin for aContentType is disabled, return ePluginDisabled.
* Otherwise (including if there is no plugin for aContentType at all),
* return ePluginUnsupported.
*
* This should only be called if the type of this content is eType_Null.
*/
PluginSupportState GetPluginDisabledState(const nsCString& aContentType);
/**
* When there is no usable plugin available this will send UI events and
* update the AutoFallback object appropriate to the reason for there being
* no plugin available.
*/
void UpdateFallbackState(nsIContent* aContent, AutoFallback& fallback, const nsCString& aTypeHint);
nsresult IsPluginEnabledForType(const nsCString& aMIMEType);
bool IsPluginEnabledByExtension(nsIURI* uri, nsCString& mimeType);
/**
* The final listener to ship the data to (imagelib, uriloader, etc)
*/
// The final listener for mChannel (uriloader, pluginstreamlistener, etc.)
nsCOMPtr<nsIStreamListener> mFinalListener;
/**
* Frame loader, for content documents we load.
*/
// Frame loader, for content documents we load.
nsRefPtr<nsFrameLoader> mFrameLoader;
/**
* A pending nsAsyncInstantiateEvent (may be null). This is a weak ref.
*/
// A pending nsAsyncInstantiateEvent (may be null). This is a weak ref.
nsIRunnable *mPendingInstantiateEvent;
/**
* The content type of the resource we were last asked to load.
*/
// The content type of our current load target, updated by
// UpdateObjectParameters(). Takes the channel's type into account once
// opened.
//
// May change if a channel is opened, does not imply a loaded state
nsCString mContentType;
/**
* The channel that's currently being loaded. This is a weak reference.
* Non-null between asyncOpen and onStopRequest.
*/
nsIChannel* mChannel;
// The content type 'hint' provided by the element's type attribute. May
// or may not be used as a final type
nsCString mOriginalContentType;
// The data we were last asked to load
// The channel that's currently being loaded. If set, but mChannelLoaded is
// false, has not yet reached OnStartRequest
nsCOMPtr<nsIChannel> mChannel;
// The URI of the current content.
// May change as we open channels and encounter redirects - does not imply
// a loaded type
nsCOMPtr<nsIURI> mURI;
/**
* Type of the currently-loaded content.
*/
ObjectType mType : 16;
// The original URI obtained from inspecting the element (codebase, and
// src/data). May differ from mURI due to redirects
nsCOMPtr<nsIURI> mOriginalURI;
/**
* Whether we are about to call instantiate on our frame. If we aren't,
* SetFrame needs to asynchronously call Instantiate.
*/
// The baseURI used for constructing mURI, and used by some plugins (java)
// as a root for other resource requests.
nsCOMPtr<nsIURI> mBaseURI;
// Type of the currently-loaded content.
ObjectType mType : 8;
// The type of fallback content we're showing (see ObjectState())
FallbackType mFallbackType : 8;
// If true, the current load has finished opening a channel. Does not imply
// mChannel -- mChannelLoaded && !mChannel may occur for a load that failed
bool mChannelLoaded : 1;
// Whether we are about to call instantiate on our frame. If we aren't,
// SetFrame needs to asynchronously call Instantiate.
bool mInstantiating : 1;
// Blocking status from content policy
bool mUserDisabled : 1;
bool mSuppressed : 1;
// True when the object is created for an element which the parser has
// created using NS_FROM_PARSER_NETWORK flag. If the element is modified,
// it may lose the flag.
bool mNetworkCreated : 1;
// Used to keep track of if a plugin is blocked by click-to-play.
// True indicates the plugin is not click-to-play or it has been clicked by
// the user.
// False indicates the plugin is click-to-play and has not yet been clicked.
bool mCTPPlayable : 1;
// Used to keep track of whether or not a plugin has been played.
// This is used for click-to-play plugins.
// Used to keep track of whether or not a plugin has been explicitly
// activated by PlayPlugin(). (see ShouldPlay())
bool mActivated : 1;
// Protects DoStopPlugin from reentry (bug 724781).
bool mIsStopping : 1;
// Protects LoadObject from re-entry
bool mIsLoading : 1;
// Used to track when we might try to instantiate a plugin instance based on
// a src data stream being delivered to this object. When this is true we don't
// want plugin instance instantiation code to attempt to load src data again or
// we'll deliver duplicate streams. Should be cleared when we are not loading
// src data.
// a src data stream being delivered to this object. When this is true we
// don't want plugin instance instantiation code to attempt to load src data
// again or we'll deliver duplicate streams. Should be cleared when we are
// not loading src data.
bool mSrcStreamLoading;
// A specific state that caused us to fallback
PluginSupportState mFallbackReason;
nsWeakFrame mPrintFrame;

Просмотреть файл

@ -3699,7 +3699,6 @@ nsXMLHttpRequest::MaybeDispatchProgressEvents(bool aFinalProgress)
if (aFinalProgress) {
mUploadTotal = mUploadTransferred;
mUploadProgressMax = mUploadProgress;
mUploadLengthComputable = true;
}
if (mUpload && !mUploadComplete) {
DispatchProgressEvent(mUpload, NS_LITERAL_STRING(PROGRESS_STR),
@ -3710,7 +3709,6 @@ nsXMLHttpRequest::MaybeDispatchProgressEvents(bool aFinalProgress)
} else {
if (aFinalProgress) {
mLoadTotal = mLoadTransferred;
mLoadLengthComputable = true;
}
mInLoadProgressEvent = true;
DispatchProgressEvent(this, NS_LITERAL_STRING(PROGRESS_STR),

Просмотреть файл

@ -3570,7 +3570,7 @@ JS::Value
nsCanvasRenderingContext2DAzure::GetMozDash(JSContext* cx, ErrorResult& error)
{
JS::Value mozDash;
DashArrayToJSVal(CurrentState().dash, cx, &mozDash);
error = DashArrayToJSVal(CurrentState().dash, cx, &mozDash);
return mozDash;
}

Просмотреть файл

@ -10,6 +10,7 @@
#include "IPC/IPCMessageUtils.h"
#include "nsCOMPtr.h"
#include "nsDOMError.h"
#include "nsDOMEvent.h"
#include "nsEventStateManager.h"
#include "nsIFrame.h"

Просмотреть файл

@ -4,6 +4,7 @@
* 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 "nsDOMError.h"
#include "nsDOMNotifyAudioAvailableEvent.h"
#include "nsDOMClassInfoID.h" // DOMCI_DATA, NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO
#include "nsContentUtils.h" // NS_DROP_JS_OBJECTS

Просмотреть файл

@ -4,6 +4,7 @@
* 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 "nsDOMError.h"
#include "nsDOMStringMap.h"
#include "nsDOMClassInfoID.h"

Просмотреть файл

@ -3,6 +3,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nsDOMError.h"
#include "nsIDOMHTMLAudioElement.h"
#include "nsHTMLAudioElement.h"
#include "nsGenericHTMLElement.h"

Просмотреть файл

@ -11,6 +11,7 @@
#include "nsEventDispatcher.h"
#include "nsHTMLMenuItemElement.h"
#include "nsContentUtils.h"
#include "nsDOMError.h"
enum MenuType
{

Просмотреть файл

@ -268,7 +268,6 @@ void
nsHTMLObjectElement::UnbindFromTree(bool aDeep,
bool aNullParent)
{
RemovedFromDocument();
nsObjectLoadingContent::UnbindFromTree(aDeep, aNullParent);
nsGenericHTMLFormElement::UnbindFromTree(aDeep, aNullParent);
}
@ -280,10 +279,12 @@ nsHTMLObjectElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom *aName,
nsIAtom *aPrefix, const nsAString &aValue,
bool aNotify)
{
// If we plan to call LoadObject, we want to do it first so that the
// object load kicks off _before_ the reflow triggered by the SetAttr. But if
// aNotify is false, we are coming from the parser or some such place; we'll
// get bound after all the attributes have been set, so we'll do the
nsresult rv = nsGenericHTMLFormElement::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
NS_ENSURE_SUCCESS(rv, rv);
// if aNotify is false, we are coming from the parser or some such place;
// we'll get bound after all the attributes have been set, so we'll do the
// object load from BindToTree/DoneAddingChildren.
// Skip the LoadObject call in that case.
// We also don't want to start loading the object when we're not yet in
@ -291,24 +292,27 @@ nsHTMLObjectElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom *aName,
// attributes before inserting the node into the document.
if (aNotify && IsInDoc() && mIsDoneAddingChildren &&
aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::data) {
nsAutoString type;
GetAttr(kNameSpaceID_None, nsGkAtoms::type, type);
LoadObject(aValue, aNotify, NS_ConvertUTF16toUTF8(type), true);
return LoadObject(aNotify, true);
}
return nsGenericHTMLFormElement::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
return NS_OK;
}
nsresult
nsHTMLObjectElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
bool aNotify)
{
if (aNameSpaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::data) {
Fallback(aNotify);
nsresult rv = nsGenericHTMLFormElement::UnsetAttr(aNameSpaceID,
aAttribute, aNotify);
NS_ENSURE_SUCCESS(rv, rv);
// See comment in SetAttr
if (aNotify && IsInDoc() && mIsDoneAddingChildren &&
aNameSpaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::data) {
return LoadObject(aNotify, true);
}
return nsGenericHTMLFormElement::UnsetAttr(aNameSpaceID, aAttribute, aNotify);
return NS_OK;
}
bool
@ -513,20 +517,7 @@ nsHTMLObjectElement::GetAttributeMappingFunction() const
void
nsHTMLObjectElement::StartObjectLoad(bool aNotify)
{
nsAutoString type;
GetAttr(kNameSpaceID_None, nsGkAtoms::type, type);
NS_ConvertUTF16toUTF8 ctype(type);
nsAutoString uri;
if (GetAttr(kNameSpaceID_None, nsGkAtoms::data, uri)) {
LoadObject(uri, aNotify, ctype);
}
else {
// Be sure to call the nsIURI version if we have no attribute
// That handles the case where no URI is specified. An empty string would
// get interpreted as the page itself, instead of absence of URI.
LoadObject(nullptr, aNotify, ctype);
}
LoadObject(aNotify);
SetIsNetworkCreated(false);
}
@ -545,7 +536,7 @@ nsHTMLObjectElement::GetCapabilities() const
void
nsHTMLObjectElement::DestroyContent()
{
RemovedFromDocument();
nsObjectLoadingContent::DestroyContent();
nsGenericHTMLFormElement::DestroyContent();
}

Просмотреть файл

@ -298,22 +298,22 @@ void
nsHTMLSharedObjectElement::UnbindFromTree(bool aDeep,
bool aNullParent)
{
RemovedFromDocument();
nsObjectLoadingContent::UnbindFromTree(aDeep, aNullParent);
nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent);
}
nsresult
nsHTMLSharedObjectElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom *aName,
nsIAtom *aPrefix, const nsAString &aValue,
bool aNotify)
{
// If we plan to call LoadObject, we want to do it first so that the
// object load kicks off _before_ the reflow triggered by the SetAttr. But if
// aNotify is false, we are coming from the parser or some such place; we'll
// get bound after all the attributes have been set, so we'll do the
nsresult rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix,
aValue, aNotify);
NS_ENSURE_SUCCESS(rv, rv);
// if aNotify is false, we are coming from the parser or some such place;
// we'll get bound after all the attributes have been set, so we'll do the
// object load from BindToTree/DoneAddingChildren.
// Skip the LoadObject call in that case.
// We also don't want to start loading the object when we're not yet in
@ -321,13 +321,10 @@ nsHTMLSharedObjectElement::SetAttr(PRInt32 aNameSpaceID, nsIAtom *aName,
// attributes before inserting the node into the document.
if (aNotify && IsInDoc() && mIsDoneAddingChildren &&
aNameSpaceID == kNameSpaceID_None && aName == URIAttrName()) {
nsCAutoString type;
GetTypeAttrValue(type);
LoadObject(aValue, aNotify, type, true);
return LoadObject(aNotify, true);
}
return nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue,
aNotify);
return NS_OK;
}
bool
@ -468,19 +465,7 @@ nsHTMLSharedObjectElement::GetAttributeMappingFunction() const
void
nsHTMLSharedObjectElement::StartObjectLoad(bool aNotify)
{
nsCAutoString type;
GetTypeAttrValue(type);
nsAutoString uri;
if (!GetAttr(kNameSpaceID_None, URIAttrName(), uri)) {
// Be sure to call the nsIURI version if we have no attribute
// That handles the case where no URI is specified. An empty string would
// get interpreted as the page itself, instead of absence of URI.
LoadObject(nullptr, aNotify, type);
}
else {
LoadObject(uri, aNotify, type);
}
LoadObject(aNotify);
SetIsNetworkCreated(false);
}
@ -493,7 +478,7 @@ nsHTMLSharedObjectElement::IntrinsicState() const
PRUint32
nsHTMLSharedObjectElement::GetCapabilities() const
{
PRUint32 capabilities = eSupportPlugins | eOverrideServerType;
PRUint32 capabilities = eSupportPlugins | eAllowPluginSkipChannel;
if (mNodeInfo->Equals(nsGkAtoms::embed)) {
capabilities |= eSupportSVG | eSupportImages;
}
@ -504,7 +489,7 @@ nsHTMLSharedObjectElement::GetCapabilities() const
void
nsHTMLSharedObjectElement::DestroyContent()
{
RemovedFromDocument();
nsObjectLoadingContent::DestroyContent();
nsGenericHTMLElement::DestroyContent();
}

Просмотреть файл

@ -120,8 +120,7 @@ PluginStreamListener::SetupPlugin()
return NS_ERROR_UNEXPECTED;
}
nsObjectLoadingContent* olcc = static_cast<nsObjectLoadingContent*>(olc.get());
nsresult rv = olcc->InstantiatePluginInstance(mPluginDoc->GetType().get(),
mDocument->nsIDocument::GetDocumentURI());
nsresult rv = olcc->InstantiatePluginInstance();
if (NS_FAILED(rv)) {
return rv;
}

Просмотреть файл

@ -6,6 +6,7 @@
#ifndef NS_SMILTIMEDELEMENT_H_
#define NS_SMILTIMEDELEMENT_H_
#include "nsISMILAnimationElement.h"
#include "nsSMILInterval.h"
#include "nsSMILInstanceTime.h"
#include "nsSMILMilestone.h"
@ -18,7 +19,6 @@
#include "nsAutoPtr.h"
#include "nsAttrValue.h"
class nsISMILAnimationElement;
class nsSMILAnimationFunction;
class nsSMILTimeContainer;
class nsSMILTimeValue;

Просмотреть файл

@ -10,6 +10,7 @@
#include "nsSVGElement.h"
#include "nsContentUtils.h"
#include "dombindings.h"
#include "nsDOMError.h"
// local helper functions
namespace {

Просмотреть файл

@ -6,6 +6,7 @@
#include "SVGAnimatedTransformList.h"
#include "DOMSVGAnimatedTransformList.h"
#include "nsISMILAnimationElement.h"
#include "nsSMILValue.h"
#include "SVGTransform.h"
#include "SVGTransformListSMILType.h"

Просмотреть файл

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "SVGMotionSMILAnimationFunction.h"
#include "nsISMILAnimationElement.h"
#include "nsSMILParserUtils.h"
#include "nsSVGAngle.h"
#include "SVGMotionSMILType.h"

Просмотреть файл

@ -4,6 +4,7 @@
* 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 "nsDOMError.h"
#include "SVGTransform.h"
#include "nsContentUtils.h"
#include "nsTextFormatter.h"

Просмотреть файл

@ -3,6 +3,7 @@
* 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 "nsDOMError.h"
#include "nsSVGBoolean.h"
#include "nsSMILValue.h"
#include "SMILBoolType.h"

Просмотреть файл

@ -56,6 +56,7 @@
#include "nsSMILMappedAttribute.h"
#include "SVGMotionSMILAttr.h"
#include "nsAttrValueOrString.h"
#include "nsSMILAnimationController.h"
using namespace mozilla;

Просмотреть файл

@ -3,6 +3,7 @@
* 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 "nsDOMError.h"
#include "nsSVGEnum.h"
#include "nsIAtom.h"
#include "nsSVGElement.h"

Просмотреть файл

@ -3,6 +3,7 @@
* 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 "nsDOMError.h"
#include "nsSVGInteger.h"
#include "nsSMILValue.h"
#include "SMILIntegerType.h"

Просмотреть файл

@ -3,6 +3,7 @@
* 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 "nsDOMError.h"
#include "nsSVGNumber2.h"
#include "nsSVGUtils.h"
#include "nsTextFormatter.h"

Просмотреть файл

@ -781,7 +781,7 @@ nsXULElement::RemoveChildAt(PRUint32 aIndex, bool aNotify)
controlElement->GetSelectedCount(&length);
for (PRInt32 i = 0; i < length; i++) {
nsCOMPtr<nsIDOMXULSelectControlItemElement> node;
controlElement->GetSelectedItem(i, getter_AddRefs(node));
controlElement->MultiGetSelectedItem(i, getter_AddRefs(node));
// we need to QI here to do an XPCOM-correct pointercompare
nsCOMPtr<nsIDOMElement> selElem = do_QueryInterface(node);
if (selElem == oldKidElem &&

Просмотреть файл

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "nscore.h"
#include "nsDOMError.h"
#include "nsIContent.h"
#include "nsINodeInfo.h"
#include "nsIDOMElement.h"

Просмотреть файл

@ -0,0 +1,110 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/LoadContext.h"
#include "nsIScriptSecurityManager.h"
#include "nsServiceManagerUtils.h"
#include "nsContentUtils.h"
namespace mozilla {
NS_IMPL_ISUPPORTS1(LoadContext, nsILoadContext);
//-----------------------------------------------------------------------------
// LoadContext::nsILoadContext
//-----------------------------------------------------------------------------
NS_IMETHODIMP
LoadContext::GetAssociatedWindow(nsIDOMWindow**)
{
MOZ_ASSERT(mIsNotNull);
// can't support this in the parent process
return NS_ERROR_UNEXPECTED;
}
NS_IMETHODIMP
LoadContext::GetTopWindow(nsIDOMWindow**)
{
MOZ_ASSERT(mIsNotNull);
// can't support this in the parent process
return NS_ERROR_UNEXPECTED;
}
NS_IMETHODIMP
LoadContext::IsAppOfType(PRUint32, bool*)
{
MOZ_ASSERT(mIsNotNull);
// don't expect we need this in parent (Thunderbird/SeaMonkey specific?)
return NS_ERROR_UNEXPECTED;
}
NS_IMETHODIMP
LoadContext::GetIsContent(bool* aIsContent)
{
MOZ_ASSERT(mIsNotNull);
NS_ENSURE_ARG_POINTER(aIsContent);
*aIsContent = mIsContent;
return NS_OK;
}
NS_IMETHODIMP
LoadContext::GetUsePrivateBrowsing(bool* aUsePrivateBrowsing)
{
MOZ_ASSERT(mIsNotNull);
NS_ENSURE_ARG_POINTER(aUsePrivateBrowsing);
*aUsePrivateBrowsing = mUsePrivateBrowsing;
return NS_OK;
}
NS_IMETHODIMP
LoadContext::SetUsePrivateBrowsing(bool aUsePrivateBrowsing)
{
MOZ_ASSERT(mIsNotNull);
// We shouldn't need this on parent...
return NS_ERROR_UNEXPECTED;
}
NS_IMETHODIMP
LoadContext::GetIsInBrowserElement(bool* aIsInBrowserElement)
{
MOZ_ASSERT(mIsNotNull);
NS_ENSURE_ARG_POINTER(aIsInBrowserElement);
*aIsInBrowserElement = mIsInBrowserElement;
return NS_OK;
}
NS_IMETHODIMP
LoadContext::GetAppId(PRUint32* aAppId)
{
MOZ_ASSERT(mIsNotNull);
NS_ENSURE_ARG_POINTER(aAppId);
*aAppId = mAppId;
return NS_OK;
}
NS_IMETHODIMP
LoadContext::GetExtendedOrigin(nsIURI* aUri, nsACString& aResult)
{
MOZ_ASSERT(mIsNotNull);
nsIScriptSecurityManager* ssmgr = nsContentUtils::GetSecurityManager();
return ssmgr->GetExtendedOrigin(aUri, mAppId, mIsInBrowserElement, aResult);
}
} // namespace mozilla

Просмотреть файл

@ -0,0 +1,49 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef LoadContext_h
#define LoadContext_h
#include "SerializedLoadContext.h"
namespace mozilla {
/**
* Class that provides nsILoadContext info in Parent process. Typically copied
* from Child via SerializedLoadContext.
*
* Note: this is not the "normal" or "original" nsILoadContext. That is
* typically provided by nsDocShell. This is only used when the original
* docshell is in a different process and we need to copy certain values from
* it.
*/
class LoadContext : public nsILoadContext
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSILOADCONTEXT
LoadContext(const IPC::SerializedLoadContext& toCopy)
: mIsNotNull(toCopy.mIsNotNull)
, mIsContent(toCopy.mIsContent)
, mUsePrivateBrowsing(toCopy.mUsePrivateBrowsing)
, mIsInBrowserElement(toCopy.mIsInBrowserElement)
, mAppId(toCopy.mAppId)
{}
private:
bool mIsNotNull;
bool mIsContent;
bool mUsePrivateBrowsing;
bool mIsInBrowserElement;
PRUint32 mAppId;
};
} // namespace mozilla
#endif // LoadContext_h

Просмотреть файл

@ -56,12 +56,14 @@ EXPORTS = \
nsDocShellLoadTypes.h \
nsILinkHandler.h \
nsIWebShellServices.h \
SerializedLoadContext.h \
$(NULL)
EXPORTS_NAMESPACES = mozilla
EXPORTS_mozilla = \
IHistory.h \
LoadContext.h \
$(NULL)
CPPSRCS = \
@ -75,6 +77,8 @@ CPPSRCS = \
nsWebNavigationInfo.cpp \
nsAboutRedirector.cpp \
nsDownloadHistory.cpp \
SerializedLoadContext.cpp \
LoadContext.cpp \
$(NULL)
# we don't want the shared lib, but we want to force the creation of a

Просмотреть файл

@ -0,0 +1,54 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "SerializedLoadContext.h"
#include "nsNetUtil.h"
#include "nsIChannel.h"
#include "nsIWebSocketChannel.h"
namespace IPC {
SerializedLoadContext::SerializedLoadContext(nsILoadContext* aLoadContext)
{
Init(aLoadContext);
}
SerializedLoadContext::SerializedLoadContext(nsIChannel* aChannel)
{
nsCOMPtr<nsILoadContext> loadContext;
NS_QueryNotificationCallbacks(aChannel, loadContext);
Init(loadContext);
}
SerializedLoadContext::SerializedLoadContext(nsIWebSocketChannel* aChannel)
{
nsCOMPtr<nsILoadContext> loadContext;
NS_QueryNotificationCallbacks(aChannel, loadContext);
Init(loadContext);
}
void
SerializedLoadContext::Init(nsILoadContext* aLoadContext)
{
if (aLoadContext) {
mIsNotNull = true;
aLoadContext->GetIsContent(&mIsContent);
aLoadContext->GetUsePrivateBrowsing(&mUsePrivateBrowsing);
aLoadContext->GetAppId(&mAppId);
aLoadContext->GetIsInBrowserElement(&mIsInBrowserElement);
} else {
mIsNotNull = false;
// none of below values really matter when mIsNotNull == false:
// we won't be GetInterfaced to nsILoadContext
mIsContent = true;
mUsePrivateBrowsing = false;
mAppId = 0;
mIsInBrowserElement = false;
}
}
} // namespace IPC

Просмотреть файл

@ -0,0 +1,85 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef SerializedLoadContext_h
#define SerializedLoadContext_h
#include "base/basictypes.h"
#include "IPC/IPCMessageUtils.h"
#include "nsIIPCSerializable.h"
#include "nsILoadContext.h"
/*
* This file contains the IPC::SerializedLoadContext class, which is used to
* copy data across IPDL from Child process contexts so it is available in the
* Parent.
*/
class nsIChannel;
class nsIWebSocketChannel;
namespace IPC {
class SerializedLoadContext
{
public:
SerializedLoadContext()
{
Init(nsnull);
}
SerializedLoadContext(nsILoadContext* aLoadContext);
SerializedLoadContext(nsIChannel* aChannel);
SerializedLoadContext(nsIWebSocketChannel* aChannel);
void Init(nsILoadContext* aLoadContext);
bool IsNotNull() const
{
return mIsNotNull;
}
// used to indicate if child-side LoadContext * was null.
bool mIsNotNull;
bool mIsContent;
bool mUsePrivateBrowsing;
bool mIsInBrowserElement;
PRUint32 mAppId;
};
// Function to serialize over IPDL
template<>
struct ParamTraits<SerializedLoadContext>
{
typedef SerializedLoadContext paramType;
static void Write(Message* aMsg, const paramType& aParam)
{
WriteParam(aMsg, aParam.mIsNotNull);
WriteParam(aMsg, aParam.mIsContent);
WriteParam(aMsg, aParam.mUsePrivateBrowsing);
WriteParam(aMsg, aParam.mAppId);
WriteParam(aMsg, aParam.mIsInBrowserElement);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
{
if (!ReadParam(aMsg, aIter, &aResult->mIsNotNull) ||
!ReadParam(aMsg, aIter, &aResult->mIsContent) ||
!ReadParam(aMsg, aIter, &aResult->mUsePrivateBrowsing) ||
!ReadParam(aMsg, aIter, &aResult->mAppId) ||
!ReadParam(aMsg, aIter, &aResult->mIsInBrowserElement)) {
return false;
}
return true;
}
};
} // namespace IPC
#endif // SerializedLoadContext_h

Просмотреть файл

@ -135,11 +135,13 @@ WebappsRegistry.prototype = {
Services.DOMRequest.fireError(request, "INVALID_MANIFEST");
} else {
let receipts = (aParams && aParams.receipts && Array.isArray(aParams.receipts)) ? aParams.receipts : [];
let categories = (aParams && aParams.categories && Array.isArray(aParams.categories)) ? aParams.categories : [];
cpmm.sendAsyncMessage("Webapps:Install", { app: { installOrigin: installOrigin,
origin: this._getOrigin(aURL),
manifestURL: aURL,
manifest: manifest,
receipts: receipts },
receipts: receipts,
categories: categories },
from: installURL,
oid: this._id,
requestID: requestID });
@ -191,8 +193,11 @@ WebappsRegistry.prototype = {
let receipts = (aParams && aParams.receipts &&
Array.isArray(aParams.receipts)) ? aParams.receipts : [];
let categories = (aParams && aParams.categories &&
Array.isArray(aParams.categories)) ? aParams.categories : [];
cpmm.sendAsyncMessage("Webapps:InstallPackage", { url: aPackageURL,
receipts: receipts,
categories: categories,
requestID: requestID,
oid: this._id,
from: this._window.location.href,

Просмотреть файл

@ -502,7 +502,7 @@ let DOMApplicationRegistry = {
}
// Build a data structure to call the webapps confirmation dialog :
// - load the manifest from the zip
// - set data.app.(origin, install_origin, manifestURL, manifest, receipts)
// - set data.app.(origin, install_origin, manifestURL, manifest, receipts, categories)
// - call notifyObservers(this, "webapps-ask-install", JSON.stringify(msg));
let msg = {
from: aData.from,
@ -513,7 +513,8 @@ let DOMApplicationRegistry = {
installOrigin: aData.installOrigin,
origin: "app://" + id,
manifestURL: manifestURL,
receipts: aData.receipts
receipts: aData.receipts,
categories: aData.categories
}
}
let zipReader = Cc["@mozilla.org/libjar/zip-reader;1"]

Просмотреть файл

@ -7,6 +7,7 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk

Просмотреть файл

@ -652,6 +652,19 @@ Navigator::AddIdleObserver(nsIIdleObserver* aIdleObserver)
nsCOMPtr<nsPIDOMWindow> win = do_QueryReferent(mWindow);
NS_ENSURE_TRUE(win, NS_ERROR_UNEXPECTED);
nsCOMPtr<nsIDocument> doc = win->GetExtantDoc();
NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);
nsIPrincipal* principal = doc->NodePrincipal();
if (!nsContentUtils::IsSystemPrincipal(principal)) {
PRUint16 appStatus = nsIPrincipal::APP_STATUS_NOT_INSTALLED;
principal->GetAppStatus(&appStatus);
if (appStatus != nsIPrincipal::APP_STATUS_CERTIFIED) {
return NS_ERROR_DOM_SECURITY_ERR;
}
}
if (NS_FAILED(win->RegisterIdleObserver(aIdleObserver))) {
NS_WARNING("Failed to add idle observer.");
}

Просмотреть файл

@ -5756,11 +5756,21 @@ BaseStubConstructor(nsIWeakReference* aWeakOwner,
JSObject* thisObject = &thisValue.toObject();
// wrap parameters in the target compartment
// we also pass in the calling window as the first argument
++argc;
nsAutoArrayPtr<JS::Value> args(new JS::Value[argc]);
JS::AutoArrayRooter rooter(cx, 0, args);
for (size_t i = 0; i < argc; ++i) {
args[i] = argv[i];
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
nsCOMPtr<nsIDOMWindow> currentWin(do_GetInterface(currentInner));
rv = WrapNative(cx, obj, currentWin, &NS_GET_IID(nsIDOMWindow),
true, &args[0], getter_AddRefs(holder));
if (!JS_WrapValue(cx, &args[0]))
return NS_ERROR_FAILURE;
rooter.changeLength(1);
for (size_t i = 1; i < argc; ++i) {
args[i] = argv[i - 1];
if (!JS_WrapValue(cx, &args[i]))
return NS_ERROR_FAILURE;
rooter.changeLength(i + 1);

Просмотреть файл

@ -128,7 +128,6 @@ private:
DOMTimeMilliSec mBeforeUnloadStart;
DOMTimeMilliSec mUnloadStart;
DOMTimeMilliSec mUnloadEnd;
DOMTimeMilliSec mNavigationEnd;
DOMTimeMilliSec mLoadEventStart;
DOMTimeMilliSec mLoadEventEnd;

Просмотреть файл

@ -2272,7 +2272,7 @@ nsFocusManager::GetSelectionLocation(nsIDocument* aDocument,
startContent != aDocument->GetRootElement()) {
// Yes, indeed we were at the end of the last node
nsFrameIterator frameTraversal(presContext, startFrame,
eLeaf, FrameIteratorFlags::FLAG_FOLLOW_OUT_OF_FLOW);
eLeaf, nsFrameIterator::FLAG_FOLLOW_OUT_OF_FLOW);
nsIFrame *newCaretFrame = nullptr;
nsCOMPtr<nsIContent> newCaretContent = startContent;
@ -2698,7 +2698,7 @@ nsFocusManager::GetNextTabbableContent(nsIPresShell* aPresShell,
}
nsFrameIterator frameTraversal(presContext, startFrame,
ePreOrder, FrameIteratorFlags::FLAG_FOLLOW_OUT_OF_FLOW);
ePreOrder, nsFrameIterator::FLAG_FOLLOW_OUT_OF_FLOW);
if (iterStartContent == aRootContent) {
if (!aForward) {

Просмотреть файл

@ -23,6 +23,7 @@
#include "nsXPIDLString.h"
#include "nsReadableUtils.h"
#include "nsDOMClassInfoID.h"
#include "nsDOMError.h"
#include "nsContentUtils.h"
#include "nsISHistoryInternal.h"
#include "mozilla/Preferences.h"

Просмотреть файл

@ -4,6 +4,7 @@
* 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 "nsDOMError.h"
#include "nsJSEnvironment.h"
#include "nsIScriptGlobalObject.h"
#include "nsIScriptObjectPrincipal.h"

Просмотреть файл

@ -6,6 +6,7 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
MODULE = dom
LIBRARY_NAME = dombindings_s

Просмотреть файл

@ -10,6 +10,7 @@
#include "nsContentUtils.h"
#include "nsEventDispatcher.h"
#include "nsDOMError.h"
#include "nsDOMProgressEvent.h"
#include "nsDOMClassInfoID.h"
#include "FileHelper.h"
@ -149,14 +150,20 @@ FileRequest::FireProgressEvent(PRUint64 aLoaded, PRUint64 aTotal)
nsRefPtr<nsDOMProgressEvent> event = new nsDOMProgressEvent(nullptr, nullptr);
nsresult rv = event->InitProgressEvent(NS_LITERAL_STRING("progress"),
false, false, false, aLoaded, aTotal);
NS_ENSURE_SUCCESS(rv,);
if (NS_FAILED(rv)) {
return;
}
rv = event->SetTrusted(true);
NS_ENSURE_SUCCESS(rv,);
if (NS_FAILED(rv)) {
return;
}
bool dummy;
rv = DispatchEvent(static_cast<nsIDOMProgressEvent*>(event), &dummy);
NS_ENSURE_SUCCESS(rv,);
if (NS_FAILED(rv)) {
return;
}
}
void

Просмотреть файл

@ -389,7 +389,9 @@ FileService::LockedFileQueue::OnFileHelperComplete(FileHelper* aFileHelper)
mCurrentHelper = nullptr;
nsresult rv = ProcessQueue();
NS_ENSURE_SUCCESS(rv,);
if (NS_FAILED(rv)) {
return;
}
}
}

Просмотреть файл

@ -6,6 +6,7 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk

Просмотреть файл

@ -1,11 +1,11 @@
# THIS FILE IS AUTOGENERATED BY parseFailures.py - DO NOT EDIT
DEPTH = ../../../../../../../..
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = dom/imptests/failures/webapps/DOMCore/tests/submissions/Ms2ger
relativesrcdir = @relativesrcdir@
DIRS = \
$(NULL)

Просмотреть файл

@ -1,11 +1,11 @@
# THIS FILE IS AUTOGENERATED BY importTestsuite.py - DO NOT EDIT
DEPTH = ../../../../../../..
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = dom/imptests/webapps/DOMCore/tests/submissions/Ms2ger
relativesrcdir = @relativesrcdir@
DIRS = \
$(NULL)

Просмотреть файл

@ -6,12 +6,12 @@ import string
makefileTemplate = """# THIS FILE IS AUTOGENERATED BY ${caller} - DO NOT EDIT
DEPTH = ${depth}
DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = ${relativesrcdir}
relativesrcdir = @relativesrcdir@
DIRS = \\
${dirs}
@ -34,8 +34,6 @@ def makefileString(entries):
def substMakefile(caller, path, subdirs, files):
result = string.Template(makefileTemplate).substitute({
"caller": caller,
"depth": "..%s" % ("/.." * path.count("/"), ),
"relativesrcdir": path,
"dirs": makefileString(subdirs)
})

Просмотреть файл

@ -1393,8 +1393,7 @@ IDBObjectStore::ConvertActorsToBlobs(
NS_ASSERTION(aFiles.IsEmpty(), "Should be empty!");
if (!aActors.IsEmpty()) {
ContentChild* contentChild = ContentChild::GetSingleton();
NS_ASSERTION(contentChild, "This should never be null!");
NS_ASSERTION(ContentChild::GetSingleton(), "This should never be null!");
PRUint32 length = aActors.Length();
aFiles.SetCapacity(length);

Просмотреть файл

@ -105,7 +105,8 @@ Key::EncodeJSValInternal(JSContext* aCx, const jsval aVal,
{
NS_ENSURE_TRUE(aRecursionDepth < MaxRecursionDepth, NS_ERROR_DOM_INDEXEDDB_DATA_ERR);
PR_STATIC_ASSERT(eMaxType * MaxArrayCollapse < 256);
MOZ_STATIC_ASSERT(eMaxType * MaxArrayCollapse < 256,
"Unable to encode jsvals.");
if (JSVAL_IS_STRING(aVal)) {
nsDependentJSString str;

Просмотреть файл

@ -6,6 +6,7 @@ DEPTH = @DEPTH@
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk

Просмотреть файл

@ -24,7 +24,8 @@ namespace {
// If JS_STRUCTURED_CLONE_VERSION changes then we need to update our major
// schema version.
PR_STATIC_ASSERT(JS_STRUCTURED_CLONE_VERSION == 1);
MOZ_STATIC_ASSERT(JS_STRUCTURED_CLONE_VERSION == 1,
"Need to update the major schema version.");
// Major schema version. Bump for almost everything.
const PRUint32 kMajorSchemaVersion = 12;
@ -36,8 +37,10 @@ const PRUint32 kMinorSchemaVersion = 0;
// The schema version we store in the SQLite database is a (signed) 32-bit
// integer. The major version is left-shifted 4 bits so the max value is
// 0xFFFFFFF. The minor version occupies the lower 4 bits and its max is 0xF.
PR_STATIC_ASSERT(kMajorSchemaVersion <= 0xFFFFFFF);
PR_STATIC_ASSERT(kMajorSchemaVersion <= 0xF);
MOZ_STATIC_ASSERT(kMajorSchemaVersion <= 0xFFFFFFF,
"Major version needs to fit in 28 bits.");
MOZ_STATIC_ASSERT(kMinorSchemaVersion <= 0xF,
"Minor version needs to fit in 4 bits.");
inline
PRInt32
@ -1800,7 +1803,8 @@ OpenDatabaseHelper::CreateDatabaseConnection(
}
else {
// This logic needs to change next time we change the schema!
PR_STATIC_ASSERT(kSQLiteSchemaVersion == PRInt32((12 << 4) + 0));
MOZ_STATIC_ASSERT(kSQLiteSchemaVersion == PRInt32((12 << 4) + 0),
"Need upgrade code from schema version increase.");
while (schemaVersion != kSQLiteSchemaVersion) {
if (schemaVersion == 4) {

Просмотреть файл

@ -314,7 +314,7 @@ class IndexedDBObjectStoreRequestChild : public IndexedDBRequestChildBase
typedef ipc::ObjectStoreRequestParams ParamsUnionType;
typedef ParamsUnionType::Type RequestType;
RequestType mRequestType;
DebugOnly<RequestType> mRequestType;
public:
IndexedDBObjectStoreRequestChild(AsyncConnectionHelper* aHelper,
@ -337,7 +337,7 @@ class IndexedDBIndexRequestChild : public IndexedDBRequestChildBase
typedef ipc::IndexRequestParams ParamsUnionType;
typedef ParamsUnionType::Type RequestType;
RequestType mRequestType;
DebugOnly<RequestType> mRequestType;
public:
IndexedDBIndexRequestChild(AsyncConnectionHelper* aHelper, IDBIndex* aIndex,
@ -359,7 +359,7 @@ class IndexedDBCursorRequestChild : public IndexedDBRequestChildBase
typedef ipc::CursorRequestParams ParamsUnionType;
typedef ParamsUnionType::Type RequestType;
RequestType mRequestType;
DebugOnly<RequestType> mRequestType;
public:
IndexedDBCursorRequestChild(AsyncConnectionHelper* aHelper,

Просмотреть файл

@ -1197,9 +1197,7 @@ IndexedDBObjectStoreRequestParent::ConvertBlobActors(
if (!aActors.IsEmpty()) {
// Walk the chain to get to ContentParent.
ContentParent* contentParent =
mObjectStore->Transaction()->Database()->GetContentParent();
MOZ_ASSERT(contentParent);
MOZ_ASSERT(mObjectStore->Transaction()->Database()->GetContentParent());
uint32_t length = aActors.Length();
aBlobs.SetCapacity(length);

Просмотреть файл

@ -494,7 +494,7 @@ class IndexedDBObjectStoreRequestParent : public IndexedDBRequestParentBase
typedef ipc::ObjectStoreRequestParams ParamsUnionType;
typedef ParamsUnionType::Type RequestType;
RequestType mRequestType;
DebugOnly<RequestType> mRequestType;
typedef ipc::AddParams AddParams;
typedef ipc::PutParams PutParams;
@ -550,7 +550,7 @@ class IndexedDBIndexRequestParent : public IndexedDBRequestParentBase
typedef ipc::IndexRequestParams ParamsUnionType;
typedef ParamsUnionType::Type RequestType;
RequestType mRequestType;
DebugOnly<RequestType> mRequestType;
typedef ipc::GetKeyParams GetKeyParams;
typedef ipc::GetAllKeysParams GetAllKeysParams;
@ -596,7 +596,7 @@ class IndexedDBCursorRequestParent : public IndexedDBRequestParentBase
typedef ipc::CursorRequestParams ParamsUnionType;
typedef ParamsUnionType::Type RequestType;
RequestType mRequestType;
DebugOnly<RequestType> mRequestType;
typedef ipc::ContinueParams ContinueParams;

Просмотреть файл

@ -7,6 +7,7 @@ topsrcdir = @top_srcdir@
srcdir = @srcdir@
relativesrcdir = @relativesrcdir@
VPATH = @srcdir@
FAIL_ON_WARNINGS := 1
include $(DEPTH)/config/autoconf.mk
@ -31,8 +32,7 @@ LOCAL_INCLUDES += \
DEFINES += -D_IMPL_NS_LAYOUT
# Bug 770046 - Cannot fail.
# MOCHITEST_FILES = test_ipc.html
MOCHITEST_FILES = test_ipc.html
# Need to enable these tests sometime soon.
#XPCSHELL_TESTS = unit
@ -49,4 +49,4 @@ copy-xpcshell-tests:
$(call install_cmd,$(wildcard $(topsrcdir)/dom/indexedDB/test/unit/test_*.js) \
$(testxpcobjdir)/$(relativesrcdir)/$(XPCSHELL_TESTS))
libs-xpcshell-tests: copy-xpcshell-tests
libs-xpcshell-tests: copy-xpcshell-tests

Просмотреть файл

@ -74,7 +74,10 @@ interface mozIDOMApplicationRegistry : nsISupports
*
* @param manifestUrl : the URL of the webapps manifest.
* @param parameters : A structure with optional information.
* { receipts: ... } will be used to specify the payment receipts for this installation.
* {
* receipts: ... Will be used to specify the payment receipts for this installation.
* categories: ... Will be used to specify the categories of the webapp.
* }
* @returns : A DOMRequest object, returning the app object in |result| if install succeeds.
*/
nsIDOMDOMRequest install(in DOMString manifestUrl, [optional] in jsval parameters);
@ -100,7 +103,10 @@ interface mozIDOMApplicationRegistry : nsISupports
*
* @param packageUrl : the URL of the webapps manifest.
* @param parameters : A structure with optional information.
* { receipts: ... } will be used to specify the payment receipts for this installation.
* {
* receipts: ... Will be used to specify the payment receipts for this installation.
* categories: ... Will be used to specify the categories of the webapp.
* }
* @returns : A DOMRequest object, returning the app object in |result| if install succeeds.
*/
nsIDOMDOMRequest installPackage(in DOMString packageUrl, [optional] in jsval parameters);

Просмотреть файл

@ -752,7 +752,7 @@ interface nsIDOMWindowUtils : nsISupports {
/**
* Synthesize a query content event.
*
* @param aType On of the following const values. And see also each comment
* @param aType One of the following const values. And see also each comment
* for the other parameters and the result.
*/
nsIQueryContentEventResult sendQueryContentEvent(in unsigned long aType,
@ -761,29 +761,6 @@ interface nsIDOMWindowUtils : nsISupports {
in long aX,
in long aY);
/**
* Called when the remote child frame has changed its fullscreen state,
* when entering fullscreen, and when the origin which is fullscreen changes.
* aFrameElement is the iframe element which contains the child-process
* fullscreen document, and aNewOrigin is the origin of the new fullscreen
* document.
*/
void remoteFrameFullscreenChanged(in nsIDOMElement aFrameElement,
in AString aNewOrigin);
/**
* Called when the remote frame has popped all fullscreen elements off its
* stack, so that the operation can complete on the parent side.
*/
void remoteFrameFullscreenReverted();
/**
* Called when the child frame has fully exit fullscreen, so that the parent
* process can also fully exit.
*/
void exitFullscreen();
// NOTE: following values are same as NS_QUERY_* in nsGUIEvent.h
/**
@ -872,6 +849,28 @@ interface nsIDOMWindowUtils : nsISupports {
*/
const unsigned long QUERY_CHARACTER_AT_POINT = 3208;
/**
* Called when the remote child frame has changed its fullscreen state,
* when entering fullscreen, and when the origin which is fullscreen changes.
* aFrameElement is the iframe element which contains the child-process
* fullscreen document, and aNewOrigin is the origin of the new fullscreen
* document.
*/
void remoteFrameFullscreenChanged(in nsIDOMElement aFrameElement,
in AString aNewOrigin);
/**
* Called when the remote frame has popped all fullscreen elements off its
* stack, so that the operation can complete on the parent side.
*/
void remoteFrameFullscreenReverted();
/**
* Called when the child frame has fully exit fullscreen, so that the parent
* process can also fully exit.
*/
void exitFullscreen();
/**
* Synthesize a selection set event to the window.
*

Просмотреть файл

@ -29,5 +29,6 @@ interface nsIDOMXULMultiSelectControlElement : nsIDOMXULSelectControlElement
// XXX - temporary, pending implementation of scriptable,
// mutable nsIDOMNodeList for selectedItems
readonly attribute long selectedCount;
[binaryname(MultiGetSelectedItem)]
nsIDOMXULSelectControlItemElement getSelectedItem(in long index);
};

Просмотреть файл

@ -189,9 +189,6 @@ private:
InfallibleTArray<nsAutoPtr<AlertObserver> > mAlertObservers;
nsRefPtr<ConsoleListener> mConsoleListener;
#ifdef ANDROID
gfxIntSize mScreenSize;
#endif
/**
* An ID unique to the process containing our corresponding
@ -204,6 +201,10 @@ private:
AppInfo mAppInfo;
#ifdef ANDROID
gfxIntSize mScreenSize;
#endif
static ContentChild* sSingleton;
DISALLOW_EVIL_CONSTRUCTORS(ContentChild);

Просмотреть файл

@ -127,7 +127,7 @@ CrashReporterParent::GenerateChildData(const AnnotationTable* processNotes)
mNotes.Put(NS_LITERAL_CSTRING("ProcessType"), type);
char startTime[32];
sprintf(startTime, "%lld", static_cast<PRInt64>(mStartTime));
sprintf(startTime, "%lld", static_cast<long long>(mStartTime));
mNotes.Put(NS_LITERAL_CSTRING("StartupTime"), nsDependentCString(startTime));
if (!mAppNotes.IsEmpty())

Просмотреть файл

@ -14,6 +14,7 @@ LIBRARY_NAME = domipc_s
LIBXUL_LIBRARY = 1
FORCE_STATIC_LIB = 1
EXPORT_LIBRARY = 1
FAIL_ON_WARNINGS := 1
ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
TEST_DIRS += tests

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше