Merge m-c to fx-team on a CLOSED TREE.

This commit is contained in:
Ryan VanderMeulen 2014-04-04 15:06:31 -04:00
Родитель 341411a7b5 ec69e2de4b
Коммит 6fc380cde2
194 изменённых файлов: 1397 добавлений и 919 удалений

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

@ -86,9 +86,9 @@ static nsRoleMapEntry sWAIRoleMaps[] =
eNoValue,
ePressAction,
eNoLiveAttr,
kGenericAccType,
kNoReqStates,
eARIAPressed
eButton,
kNoReqStates
// eARIAPressed is auto applied on any button
},
{ // checkbox
&nsGkAtoms::checkbox,

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

@ -245,7 +245,7 @@ aria::MapToState(EStateRule aRule, dom::Element* aElement, uint64_t* aState)
{
static const TokenTypeData data(
nsGkAtoms::aria_pressed, eMixedType,
states::CHECKABLE, states::PRESSED);
0, states::PRESSED);
MapTokenType(aElement, aState, data);
return true;

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

@ -69,16 +69,17 @@ enum AccType {
enum AccGenericType {
eAutoComplete = 1 << 0,
eAutoCompletePopup = 1 << 1,
eCombobox = 1 << 2,
eDocument = 1 << 3,
eHyperText = 1 << 4,
eList = 1 << 5,
eListControl = 1 << 6,
eMenuButton = 1 << 7,
eSelect = 1 << 8,
eTable = 1 << 9,
eTableCell = 1 << 10,
eTableRow = 1 << 11,
eButton = 1 << 2,
eCombobox = 1 << 3,
eDocument = 1 << 4,
eHyperText = 1 << 5,
eList = 1 << 6,
eListControl = 1 << 7,
eMenuButton = 1 << 8,
eSelect = 1 << 9,
eTable = 1 << 10,
eTableCell = 1 << 11,
eTableRow = 1 << 12,
eLastAccGenericType = eTableRow
};

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

@ -1573,6 +1573,10 @@ Accessible::ApplyARIAState(uint64_t* aState) const
}
}
// special case: A native button element whose role got transformed by ARIA to a toggle button
if (IsButton())
aria::MapToState(aria::eARIAPressed, element, aState);
if (!mRoleMapEntry)
return;

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

@ -521,6 +521,8 @@ public:
bool IsAutoCompletePopup() const
{ return HasGenericType(eAutoCompletePopup); }
bool IsButton() const { return HasGenericType(eButton); }
bool IsCombobox() const { return HasGenericType(eCombobox); }
bool IsDoc() const { return HasGenericType(eDocument); }
@ -990,7 +992,7 @@ protected:
static const uint8_t kStateFlagsBits = 7;
static const uint8_t kContextFlagsBits = 1;
static const uint8_t kTypeBits = 6;
static const uint8_t kGenericTypesBits = 12;
static const uint8_t kGenericTypesBits = 13;
/**
* Keep in sync with ChildrenFlags, StateFlags, ContextFlags, and AccTypes.

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

@ -1066,17 +1066,10 @@ DocAccessible::ARIAAttributeChanged(Accessible* aAccessible, nsIAtom* aAttribute
aAccessible);
nsIContent* elm = aAccessible->GetContent();
if (!elm->HasAttr(kNameSpaceID_None, nsGkAtoms::role)) {
// We don't care about these other ARIA attribute changes unless there is
// an ARIA role set for the element
// XXX: we should check the role map to see if the changed property is
// relevant for that particular role.
return;
}
// The following ARIA attributes only take affect when dynamic content role is present
if (aAttribute == nsGkAtoms::aria_checked ||
aAttribute == nsGkAtoms::aria_pressed) {
(aAccessible->IsButton() &&
aAttribute == nsGkAtoms::aria_pressed)) {
const uint64_t kState = (aAttribute == nsGkAtoms::aria_checked) ?
states::CHECKED : states::PRESSED;
nsRefPtr<AccEvent> event = new AccStateChangeEvent(aAccessible, kState);

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

@ -180,6 +180,7 @@ HTMLButtonAccessible::
HTMLButtonAccessible(nsIContent* aContent, DocAccessible* aDoc) :
HyperTextAccessibleWrap(aContent, aDoc)
{
mGenericTypes |= eButton;
}
uint8_t

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

@ -632,6 +632,11 @@ this.UtteranceGenerator = {
stateUtterances.push(Utils.stringBundle.GetStringFromName(statetr));
}
if (aState.contains(States.PRESSED)) {
stateUtterances.push(
Utils.stringBundle.GetStringFromName('statePressed'));
}
if (aState.contains(States.EXPANDABLE)) {
let statetr = aState.contains(States.EXPANDED) ?
'stateExpanded' : 'stateCollapsed';
@ -783,7 +788,7 @@ this.BrailleGenerator = {
_useStateNotRole: function _useStateNotRole(aAccessible, aRoleStr, aState, aFlags) {
let braille = [];
let desc = this._getLocalizedState(aState);
let desc = this._getLocalizedState(aState, aAccessible.role);
braille.push(desc.join(' '));
this._addName(braille, aAccessible, aFlags);
@ -831,24 +836,25 @@ this.BrailleGenerator = {
}
},
_getLocalizedState: function _getLocalizedState(aState) {
_getLocalizedState: function _getLocalizedState(aState, aRole) {
let stateBraille = [];
let getCheckedState = function getCheckedState() {
let getResultMarker = function getResultMarker(aMarker) {
// aMarker is a simple boolean.
let resultMarker = [];
let state = aState;
let fill = state.contains(States.CHECKED) ||
state.contains(States.PRESSED);
resultMarker.push('(');
resultMarker.push(fill ? 'x' : ' ');
resultMarker.push(aMarker ? 'x' : ' ');
resultMarker.push(')');
return resultMarker.join('');
};
if (aState.contains(States.CHECKABLE)) {
stateBraille.push(getCheckedState());
stateBraille.push(getResultMarker(aState.contains(States.CHECKED)));
}
if (aRole === Roles.TOGGLE_BUTTON) {
stateBraille.push(getResultMarker(aState.contains(States.PRESSED)));
}
return stateBraille;

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

@ -40,8 +40,11 @@ XULButtonAccessible::
XULButtonAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc)
{
if (ContainsMenu())
if (ContainsMenu()) {
mGenericTypes |= eMenuButton;
} else {
mGenericTypes |= eButton;
}
}
////////////////////////////////////////////////////////////////////////////////

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

@ -133,6 +133,7 @@
gQueue.push(new busyify("aria_doc", false));
buildQueueForAttrOfMixedType(gQueue, "pressable", setPressed);
buildQueueForAttrOfMixedType(gQueue, "pressable_native", setPressed);
buildQueueForAttrOfMixedType(gQueue, "checkable", setChecked);
gQueue.invoke(); // Will call SimpleTest.finish();
@ -160,6 +161,11 @@
title="mixed state change event is fired for focused accessible only"
Mozilla Bug 467143
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=989958"
title="Pressed state is not exposed on a button element with aria-pressed attribute"
Mozilla Bug 989958
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
@ -176,6 +182,7 @@
<!-- aria-pressed -->
<div id="pressable" role="button"></div>
<button id="pressable_native"></button>
<!-- aria-checked -->
<div id="checkable" role="checkbox"></div>

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

@ -329,14 +329,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=753984
["a unique radio button", "(x)"]]
},{
accOrElmOrID: "togglebutton_notpressed",
expectedUtterance: [["not checked toggle button", "I ain't pressed"],
["I ain't pressed", "not checked toggle button"]],
expectedUtterance: [["toggle button", "I ain't pressed"],
["I ain't pressed", "toggle button"]],
expectedBraille: [["( )", "I ain't pressed"],
["I ain't pressed", "( )"]]
},{
accOrElmOrID: "togglebutton_pressed",
expectedUtterance: [["not checked toggle button", "I am pressed!"],
["I am pressed!", "not checked toggle button"]],
expectedUtterance: [["pressed toggle button", "I am pressed!"],
["I am pressed!", "pressed toggle button"]],
expectedBraille: [["(x)", "I am pressed!"],
["I am pressed!", "(x)"]]
}

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

@ -140,7 +140,8 @@ function testStates(aAccOrElmOrID, aState, aExtraState, aAbsentState,
}
// checked/mixed/checkable
if (state & STATE_CHECKED || state & STATE_MIXED && role != ROLE_PROGRESSBAR)
if (state & STATE_CHECKED || state & STATE_MIXED &&
role != ROLE_TOGGLE_BUTTON && role != ROLE_PROGRESSBAR)
isState(state & STATE_CHECKABLE, STATE_CHECKABLE, false,
"Checked or mixed element must be checkable!");

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

@ -105,7 +105,8 @@
STATE_MULTISELECTABLE | STATE_EXTSELECTABLE);
// aria-pressed
testStates("aria_pressed_button", STATE_PRESSED | STATE_CHECKABLE);
testStates("aria_pressed_button", STATE_PRESSED, 0, STATE_CHECKABLE);
testStates("aria_pressed_native_button", STATE_PRESSED, 0, STATE_CHECKABLE);
// aria-readonly
testStates("aria_readonly_textbox", STATE_READONLY);
@ -313,6 +314,11 @@
title="ARIA grid should be editable by default">
Mozilla Bug 835121
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=989958"
title="Pressed state is not exposed on a button element with aria-pressed attribute"
Mozilla Bug 989958
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
@ -349,6 +355,7 @@
<div id="aria_multiline_textbox" role="textbox" aria-multiline="true"></div>
<div id="aria_multiselectable_listbox" role="listbox" aria-multiselectable="true"></div>
<div id="aria_pressed_button" role="button" aria-pressed="true">Button</div>
<button id="aria_pressed_native_button" aria-pressed="true">Button</button>
<div id="aria_readonly_textbox"
role="textbox" aria-readonly="true">This text should be readonly</div>

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

@ -28,8 +28,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=452388
testRole("button_pressed_absent", ROLE_PUSHBUTTON);
// test button aria-pressed states
testStates("button_pressed_true", STATE_PRESSED | STATE_CHECKABLE);
testStates("button_pressed_false", STATE_CHECKABLE, 0, STATE_PRESSED);
testStates("button_pressed_true", STATE_PRESSED, 0, STATE_CHECKABLE);
testStates("button_pressed_false", 0, 0, STATE_CHECKABLE | STATE_PRESSED);
testStates("button_pressed_empty", 0, 0, STATE_PRESSED | STATE_CHECKABLE);
testStates("button_pressed_undefined", 0, 0, STATE_PRESSED | STATE_CHECKABLE);
testStates("button_pressed_absent", 0, 0, STATE_PRESSED | STATE_CHECKABLE);
@ -183,6 +183,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=452388
title="Unify ARIA state attributes mapping rules">
Mozilla Bug 499653
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=989958"
title="Pressed state is not exposed on a button element with aria-pressed attribute"
Mozilla Bug 989958
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">

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

@ -415,7 +415,7 @@ pref("dom.navigator-property.disable.mozContacts", false);
pref("dom.global-constructor.disable.mozContact", false);
// Shortnumber matching needed for e.g. Brazil:
// 01187654321 can be found with 87654321
// 03187654321 can be found with 87654321
pref("dom.phonenumber.substringmatching.BR", 8);
pref("dom.phonenumber.substringmatching.CO", 10);
pref("dom.phonenumber.substringmatching.VE", 7);

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d9a574284d672f532f7c562a091bb01f531202b1"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="3c917f7ca3d5988d0e6f6b545008643da1217fc5"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d11f524d00cacf5ba0dfbf25e4aa2158b1c3a036"/>

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

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="d9a574284d672f532f7c562a091bb01f531202b1"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="3c917f7ca3d5988d0e6f6b545008643da1217fc5"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="70b698c2e8d1764a1e27527a102df6452e405b9a"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="89c5816399e71bda92a8959b5b771c04d6672ea3"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="a9e08b91e9cd1f0930f16cfc49ec72f63575d5fe">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="d9a574284d672f532f7c562a091bb01f531202b1"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="3c917f7ca3d5988d0e6f6b545008643da1217fc5"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="70b698c2e8d1764a1e27527a102df6452e405b9a"/>

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d9a574284d672f532f7c562a091bb01f531202b1"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="3c917f7ca3d5988d0e6f6b545008643da1217fc5"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d11f524d00cacf5ba0dfbf25e4aa2158b1c3a036"/>

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

@ -4,6 +4,6 @@
"remote": "",
"branch": ""
},
"revision": "ac34484ce7f6a5ba71784e03a683bc91a3ebc6e4",
"revision": "1c4cb51103918927ba1431bd2c26b0506ce7402e",
"repo_path": "/integration/gaia-central"
}

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

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d9a574284d672f532f7c562a091bb01f531202b1"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="3c917f7ca3d5988d0e6f6b545008643da1217fc5"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

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

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d9a574284d672f532f7c562a091bb01f531202b1"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="3c917f7ca3d5988d0e6f6b545008643da1217fc5"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d9a574284d672f532f7c562a091bb01f531202b1"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="3c917f7ca3d5988d0e6f6b545008643da1217fc5"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

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

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d9a574284d672f532f7c562a091bb01f531202b1"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="3c917f7ca3d5988d0e6f6b545008643da1217fc5"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

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

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="d9a574284d672f532f7c562a091bb01f531202b1"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="3c917f7ca3d5988d0e6f6b545008643da1217fc5"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="70b698c2e8d1764a1e27527a102df6452e405b9a"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="89c5816399e71bda92a8959b5b771c04d6672ea3"/>

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

@ -17,7 +17,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="d9a574284d672f532f7c562a091bb01f531202b1"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="3c917f7ca3d5988d0e6f6b545008643da1217fc5"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="266bca6e60dad43e395f38b66edabe8bdc882334"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1f6a1fe07f81c5bc5e1d079c9b60f7f78ca2bf4f"/>

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

@ -48,10 +48,12 @@ def process_package_overload(src, dst, version, app_buildid):
# First replace numeric version like '1.3'
# Then replace with 'slashed' version like '1_4'
# Finally set the full length addon version like 1.3.20131230
# (reduce the app build id to only the build date
# as addon manager doesn't handle big ints in addon versions)
defines = {
"NUM_VERSION": version,
"SLASH_VERSION": version.replace(".", "_"),
"FULL_VERSION": ("%s.%s" % (version, app_buildid))
"FULL_VERSION": ("%s.%s" % (version, app_buildid[:8]))
}
pp = Preprocessor(defines=defines)
pp.do_filter("substitution")

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

@ -145,8 +145,10 @@ exports.SimulatorProcess = Class({
Linux: "b2g-bin",
};
console.log("bin url: "+bin+"/"+executables[Runtime.OS]);
let path = bin + "/" + executables[Runtime.OS];
let path = bin;
path += Runtime.OS == "WINNT" ? "\\" : "/";
path += executables[Runtime.OS];
console.log("simulator path: " + path);
let executable = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
executable.initWithPath(path);

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

@ -1415,6 +1415,10 @@ pref("ui.key.menuAccessKeyFocuses", true);
// Delete HTTP cache v2 data of users that didn't opt-in manually
pref("browser.cache.auto_delete_cache_version", 1);
// Play with different values of the decay time and get telemetry,
// 0 means to randomize (and persist) the experiment value in users' profiles,
// -1 means no experiment is run and we use the preferred value for frecency (6h)
pref("browser.cache.frecency_experiment", 0);
// Telemetry experiments settings.
pref("experiments.enabled", false);

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

@ -81,6 +81,8 @@ SessionStartup.prototype = {
* Initialize the component
*/
init: function sss_init() {
Services.obs.notifyObservers(null, "sessionstore-init-started", null);
// do not need to initialize anything in auto-started private browsing sessions
if (PrivateBrowsingUtils.permanentPrivateBrowsing) {
this._initialized = true;

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

@ -242,6 +242,15 @@ add_task(function formdata() {
}
});
add_task(function* test_sessionRestoreInit() {
let info = Cc["@mozilla.org/toolkit/app-startup;1"].
getService(Ci.nsIAppStartup).
getStartupInfo();
ok(info.sessionRestoreInit > info.process, "sessionRestoreInit is after process creation");
ok(info.sessionRestoreInit <
Date.now() + 10000 /* Date.now() is non-monotonic, let's play it paranoid*/,
"sessionRestoreInit is before now");
});
/**
* Get the latest statistics.

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

@ -196,6 +196,11 @@ private:
void add_code_section(ElfSection *section)
{
if (section) {
/* Don't add section if it's already been added in the past */
for (auto s = code.begin(); s != code.end(); ++s) {
if (section == *s)
return;
}
code.push_back(section);
find_code(section);
}
@ -224,13 +229,6 @@ private:
ElfSymtab_Section *symtab = (ElfSymtab_Section *)rel->getLink();
for (auto r = rel->rels.begin(); r != rel->rels.end(); r++) {
ElfSection *section = symtab->syms[ELF32_R_SYM(r->r_info)].value.getSection();
if (section) {
for (ElfSection *s = elf->getSection(1); s != nullptr; s = s->getNext()) {
if (section == s)
section = nullptr;
break;
}
}
add_code_section(section);
}
}

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

@ -209,7 +209,7 @@ $(OBJDIR)/.mozconfig.mk: $(FOUND_MOZCONFIG) $(call mkdir_deps,$(OBJDIR)) $(OBJDI
# Include that makefile so that it is created. This should not actually change
# the environment since MOZCONFIG_CONTENT, which MOZCONFIG_OUT_LINES derives
# from, has already been eval'ed.
-include $(OBJDIR)/.mozconfig.mk
include $(OBJDIR)/.mozconfig.mk
endif
# Print out any options loaded from mozconfig.

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

@ -797,7 +797,7 @@ nsDOMTemporaryFileBlob::CreateSlice(uint64_t aStart, uint64_t aLength,
NS_IMETHODIMP
nsDOMTemporaryFileBlob::GetInternalStream(nsIInputStream **aStream)
{
nsCOMPtr<nsTemporaryFileInputStream> stream =
nsCOMPtr<nsIInputStream> stream =
new nsTemporaryFileInputStream(mFileDescOwner, mStartPos, mStartPos + mLength);
stream.forget(aStream);
return NS_OK;

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

@ -580,6 +580,7 @@ GK_ATOM(minimum_scale, "minimum-scale")
GK_ATOM(minpos, "minpos")
GK_ATOM(minusSign, "minus-sign")
GK_ATOM(minwidth, "minwidth")
GK_ATOM(_mixed, "mixed")
GK_ATOM(mod, "mod")
GK_ATOM(mode, "mode")
GK_ATOM(modifiers, "modifiers")

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

@ -404,6 +404,13 @@ DecoderTraits::CanHandleMediaType(const char* aMIMEType,
}
}
#endif
#ifdef MOZ_DIRECTSHOW
// Note: DirectShow should come before WMF, so that we prefer DirectShow's
// MP3 support over WMF's.
if (DirectShowDecoder::GetSupportedCodecs(nsDependentCString(aMIMEType), &codecList)) {
result = CANPLAY_MAYBE;
}
#endif
#ifdef MOZ_WMF
if (IsWMFSupportedType(nsDependentCString(aMIMEType))) {
if (!aHaveRequestedCodecs) {
@ -414,11 +421,6 @@ DecoderTraits::CanHandleMediaType(const char* aMIMEType,
? CANPLAY_YES : CANPLAY_NO;
}
#endif
#ifdef MOZ_DIRECTSHOW
if (DirectShowDecoder::GetSupportedCodecs(nsDependentCString(aMIMEType), &codecList)) {
result = CANPLAY_MAYBE;
}
#endif
#ifdef MOZ_APPLEMEDIA
if (IsAppleMediaSupportedType(nsDependentCString(aMIMEType), &codecList)) {
result = CANPLAY_MAYBE;
@ -523,8 +525,8 @@ InstantiateDecoder(const nsACString& aType, MediaDecoderOwner* aOwner)
}
#endif
#ifdef MOZ_DIRECTSHOW
// Note: DirectShow decoder must come before WMFDecoder, else the pref
// "media.directshow.preferred" won't be honored.
// Note: DirectShow should come before WMF, so that we prefer DirectShow's
// MP3 support over WMF's.
if (IsDirectShowSupportedType(aType)) {
decoder = new DirectShowDecoder();
return decoder.forget();

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

@ -1379,6 +1379,28 @@ nsresult OggReader::Seek(int64_t aTarget,
}
}
if (HasVideo()) {
// Decode forwards until we find the next keyframe. This is required,
// as although the seek should finish on a page containing a keyframe,
// there may be non-keyframes in the page before the keyframe.
// When doing fastSeek we display the first frame after the seek, so
// we need to advance the decode to the keyframe otherwise we'll get
// visual artifacts in the first frame output after the seek.
bool skip = true;
while (DecodeVideoFrame(skip, 0) && skip) {
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
if (mDecoder->IsShutdown()) {
return NS_ERROR_FAILURE;
}
}
#ifdef DEBUG
const VideoData* v = mVideoQueue.PeekFront();
if (!v || !v->mKeyframe) {
NS_WARNING("Ogg seek didn't end up before a key frame!");
}
#endif
}
return NS_OK;
}

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

@ -61,7 +61,7 @@ static bool GetIntPref(const char* aPref, int32_t* aResult)
// can only be called on the main thread. Post a runnable and wait.
NS_ENSURE_TRUE(aPref, false);
NS_ENSURE_TRUE(aResult, false);
nsCOMPtr<GetIntPrefEvent> event = new GetIntPrefEvent(aPref, aResult);
nsCOMPtr<nsIRunnable> event = new GetIntPrefEvent(aPref, aResult);
return NS_SUCCEEDED(NS_DispatchToMainThread(event, NS_DISPATCH_SYNC));
}

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

@ -8,6 +8,7 @@ var gSmallTests = [
{ name:"small-shot.ogg", type:"audio/ogg", duration:0.276 },
{ name:"small-shot.m4a", type:"audio/mp4", duration:0.29 },
{ name:"small-shot.mp3", type:"audio/mpeg", duration:0.27 },
{ name:"small-shot-mp3.mp4", type:"audio/mp4; codecs=mp3", duration:0.34 },
{ name:"r11025_s16_c1.wav", type:"audio/x-wav", duration:1.0 },
{ name:"320x240.ogv", type:"video/ogg", width:320, height:240, duration:0.266 },
{ name:"seek.webm", type:"video/webm", width:320, height:240, duration:3.966 },
@ -356,7 +357,10 @@ var gFastSeekTests = [
{ name:"gizmo.mp4", type:"video/mp4", keyframes:[0, 1.0, 2.0, 3.0, 4.0, 5.0 ] },
// Note: Not all keyframes in the file are actually referenced in the Cues in this file.
{ name:"seek.webm", type:"video/webm", keyframes:[0, 0.8, 1.6, 2.4, 3.2]},
// Note: omitting Ogg from this test, as I'm not sure our Ogg seek code is optimal/correct - cpearce
// Note: the sync points are the points on both the audio and video streams
// before the keyframes. You can't just assume that the keyframes are the sync
// points, as the audio required for that sync point may be before the keyframe.
{ name:"bug516323.indexed.ogv", type:"video/ogg", keyframes:[0, 0.46, 3.06] },
];
function IsWindows8OrLater() {

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

@ -226,6 +226,8 @@ support-files =
seek_with_sound.ogg^headers^
short-video.ogv
short-video.ogv^headers^
small-shot-mp3.mp4
small-shot-mp3.mp4^headers^
small-shot.m4a
small-shot.mp3
small-shot.mp3^headers^

Двоичные данные
content/media/test/small-shot-mp3.mp4 Normal file

Двоичный файл не отображается.

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

@ -0,0 +1 @@
Cache-Control: no-store

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

@ -29,21 +29,18 @@ bool
WMFDecoder::IsMP3Supported()
{
MOZ_ASSERT(NS_IsMainThread(), "Must be on main thread.");
#ifdef MOZ_DIRECTSHOW
if (DirectShowDecoder::IsEnabled()) {
// DirectShowDecoder is enabled, we use that in preference to the WMF
// backend.
return false;
}
#endif
if (!MediaDecoder::IsWMFEnabled()) {
return false;
}
// MP3 works fine in WMF on Windows Vista and Windows 8.
if (!IsWin7OrLater()) {
return true;
}
// MP3 support is disabled if we're on Windows 7 and no service pack
// is installed, as it's crashy on Win7 SP0.
// MP3 support is disabled if we're on Windows 7 and no service packs are
// installed, since it's crashy. Win7 with service packs is not so crashy,
// so we enable it there. Note we prefer DirectShow for MP3 playback, but
// we still support MP3 in MP4 via WMF, or MP3 in WMF if DirectShow is
// disabled.
return IsWin7SP1OrLater();
}
@ -109,9 +106,11 @@ WMFDecoder::CanPlayType(const nsACString& aType,
return !aCodecs.Length() || aCodecs.EqualsASCII("mp3");
}
// AAC-LC in M4A.
// AAC-LC or MP3 in M4A.
if (aType.EqualsASCII("audio/mp4") || aType.EqualsASCII("audio/x-m4a")) {
return !aCodecs.Length() || aCodecs.EqualsASCII("mp4a.40.2");
return !aCodecs.Length() ||
aCodecs.EqualsASCII("mp4a.40.2") ||
aCodecs.EqualsASCII("mp3");
}
if (!aType.EqualsASCII("video/mp4")) {
@ -126,6 +125,7 @@ WMFDecoder::CanPlayType(const nsACString& aType,
const nsSubstring& token = tokenizer.nextToken();
expectMoreTokens = tokenizer.separatorAfterCurrentToken();
if (token.EqualsASCII("mp4a.40.2") || // AAC-LC
token.EqualsASCII("mp3") ||
IsSupportedH264Codec(token)) {
continue;
}

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

@ -536,7 +536,7 @@ WMFReader::ReadMetadata(MediaInfo* aInfo,
hr = GetSourceReaderDuration(mSourceReader, duration);
if (SUCCEEDED(hr)) {
ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
mDecoder->SetMediaDuration(duration);
mDecoder->SetMediaEndTime(duration);
}
// We can seek if we get a duration *and* the reader reports that it's
// seekable.

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

@ -929,7 +929,7 @@ nsDocShell::Init()
// We want to hold a strong ref to the loadgroup, so it better hold a weak
// ref to us... use an InterfaceRequestorProxy to do this.
nsCOMPtr<InterfaceRequestorProxy> proxy =
nsCOMPtr<nsIInterfaceRequestor> proxy =
new InterfaceRequestorProxy(static_cast<nsIInterfaceRequestor*>
(this));
NS_ENSURE_TRUE(proxy, NS_ERROR_OUT_OF_MEMORY);

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

@ -126,7 +126,7 @@ public:
return NS_OK;
}
nsRefPtr<AudioChannelAgent> mAgent;
nsCOMPtr<nsIAudioChannelAgent> mAgent;
AudioChannelType mType;
bool mWaitCallback;
bool mRegistered;

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

@ -434,8 +434,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
NS_DEFINE_CLASSINFO_DATA(CSSFontFaceRule, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(EventListenerInfo, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CHROME_ONLY_CLASSINFO_DATA(ContentFrameMessageManager, nsEventTargetSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS |
nsIXPCScriptable::IS_GLOBAL_OBJECT)
@ -1106,10 +1104,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_MAP_ENTRY(nsIDOMCSSFontFaceRule)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(EventListenerInfo, nsIEventListenerInfo)
DOM_CLASSINFO_MAP_ENTRY(nsIEventListenerInfo)
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN_NO_CLASS_IF(ContentFrameMessageManager, nsISupports)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMEventTarget)
DOM_CLASSINFO_MAP_ENTRY(nsIMessageListenerManager)

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

@ -83,8 +83,6 @@ DOMCI_CLASS(MozMobileConnection)
// @font-face in CSS
DOMCI_CLASS(CSSFontFaceRule)
DOMCI_CLASS(EventListenerInfo)
DOMCI_CLASS(ContentFrameMessageManager)
DOMCI_CLASS(ChromeMessageBroadcaster)
DOMCI_CLASS(ChromeMessageSender)

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

@ -2944,16 +2944,8 @@ class IDLArgument(IDLObjectWithIdentifier):
elif self.type.isAny():
assert (self.defaultValue is None or
isinstance(self.defaultValue, IDLNullValue))
if (self.optional and not self.variadic and
not self.dictionaryMember and not self.defaultValue):
raise WebIDLError("Arguments of type 'any' are always optional "
"and shouldn't have the 'optional' keyword "
"unless they're being given a default value "
"of 'null'",
[self.location])
# 'any' values are always optional.
self.optional = True
if not self.defaultValue and not self.variadic:
# optional 'any' values always have a default value
if self.optional and not self.defaultValue and not self.variadic:
# Set the default value to undefined, for simplicity, so the
# codegen doesn't have to special-case this.
self.defaultValue = IDLUndefinedValue(self.location)
@ -4355,9 +4347,9 @@ class Parser(Tokenizer):
raise WebIDLError("Mandatory arguments can't have a default value.",
[self.getLocation(p, 6)])
# We can't test t.isAny() here and force optional to true, since at this
# point t is not a fully resolved type yet (e.g. it might be a typedef).
# We'll handle the 'any' case in IDLArgument.complete.
# We can't test t.isAny() here and give it a default value as needed,
# since at this point t is not a fully resolved type yet (e.g. it might
# be a typedef). We'll handle the 'any' case in IDLArgument.complete.
if variadic:
if optional:

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

@ -112,7 +112,7 @@ def WebIDLTest(parser, harness):
checkMethod(methods[11], "::TestMethods::setAny",
"setAny",
[("Void",
[("::TestMethods::setAny::arg1", "arg1", "Any", True, False)])])
[("::TestMethods::setAny::arg1", "arg1", "Any", False, False)])])
checkMethod(methods[12], "::TestMethods::doFloats",
"doFloats",
[("Float",

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

@ -472,6 +472,7 @@ public:
// Any types
void PassAny(JSContext*, JS::Handle<JS::Value>);
void PassVariadicAny(JSContext*, const Sequence<JS::Value>&);
void PassOptionalAny(JSContext*, JS::Handle<JS::Value>);
void PassAnyDefaultNull(JSContext*, JS::Handle<JS::Value>);
void PassSequenceOfAny(JSContext*, const Sequence<JS::Value>&);
void PassNullableSequenceOfAny(JSContext*, const Nullable<Sequence<JS::Value> >&);

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

@ -110,8 +110,7 @@ interface OnlyForUseInConstructor {
NamedConstructor=Test,
NamedConstructor=Test(DOMString str),
NamedConstructor=Test2(DictForConstructor dict, any any1, object obj1,
object? obj2, sequence<Dict> seq,
optional any any2 = null,
object? obj2, sequence<Dict> seq, optional any any2,
optional object obj3, optional object? obj4)
]
interface TestInterface {
@ -429,6 +428,7 @@ interface TestInterface {
// Any types
void passAny(any arg);
void passVariadicAny(any... arg);
void passOptionalAny(optional any arg);
void passAnyDefaultNull(optional any arg = null);
void passSequenceOfAny(sequence<any> arg);
void passNullableSequenceOfAny(sequence<any>? arg);

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

@ -12,8 +12,7 @@
NamedConstructor=Example,
NamedConstructor=Example(DOMString str),
NamedConstructor=Example2(DictForConstructor dict, any any1, object obj1,
object? obj2, sequence<Dict> seq,
optional any any2 = null,
object? obj2, sequence<Dict> seq, optional any any2,
optional object obj3, optional object? obj4)
]
interface TestExampleInterface {
@ -322,6 +321,7 @@ interface TestExampleInterface {
// Any types
void passAny(any arg);
void passVariadicAny(any... arg);
void passOptionalAny(optional any arg);
void passAnyDefaultNull(optional any arg = null);
void passSequenceOfAny(sequence<any> arg);
void passNullableSequenceOfAny(sequence<any>? arg);

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

@ -23,7 +23,7 @@ enum MyTestEnum {
TestInterface? iface, long arg1,
DictForConstructor dict, any any1,
object obj1,
object? obj2, sequence<Dict> seq, optional any any2 = null,
object? obj2, sequence<Dict> seq, optional any any2,
optional object obj3,
optional object? obj4),
JSImplementation="@mozilla.org/test-js-impl-interface;1"]
@ -344,6 +344,7 @@ interface TestJSImplInterface {
// Any types
void passAny(any arg);
void passVariadicAny(any... arg);
void passOptionalAny(optional any arg);
void passAnyDefaultNull(optional any arg = null);
void passSequenceOfAny(sequence<any> arg);
void passNullableSequenceOfAny(sequence<any>? arg);

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

@ -28,6 +28,11 @@
using namespace mozilla;
USING_BLUETOOTH_NAMESPACE
// AVRC_ID op code follows bluedroid avrc_defs.h
#define AVRC_ID_REWIND 0x48
#define AVRC_ID_FAST_FOR 0x49
#define AVRC_KEY_PRESS_STATE 1
#define AVRC_KEY_RELEASE_STATE 0
namespace {
StaticRefPtr<BluetoothA2dpManager> sBluetoothA2dpManager;
@ -178,6 +183,29 @@ private:
uint8_t mNumAttr;
btrc_media_attr_t* mPlayerAttrs;
};
class UpdatePassthroughCmdTask : public nsRunnable
{
public:
UpdatePassthroughCmdTask(const nsAString& aName)
: mName(aName)
{
MOZ_ASSERT(!NS_IsMainThread());
}
nsresult Run()
{
MOZ_ASSERT(NS_IsMainThread());
NS_NAMED_LITERAL_STRING(type, "media-button");
BroadcastSystemMessage(type, BluetoothValue(mName));
return NS_OK;
}
private:
nsString mName;
};
#endif
NS_IMETHODIMP
@ -409,13 +437,38 @@ AvrcpRemoteVolumeChangedCallback(uint8_t aVolume, uint8_t aCType)
}
/*
* This callback function is to get notification that volume changed on the
* remote car kit (if it supports Avrcp 1.4), not notification from phone.
* This callback function is to handle passthrough commands.
*/
static void
AvrcpPassThroughCallback(int id, int key_state)
AvrcpPassThroughCallback(int aId, int aKeyState)
{
// TODO: Support avrcp 1.4 absolute volume/browse
// Fast-forward and rewind key events won't be generated from bluedroid
// stack after ANDROID_VERSION > 18, but via passthrough callback.
nsAutoString name;
NS_ENSURE_TRUE_VOID(aKeyState == AVRC_KEY_PRESS_STATE ||
aKeyState == AVRC_KEY_RELEASE_STATE);
switch (aId) {
case AVRC_ID_FAST_FOR:
if (aKeyState == AVRC_KEY_PRESS_STATE) {
name.AssignLiteral("media-fast-forward-button-press");
} else {
name.AssignLiteral("media-fast-forward-button-release");
}
break;
case AVRC_ID_REWIND:
if (aKeyState == AVRC_KEY_PRESS_STATE) {
name.AssignLiteral("media-rewind-button-press");
} else {
name.AssignLiteral("media-rewind-button-release");
}
break;
default:
BT_WARNING("Unable to handle the unknown PassThrough command %d", aId);
break;
}
if (!name.IsEmpty()) {
NS_DispatchToMainThread(new UpdatePassthroughCmdTask(name));
}
}
#endif

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

@ -107,29 +107,40 @@ SetJsObject(JSContext* aContext,
bool
BroadcastSystemMessage(const nsAString& aType,
const InfallibleTArray<BluetoothNamedValue>& aData)
const BluetoothValue& aData)
{
mozilla::AutoSafeJSContext cx;
NS_ASSERTION(!::JS_IsExceptionPending(cx),
"Shouldn't get here when an exception is pending!");
JS::Rooted<JSObject*> obj(cx, JS_NewObject(cx, nullptr, JS::NullPtr(),
JS::NullPtr()));
if (!obj) {
BT_WARNING("Failed to new JSObject for system message!");
return false;
}
if (!SetJsObject(cx, aData, obj)) {
BT_WARNING("Failed to set properties of system message!");
return false;
}
nsCOMPtr<nsISystemMessagesInternal> systemMessenger =
do_GetService("@mozilla.org/system-message-internal;1");
NS_ENSURE_TRUE(systemMessenger, false);
JS::Rooted<JS::Value> value(cx, JS::ObjectValue(*obj));
JS::Rooted<JS::Value> value(cx);
if (aData.type() == BluetoothValue::TnsString) {
JSString* jsData = JS_NewUCStringCopyN(cx,
aData.get_nsString().BeginReading(),
aData.get_nsString().Length());
value = STRING_TO_JSVAL(jsData);
} else if (aData.type() == BluetoothValue::TArrayOfBluetoothNamedValue) {
JS::Rooted<JSObject*> obj(cx, JS_NewObject(cx, nullptr, JS::NullPtr(),
JS::NullPtr()));
if (!obj) {
BT_WARNING("Failed to new JSObject for system message!");
return false;
}
if (!SetJsObject(cx, aData, obj)) {
BT_WARNING("Failed to set properties of system message!");
return false;
}
value = JS::ObjectValue(*obj);
} else {
BT_WARNING("Not support the unknown BluetoothValue type");
return false;
}
systemMessenger->BroadcastMessage(aType, value,
JS::UndefinedHandleValue);

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

@ -36,7 +36,7 @@ SetJsObject(JSContext* aContext,
bool
BroadcastSystemMessage(const nsAString& aType,
const InfallibleTArray<BluetoothNamedValue>& aData);
const BluetoothValue& aData);
void
DispatchBluetoothReply(BluetoothReplyRunnable* aRunnable,

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

@ -22,12 +22,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=877302
"use strict";
var substringLength = 8;
SpecialPowers.setIntPref("dom.phonenumber.substringmatching.BR", substringLength);
SpecialPowers.setCharPref("ril.lastKnownSimMcc", "724");
var sample_id1;
var createResult1;
var findResult1;
var prop = {
tel: [{value: "7932012345" }, {value: "7932012346"}]
@ -338,13 +332,16 @@ var steps = [
},
function () {
ok(true, "all done!\n");
SpecialPowers.clearUserPref("dom.phonenumber.substringmatching.BR");
SpecialPowers.clearUserPref("ril.lastKnownSimMcc");
SimpleTest.finish();
}
];
start_tests();
SpecialPowers.pushPrefEnv({
set: [
["dom.phonenumber.substringmatching.BR", substringLength],
["ril.lastKnownSimMcc", "724"]
]
}, start_tests);
</script>
</pre>
</body>

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

@ -21,14 +21,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=877302
<script class="testbody" type="text/javascript">
"use strict";
var substringLength = 7;
SpecialPowers.setIntPref("dom.phonenumber.substringmatching.VE", substringLength);
SpecialPowers.setCharPref("ril.lastKnownSimMcc", "734");
var sample_id1;
var createResult1;
var findResult1;
var prop = {
tel: [{value: "7932012345" }, {value: "7704143727591"}]
};
@ -124,13 +116,16 @@ var steps = [
},
function () {
ok(true, "all done!\n");
SpecialPowers.clearUserPref("dom.phonenumber.substringmatching.BR");
SpecialPowers.clearUserPref("ril.lastKnownSimMcc");
SimpleTest.finish();
}
];
start_tests();
SpecialPowers.pushPrefEnv({
set: [
["dom.phonenumber.substringmatching.VE", 7],
["ril.lastKnownSimMcc", "734"]
]
}, start_tests);
</script>
</pre>
</body>

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

@ -550,14 +550,13 @@ DeviceStorageRequestParent::CreateFdEvent::CancelableRun()
{
MOZ_ASSERT(!NS_IsMainThread());
nsRefPtr<nsRunnable> r;
nsCOMPtr<nsIRunnable> r;
bool check = false;
mFile->mFile->Exists(&check);
if (check) {
nsCOMPtr<PostErrorEvent> event
= new PostErrorEvent(mParent, POST_ERROR_EVENT_FILE_EXISTS);
return NS_DispatchToMainThread(event);
r = new PostErrorEvent(mParent, POST_ERROR_EVENT_FILE_EXISTS);
return NS_DispatchToMainThread(r);
}
FileDescriptor fileDescriptor;
@ -593,7 +592,7 @@ DeviceStorageRequestParent::WriteFileEvent::CancelableRun()
{
MOZ_ASSERT(!NS_IsMainThread());
nsRefPtr<nsRunnable> r;
nsCOMPtr<nsIRunnable> r;
if (!mInputStream) {
r = new PostErrorEvent(mParent, POST_ERROR_EVENT_UNKNOWN);
@ -603,9 +602,8 @@ DeviceStorageRequestParent::WriteFileEvent::CancelableRun()
bool check = false;
mFile->mFile->Exists(&check);
if (check) {
nsCOMPtr<PostErrorEvent> event
= new PostErrorEvent(mParent, POST_ERROR_EVENT_FILE_EXISTS);
return NS_DispatchToMainThread(event);
r = new PostErrorEvent(mParent, POST_ERROR_EVENT_FILE_EXISTS);
return NS_DispatchToMainThread(r);
}
nsresult rv = mFile->Write(mInputStream);
@ -638,7 +636,7 @@ DeviceStorageRequestParent::DeleteFileEvent::CancelableRun()
mFile->Remove();
nsRefPtr<nsRunnable> r;
nsCOMPtr<nsIRunnable> r;
bool check = false;
mFile->mFile->Exists(&check);

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

@ -1054,7 +1054,7 @@ DeviceStorageFile::Write(nsIInputStream* aInputStream)
return rv;
}
nsCOMPtr<IOEventComplete> iocomplete = new IOEventComplete(this, "created");
nsCOMPtr<nsIRunnable> iocomplete = new IOEventComplete(this, "created");
rv = NS_DispatchToMainThread(iocomplete);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
@ -1114,7 +1114,7 @@ DeviceStorageFile::Write(InfallibleTArray<uint8_t>& aBits)
return rv;
}
nsCOMPtr<IOEventComplete> iocomplete = new IOEventComplete(this, "created");
nsCOMPtr<nsIRunnable> iocomplete = new IOEventComplete(this, "created");
rv = NS_DispatchToMainThread(iocomplete);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
@ -1167,7 +1167,7 @@ DeviceStorageFile::Remove()
return rv;
}
nsCOMPtr<IOEventComplete> iocomplete = new IOEventComplete(this, "deleted");
nsCOMPtr<nsIRunnable> iocomplete = new IOEventComplete(this, "deleted");
return NS_DispatchToMainThread(iocomplete);
}
@ -1914,7 +1914,7 @@ public:
bool check;
mFile->mFile->IsDirectory(&check);
if (!check) {
nsCOMPtr<PostErrorEvent> event =
nsCOMPtr<nsIRunnable> event =
new PostErrorEvent(mRequest.forget(),
POST_ERROR_EVENT_FILE_NOT_ENUMERABLE);
return NS_DispatchToMainThread(event);
@ -1925,7 +1925,7 @@ public:
= static_cast<nsDOMDeviceStorageCursor*>(mRequest.get());
mFile->CollectFiles(cursor->mFiles, cursor->mSince);
nsCOMPtr<ContinueCursorEvent> event
nsRefPtr<ContinueCursorEvent> event
= new ContinueCursorEvent(mRequest.forget());
event->Continue();
@ -2006,7 +2006,7 @@ nsDOMDeviceStorageCursor::GetElement(nsIDOMElement * *aRequestingElement)
NS_IMETHODIMP
nsDOMDeviceStorageCursor::Cancel()
{
nsCOMPtr<PostErrorEvent> event
nsCOMPtr<nsIRunnable> event
= new PostErrorEvent(this, POST_ERROR_EVENT_PERMISSION_DENIED);
return NS_DispatchToMainThread(event);
}
@ -2038,7 +2038,7 @@ nsDOMDeviceStorageCursor::Allow(JS::HandleValue aChoices)
= do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID);
MOZ_ASSERT(target);
nsCOMPtr<InitCursorEvent> event = new InitCursorEvent(this, mFile);
nsCOMPtr<nsIRunnable> event = new InitCursorEvent(this, mFile);
target->Dispatch(event, NS_DISPATCH_NORMAL);
return NS_OK;
}
@ -2058,7 +2058,7 @@ nsDOMDeviceStorageCursor::Continue(ErrorResult& aRv)
mDone = false;
}
nsCOMPtr<ContinueCursorEvent> event = new ContinueCursorEvent(this);
nsRefPtr<ContinueCursorEvent> event = new ContinueCursorEvent(this);
event->Continue();
mOkToCallContinue = false;
@ -2346,7 +2346,7 @@ public:
bool check = false;
dsFile->mFile->Exists(&check);
if (check) {
nsCOMPtr<PostErrorEvent> event =
nsCOMPtr<nsIRunnable> event =
new PostErrorEvent(mRequest.forget(), POST_ERROR_EVENT_FILE_EXISTS);
return NS_DispatchToMainThread(event);
}
@ -2356,12 +2356,12 @@ public:
if (NS_FAILED(rv)) {
dsFile->mFile->Remove(false);
nsCOMPtr<PostErrorEvent> event =
nsCOMPtr<nsIRunnable> event =
new PostErrorEvent(mRequest.forget(), POST_ERROR_EVENT_UNKNOWN);
return NS_DispatchToMainThread(event);
}
nsCOMPtr<PostResultEvent> event =
nsCOMPtr<nsIRunnable> event =
new PostResultEvent(mRequest.forget(), fullPath);
return NS_DispatchToMainThread(event);
}
@ -2397,7 +2397,7 @@ public:
bool check = false;
mFile->mFile->Exists(&check);
if (check) {
nsCOMPtr<PostErrorEvent> event =
nsCOMPtr<nsIRunnable> event =
new PostErrorEvent(mRequest.forget(), POST_ERROR_EVENT_FILE_EXISTS);
return NS_DispatchToMainThread(event);
}
@ -2407,14 +2407,14 @@ public:
if (NS_FAILED(rv)) {
mFile->mFile->Remove(false);
nsCOMPtr<PostErrorEvent> event =
nsCOMPtr<nsIRunnable> event =
new PostErrorEvent(mRequest.forget(), POST_ERROR_EVENT_UNKNOWN);
return NS_DispatchToMainThread(event);
}
nsString fullPath;
mFile->GetFullPath(fullPath);
nsCOMPtr<PostResultEvent> event =
nsCOMPtr<nsIRunnable> event =
new PostResultEvent(mRequest.forget(), fullPath);
return NS_DispatchToMainThread(event);
}
@ -2444,7 +2444,7 @@ public:
{
MOZ_ASSERT(!NS_IsMainThread());
nsRefPtr<nsRunnable> r;
nsCOMPtr<nsIRunnable> r;
if (!mFile->mEditable) {
bool check = false;
mFile->mFile->Exists(&check);
@ -2491,7 +2491,7 @@ public:
MOZ_ASSERT(!NS_IsMainThread());
mFile->Remove();
nsRefPtr<nsRunnable> r;
nsCOMPtr<nsIRunnable> r;
bool check = false;
mFile->mFile->Exists(&check);
if (check) {
@ -2749,7 +2749,7 @@ public:
NS_IMETHOD Cancel()
{
nsCOMPtr<PostErrorEvent> event
nsCOMPtr<nsIRunnable> event
= new PostErrorEvent(mRequest.forget(),
POST_ERROR_EVENT_PERMISSION_DENIED);
return NS_DispatchToMainThread(event);

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

@ -20,8 +20,6 @@
#include "nsMemory.h"
#include "nsServiceManagerUtils.h"
DOMCI_DATA(EventListenerInfo, mozilla::EventListenerInfo)
namespace mozilla {
using namespace dom;
@ -35,7 +33,6 @@ NS_IMPL_CYCLE_COLLECTION_1(EventListenerInfo, mListener)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(EventListenerInfo)
NS_INTERFACE_MAP_ENTRY(nsIEventListenerInfo)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(EventListenerInfo)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTING_ADDREF(EventListenerInfo)

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

@ -79,7 +79,7 @@ dictionary EventInit {
interface CustomEvent : Event {
readonly attribute any detail;
void initCustomEvent(DOMString type, boolean bubbles, boolean cancelable, optional any details);
void initCustomEvent(DOMString type, boolean bubbles, boolean cancelable, any details);
};
dictionary CustomEventInit : EventInit {

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

@ -15,7 +15,7 @@
# include <sys/resource.h>
#endif
#ifdef XP_UNIX
#ifdef MOZ_WIDGET_GONK
#include <sys/types.h>
#include <sys/wait.h>
#endif
@ -977,7 +977,7 @@ ContentParent::SetPriorityAndCheckIsAlive(ProcessPriority aPriority)
// direct child because of Nuwa this will fail with ECHILD, and we
// need to assume the child is alive in that case rather than
// assuming it's dead (as is otherwise a reasonable fallback).
#ifdef XP_UNIX
#ifdef MOZ_WIDGET_GONK
siginfo_t info;
info.si_pid = 0;
if (waitid(P_PID, Pid(), &info, WNOWAIT | WNOHANG | WEXITED) == 0

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

@ -156,6 +156,8 @@ tabReload = reloading
# Object states
stateChecked = checked
stateNotChecked = not checked
statePressed = pressed
# No string for a not pressed toggle button
stateExpanded = expanded
stateCollapsed = collapsed
stateUnavailable = unavailable

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

@ -204,7 +204,7 @@ MediaPermissionRequest::GetTypes(nsIArray** aTypes)
if (mAudio) {
nsTArray<nsString> audioDeviceNames;
CreateDeviceNameList(mAudioDevices, audioDeviceNames);
nsCOMPtr<ContentPermissionType> AudioType =
nsCOMPtr<nsISupports> AudioType =
new ContentPermissionType(NS_LITERAL_CSTRING(AUDIO_PERMISSION_NAME),
NS_LITERAL_CSTRING("unused"),
audioDeviceNames);
@ -213,7 +213,7 @@ MediaPermissionRequest::GetTypes(nsIArray** aTypes)
if (mVideo) {
nsTArray<nsString> videoDeviceNames;
CreateDeviceNameList(mVideoDevices, videoDeviceNames);
nsCOMPtr<ContentPermissionType> VideoType =
nsCOMPtr<nsISupports> VideoType =
new ContentPermissionType(NS_LITERAL_CSTRING(VIDEO_PERMISSION_NAME),
NS_LITERAL_CSTRING("unused"),
videoDeviceNames);

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

@ -779,6 +779,9 @@ RTCPeerConnection.prototype = {
},
close: function() {
if (this._closed) {
return;
}
this._queueOrRun({ func: this._close, args: [false], wait: false });
this._closed = true;
this.changeIceConnectionState("closed");

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

@ -2,7 +2,13 @@
* 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/. */
var TIMEOUT_LENGTH = 10000;
const TIMEUPDATE_TIMEOUT_LENGTH = 10000;
const ENDED_TIMEOUT_LENGTH = 10000;
/* Time we wait for the canplaythrough event to fire
* Note: this needs to be at least 30s because the
* B2G emulator in VMs is really slow. */
const CANPLAYTHROUGH_TIMEOUT_LENGTH = 60000;
/**
* This class manages playback of a HTMLMediaElement with a MediaStream.
@ -123,7 +129,7 @@ MediaStreamPlayback.prototype = {
timeUpdateCallback, false);
onError("timeUpdate event never fired");
}
}, TIMEOUT_LENGTH);
}, TIMEUPDATE_TIMEOUT_LENGTH);
};
// Adds a listener intended to be fired when playback is available
@ -142,7 +148,7 @@ MediaStreamPlayback.prototype = {
canPlayThroughCallback, false);
onError("canplaythrough event never fired");
}
}, TIMEOUT_LENGTH);
}, CANPLAYTHROUGH_TIMEOUT_LENGTH);
},
/**
@ -237,7 +243,7 @@ LocalMediaStreamPlayback.prototype = Object.create(MediaStreamPlayback.prototype
if (!endedFired) {
onError("ended event never fired");
}
}, TIMEOUT_LENGTH);
}, ENDED_TIMEOUT_LENGTH);
}
}
});

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

@ -568,7 +568,7 @@ function PCT_setLocalDescription(peer, desc, onSuccess) {
}
peer.onsignalingstatechange = function () {
info(peer + ": 'onsignalingstatechange' event registered for async check");
info(peer + ": 'onsignalingstatechange' event registered, signalingState: " + peer.signalingState);
eventFired = true;
check_next_test();
@ -629,7 +629,7 @@ function PCT_setRemoteDescription(peer, desc, onSuccess) {
}
peer.onsignalingstatechange = function () {
info(peer + ": 'onsignalingstatechange' event registered for async check");
info(peer + ": 'onsignalingstatechange' event registered, signalingState: " + peer.signalingState);
eventFired = true;
check_next_test();

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

@ -15,12 +15,17 @@
makePC = function (config, expect_success) {
var exception = null;
var pc = null;
try {
var pc = new mozRTCPeerConnection(config);
pc = new mozRTCPeerConnection(config);
} catch (e) {
exception = e;
}
if (pc !== null) {
pc.close();
}
pc = null
if (expect_success) {
ok(!exception, "mozRTCPeerConnection(" +
@ -34,12 +39,19 @@
// This is a test of the iceServers parsing code + readable errors
runTest(function () {
var pc, pcs;
var pcs = null;
var exception = null;
var config;
try { pcs = new mozRTCPeerConnection(); } catch (e) { exception = e; }
try {
pcs = new mozRTCPeerConnection();
} catch (e) {
exception = e;
}
ok(!exception, "mozRTCPeerConnection() succeeds");
if (pcs !== null) {
pcs.close();
}
pcs = null;
exception = null;
@ -69,6 +81,9 @@
ok(e.message.indexOf("http") > 0,
"mozRTCPeerConnection() constructor has readable exceptions");
}
if (pcs !== null) {
pcs.close();
}
pcs = null;
SimpleTest.finish();

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

@ -15,6 +15,8 @@
function croak(msg) {
ok(0, msg);
pc1.close();
pc2.close();
SimpleTest.finish();
}
@ -30,6 +32,8 @@
pc2.setRemoteDescription(d, function (x) {}, function (x) {});
pc2.createAnswer(function (d) {
is(d.type,"answer","CreateAnswer created an answer");
pc1.close();
pc2.close();
SimpleTest.finish();
}, function (err) {
croak("createAnswer failed: " + err);

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

@ -254,6 +254,8 @@ Promise::GetOrCreateWrapper(JSContext* aCx)
return nullptr;
}
JSAutoCompartment ac(aCx, scope);
JS::Rooted<JS::Value> val(aCx);
if (!WrapNewBindingObject(aCx, scope, this, &val)) {
MOZ_ASSERT(JS_IsExceptionPending(aCx));

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

@ -78,7 +78,7 @@ DOMStorageDBThread::Init()
MonitorAutoLock monitor(mMonitor);
mThread = PR_CreateThread(PR_USER_THREAD, &DOMStorageDBThread::ThreadFunc, this,
PR_PRIORITY_LOW, PR_LOCAL_THREAD, PR_JOINABLE_THREAD,
PR_PRIORITY_LOW, PR_GLOBAL_THREAD, PR_JOINABLE_THREAD,
262144);
if (!mThread) {
return NS_ERROR_OUT_OF_MEMORY;

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

@ -63,7 +63,7 @@ protected:
private:
nsAutoPtr<mozilla::hal::SwitchObserver> mObserver;
nsCOMPtr<AudioChannelAgent> mPhoneAudioAgent;
nsCOMPtr<nsIAudioChannelAgent> mPhoneAudioAgent;
#ifdef MOZ_B2G_RIL
bool mMuteCallToRIL;
// mIsMicMuted is only used for toggling mute call to RIL.

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

@ -76,6 +76,9 @@ const MMI_MAX_LENGTH_SHORT_CODE = 2;
const MMI_END_OF_USSD = "#";
// Should match the value we set in dom/telephony/TelephonyCommon.h
const OUTGOING_PLACEHOLDER_CALL_INDEX = 0xffffffff;
let RILQUIRKS_CALLSTATE_EXTRA_UINT32;
// This may change at runtime since in RIL v6 and later, we get the version
// number via the UNSOLICITED_RIL_CONNECTED parcel.
@ -3701,11 +3704,17 @@ RilObject.prototype = {
_processCalls: function(newCalls) {
let conferenceChanged = false;
let clearConferenceRequest = false;
let pendingOutgoingCall = null;
// Go through the calls we currently have on file and see if any of them
// changed state. Remove them from the newCalls map as we deal with them
// so that only new calls remain in the map after we're done.
for each (let currentCall in this.currentCalls) {
if (currentCall.callIndex == OUTGOING_PLACEHOLDER_CALL_INDEX) {
pendingOutgoingCall = currentCall;
continue;
}
let newCall;
if (newCalls) {
newCall = newCalls[currentCall.callIndex];
@ -3820,36 +3829,24 @@ RilObject.prototype = {
}
}
if (pendingOutgoingCall) {
// We don't get a successful call for pendingOutgoingCall.
if (!newCalls || Object.keys(newCalls).length === 0) {
this.context.debug("Disconnect pending outgoing call");
pendingOutgoingCall.failCause = GECKO_CALL_ERROR_UNSPECIFIED;
this._handleDisconnectedCall(pendingOutgoingCall);
}
delete this.currentCalls[OUTGOING_PLACEHOLDER_CALL_INDEX];
}
// Go through any remaining calls that are new to us.
for each (let newCall in newCalls) {
if (newCall.isVoice) {
// Format international numbers appropriately.
if (newCall.number &&
newCall.toa == TOA_INTERNATIONAL &&
newCall.number[0] != "+") {
newCall.number = "+" + newCall.number;
}
if (newCall.state == CALL_STATE_INCOMING) {
newCall.isOutgoing = false;
} else if (newCall.state == CALL_STATE_DIALING) {
newCall.isOutgoing = true;
}
// Set flag for outgoing emergency call.
newCall.isEmergency = newCall.isOutgoing &&
this._isEmergencyNumber(newCall.number);
// Add to our map.
if (newCall.isMpty) {
conferenceChanged = true;
newCall.isConference = true;
this.currentConference.participants[newCall.callIndex] = newCall;
} else {
newCall.isConference = false;
}
this._handleChangedCallState(newCall);
this.currentCalls[newCall.callIndex] = newCall;
this._addNewVoiceCall(newCall);
}
}
@ -3861,6 +3858,34 @@ RilObject.prototype = {
}
},
_addNewVoiceCall: function(newCall) {
// Format international numbers appropriately.
if (newCall.number && newCall.toa == TOA_INTERNATIONAL &&
newCall.number[0] != "+") {
newCall.number = "+" + newCall.number;
}
if (newCall.state == CALL_STATE_INCOMING) {
newCall.isOutgoing = false;
} else if (newCall.state == CALL_STATE_DIALING) {
newCall.isOutgoing = true;
}
// Set flag for outgoing emergency call.
newCall.isEmergency = newCall.isOutgoing &&
this._isEmergencyNumber(newCall.number);
// Set flag for conference.
newCall.isConference = newCall.isMpty ? true : false;
// Add to our map.
if (newCall.isMpty) {
this.currentConference.participants[newCall.callIndex] = newCall;
}
this._handleChangedCallState(newCall);
this.currentCalls[newCall.callIndex] = newCall;
},
_ensureConference: function() {
let oldState = this.currentConference.state;
let remaining = Object.keys(this.currentConference.participants);
@ -5260,6 +5285,14 @@ RilObject.prototype[REQUEST_DIAL] = function REQUEST_DIAL(length, options) {
options.success = (options.rilRequestError === 0);
if (options.success) {
this.sendChromeMessage(options);
// Create a pending outgoing call.
this.context.debug("Create a pending outgoing call.");
this._addNewVoiceCall({
number: options.number,
state: CALL_STATE_DIALING,
callIndex: OUTGOING_PLACEHOLDER_CALL_INDEX
});
} else {
this.getFailCauseCode((function(options, failCause) {
options.errorMsg = failCause;

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

@ -532,9 +532,6 @@ Telephony::CallStateChanged(uint32_t aServiceId, uint32_t aCallIndex,
bool aIsActive, bool aIsOutgoing, bool aIsEmergency,
bool aIsConference, bool aIsSwitchable, bool aIsMergeable)
{
NS_ASSERTION(aCallIndex != kOutgoingPlaceholderCallIndex,
"This should never happen!");
nsRefPtr<TelephonyCall> modifiedCall
= GetCallFromEverywhere(aServiceId, aCallIndex);

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

@ -109,19 +109,19 @@ TelephonyCall::ChangeStateInternal(uint16_t aCallState, bool aFireEvents)
if (aCallState == nsITelephonyProvider::CALL_STATE_DISCONNECTED) {
NS_ASSERTION(mLive, "Should be live!");
mLive = false;
if (mGroup) {
mGroup->RemoveCall(this);
} else {
mTelephony->RemoveCall(this);
}
mLive = false;
} else if (!mLive) {
mLive = true;
if (mGroup) {
mGroup->AddCall(this);
} else {
mTelephony->AddCall(this);
}
mLive = true;
}
if (aFireEvents) {

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

@ -38,6 +38,9 @@ const CDMA_SECOND_CALL_INDEX = 2;
const DIAL_ERROR_INVALID_STATE_ERROR = "InvalidStateError";
const DIAL_ERROR_OTHER_CONNECTION_IN_USE = "OtherConnectionInUse";
// Should match the value we set in dom/telephony/TelephonyCommon.h
const OUTGOING_PLACEHOLDER_CALL_INDEX = 0xffffffff;
let DEBUG;
function debug(s) {
dump("TelephonyProvider: " + s + "\n");
@ -821,6 +824,14 @@ TelephonyProvider.prototype = {
aCall.isSwitchable : true;
call.isMergeable = aCall.isMergeable != null ?
aCall.isMergeable : true;
// Get the actual call for pending outgoing call. Remove the original one.
if (this._currentCalls[aClientId][OUTGOING_PLACEHOLDER_CALL_INDEX] &&
call.callIndex != OUTGOING_PLACEHOLDER_CALL_INDEX &&
call.isOutgoing) {
delete this._currentCalls[aClientId][OUTGOING_PLACEHOLDER_CALL_INDEX];
}
this._currentCalls[aClientId][aCall.callIndex] = call;
}

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

@ -11,26 +11,58 @@ const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
function DEBUG(str)
{
// dump("********** " + str);
// dump("********** " + str + "\n");
}
function setOurState(data) {
x = { data: data, QueryInterface: function(iid) { return this } };
x.wrappedJSObject = x;
setObjectState("beacon-handler", x);
DEBUG("our state is " + data);
}
function getOurState() {
var data;
getObjectState("beacon-handler", function(x) {
// x can be null if no one has set any state yet
if (x) {
data = x.wrappedJSObject.data;
}
});
return data;
}
function handleRequest(request, response) {
DEBUG("Entered request handler");
response.setHeader("Cache-Control", "no-cache", false);
function finishControlResponse(response) {
DEBUG("********* sending out the control GET response");
var data = getState("beaconData");
var mimetype = getState("beaconMimetype");
DEBUG("GET was sending : " + data + "\n");
DEBUG("GET was sending : " + mimetype + "\n");
var result = {
"data": data,
"mimetype": mimetype,
};
response.write(JSON.stringify(result));
setOurState(null);
}
if (request.method == "GET") {
DEBUG(" ------------ GET --------------- ");
response.setHeader("Content-Type", "application/json", false);
switch (request.queryString) {
case "getLastBeacon":
var data = getState("beaconData");
var mimetype = getState("beaconMimetype");
DEBUG("GET was sending : " + data + "\n");
DEBUG("GET was sending : " + mimetype + "\n");
var result = {
"data": data,
"mimetype": mimetype,
};
response.write(JSON.stringify(result));
var state = getOurState();
if (state === "unblocked") {
finishControlResponse(response);
} else {
DEBUG("GET has arrived, but POST has not, blocking response!");
setOurState(response);
response.processAsync();
}
break;
default:
response.setStatusLine(request.httpVersion, 400, "Bad Request");
@ -40,6 +72,7 @@ function handleRequest(request, response) {
}
if (request.method == "POST") {
DEBUG(" ------------ POST --------------- ");
var body = new BinaryInputStream(request.bodyInputStream);
var avail;
var bytes = [];
@ -76,6 +109,17 @@ function handleRequest(request, response) {
response.setHeader("Content-Type", "text/plain", false);
response.write('ok');
var blockedResponse = getOurState();
if (typeof(blockedResponse) == "object" && blockedResponse) {
DEBUG("GET is already pending, finishing!");
finishControlResponse(blockedResponse);
blockedResponse.finish();
} else {
DEBUG("GET has not arrived, marking it as unblocked");
setOurState("unblocked");
}
return;
}

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

@ -339,8 +339,6 @@ var interfaceNamesInGlobalScope =
"ErrorEvent",
// IMPORTANT: Do not change this list without review from a DOM peer!
"Event",
// IMPORTANT: Do not change this list without review from a DOM peer!
"EventListenerInfo",
// IMPORTANT: Do not change this list without review from a DOM peer!
"EventSource",
// IMPORTANT: Do not change this list without review from a DOM peer!
@ -735,6 +733,8 @@ var interfaceNamesInGlobalScope =
"PaintRequestList",
// IMPORTANT: Do not change this list without review from a DOM peer!
"PannerNode",
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "Path2D", pref: "canvas.path.enabled" },
// IMPORTANT: Do not change this list without review from a DOM peer!
"Performance",
// IMPORTANT: Do not change this list without review from a DOM peer!

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

@ -17,8 +17,8 @@ interface Console {
void group(any... data);
void groupCollapsed(any... data);
void groupEnd(any... data);
void time(any time);
void timeEnd(any time);
void time(optional any time);
void timeEnd(optional any time);
[Throws]
void profile(any... data);

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

@ -26,11 +26,11 @@ interface HTMLCanvasElement : HTMLElement {
[Throws]
DOMString toDataURL(optional DOMString type = "",
any encoderOptions);
optional any encoderOptions);
[Throws]
void toBlob(FileCallback _callback,
optional DOMString type = "",
any encoderOptions);
optional any encoderOptions);
};
// Mozilla specific bits

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

@ -32,7 +32,7 @@ interface IDBCursor {
void advance ([EnforceRange] unsigned long count);
[Throws]
void continue (any key);
void continue (optional any key);
[Throws]
IDBRequest delete ();

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

@ -23,10 +23,10 @@ interface IDBIndex {
readonly attribute boolean unique;
[Throws]
IDBRequest openCursor (any range, optional IDBCursorDirection direction = "next");
IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next");
[Throws]
IDBRequest openKeyCursor (any range, optional IDBCursorDirection direction = "next");
IDBRequest openKeyCursor (optional any range, optional IDBCursorDirection direction = "next");
[Throws]
IDBRequest get (any key);
@ -35,15 +35,15 @@ interface IDBIndex {
IDBRequest getKey (any key);
[Throws]
IDBRequest count (any key);
IDBRequest count (optional any key);
};
partial interface IDBIndex {
readonly attribute DOMString storeName;
[Throws]
IDBRequest mozGetAll (any key, optional unsigned long limit);
IDBRequest mozGetAll (optional any key, optional unsigned long limit);
[Throws]
IDBRequest mozGetAllKeys (any key, optional unsigned long limit);
IDBRequest mozGetAllKeys (optional any key, optional unsigned long limit);
};

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

@ -25,10 +25,10 @@ interface IDBObjectStore {
readonly attribute boolean autoIncrement;
[Throws]
IDBRequest put (any value, any key);
IDBRequest put (any value, optional any key);
[Throws]
IDBRequest add (any value, any key);
IDBRequest add (any value, optional any key);
[Throws]
IDBRequest delete (any key);
@ -40,7 +40,7 @@ interface IDBObjectStore {
IDBRequest clear ();
[Throws]
IDBRequest openCursor (any range, optional IDBCursorDirection direction = "next");
IDBRequest openCursor (optional any range, optional IDBCursorDirection direction = "next");
// Bug 899972
// IDBIndex createIndex (DOMString name, (DOMString or sequence<DOMString>) keyPath, optional IDBIndexParameters optionalParameters);
@ -58,20 +58,20 @@ interface IDBObjectStore {
void deleteIndex (DOMString indexName);
[Throws]
IDBRequest count (any key);
IDBRequest count (optional any key);
};
partial interface IDBObjectStore {
// Success fires IDBTransactionEvent, result == array of values for given keys
[Throws]
IDBRequest mozGetAll (any key, optional unsigned long limit);
IDBRequest mozGetAll (optional any key, optional unsigned long limit);
[Pref="dom.indexedDB.experimental", Throws]
IDBRequest getAll (any key, optional unsigned long limit);
IDBRequest getAll (optional any key, optional unsigned long limit);
[Pref="dom.indexedDB.experimental", Throws]
IDBRequest getAllKeys (any key, optional unsigned long limit);
IDBRequest getAllKeys (optional any key, optional unsigned long limit);
[Pref="dom.indexedDB.experimental", Throws]
IDBRequest openKeyCursor (any range, optional IDBCursorDirection direction = "next");
IDBRequest openKeyCursor (optional any range, optional IDBCursorDirection direction = "next");
};

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

@ -26,9 +26,9 @@ interface Promise {
// Promise object in this scope without having resolved the interface object
// first.
[NewObject, Throws]
static Promise resolve(any value);
static Promise resolve(optional any value);
[NewObject, Throws]
static Promise reject(any value);
static Promise reject(optional any value);
// The [TreatNonCallableAsNull] annotation is required since then() should do
// nothing instead of throwing errors when non-callable arguments are passed.

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

@ -150,7 +150,7 @@ dictionary RTCStatsReportInternal {
interface RTCStatsReport {
[ChromeOnly]
readonly attribute DOMString mozPcid;
void forEach(RTCStatsReportCallback callbackFn, any thisArg);
void forEach(RTCStatsReportCallback callbackFn, optional any thisArg);
object get(DOMString key);
boolean has(DOMString key);
};

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

@ -6,7 +6,7 @@
[JSImplementation="@mozilla.org/dom/test-interface-js;1",
Pref="dom.expose_test_interfaces",
Constructor(any anyArg, optional object objectArg)]
Constructor(optional any anyArg, optional object objectArg)]
interface TestInterfaceJS {
readonly attribute any anyArg;
readonly attribute object objectArg;

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

@ -76,7 +76,7 @@ typedef any Transferable;
[Throws] DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
[Throws] void print();
//[Throws] any showModalDialog(DOMString url, optional any argument);
[Throws] any showModalDialog(DOMString url, any argument, optional DOMString options = "");
[Throws] any showModalDialog(DOMString url, optional any argument, optional DOMString options = "");
[Throws, CrossOriginCallable] void postMessage(any message, DOMString targetOrigin, optional sequence<Transferable> transfer);

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

@ -10,7 +10,7 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
DIRS += ['mac']
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
DIRS += ['android']
elif CONFIG['MOZ_WIDGET_TOOLKIT'] in ('qt', 'gtk2'):
elif CONFIG['MOZ_WIDGET_TOOLKIT'] in ('qt', 'gtk2', 'gtk3'):
DIRS += ['unix']
else:
DIRS += ['emacs']

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

@ -11,7 +11,8 @@ skip-if = toolkit == 'android'
[test_bug499115.html]
[test_nsFind.html]
[test_private_window_from_content.html]
# Next two tests are disabled in e10s because of bug 989501.
[test_window_open_position_constraint.html]
skip-if = toolkit == 'android'
skip-if = toolkit == 'android' || e10s
[test_window_open_units.html]
skip-if = toolkit == 'android' || e10s

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

@ -108,7 +108,7 @@ struct LayerPropertiesBase : public LayerProperties
, mMaskLayer(nullptr)
, mVisibleRegion(aLayer->GetVisibleRegion())
, mInvalidRegion(aLayer->GetInvalidRegion())
, mOpacity(aLayer->GetOpacity())
, mOpacity(aLayer->GetLocalOpacity())
, mUseClipRect(!!aLayer->GetClipRect())
{
MOZ_COUNT_CTOR(LayerPropertiesBase);
@ -132,11 +132,13 @@ struct LayerPropertiesBase : public LayerProperties
}
virtual nsIntRegion ComputeDifferences(Layer* aRoot,
NotifySubDocInvalidationFunc aCallback);
NotifySubDocInvalidationFunc aCallback,
bool* aGeometryChanged);
virtual void MoveBy(const nsIntPoint& aOffset);
nsIntRegion ComputeChange(NotifySubDocInvalidationFunc aCallback)
nsIntRegion ComputeChange(NotifySubDocInvalidationFunc aCallback,
bool& aGeometryChanged)
{
gfx3DMatrix transform;
gfx::To3DMatrix(mLayer->GetTransform(), transform);
@ -146,9 +148,10 @@ struct LayerPropertiesBase : public LayerProperties
nsIntRegion result;
if ((mMaskLayer ? mMaskLayer->mLayer : nullptr) != otherMask ||
(mUseClipRect != !!otherClip) ||
mLayer->GetOpacity() != mOpacity ||
mLayer->GetLocalOpacity() != mOpacity ||
transformChanged)
{
aGeometryChanged = true;
result = OldTransformedBounds();
if (transformChanged) {
AddRegion(result, NewTransformedBounds());
@ -165,13 +168,17 @@ struct LayerPropertiesBase : public LayerProperties
nsIntRegion visible;
visible.Xor(mVisibleRegion, mLayer->GetVisibleRegion());
if (!visible.IsEmpty()) {
aGeometryChanged = true;
}
AddTransformedRegion(result, visible, mTransform);
AddRegion(result, ComputeChangeInternal(aCallback));
AddRegion(result, ComputeChangeInternal(aCallback, aGeometryChanged));
AddTransformedRegion(result, mLayer->GetInvalidRegion(), mTransform);
if (mMaskLayer && otherMask) {
AddTransformedRegion(result, mMaskLayer->ComputeChange(aCallback), mTransform);
AddTransformedRegion(result, mMaskLayer->ComputeChange(aCallback, aGeometryChanged),
mTransform);
}
if (mUseClipRect && otherClip) {
@ -198,7 +205,11 @@ struct LayerPropertiesBase : public LayerProperties
return TransformRect(mVisibleRegion.GetBounds(), mTransform);
}
virtual nsIntRegion ComputeChangeInternal(NotifySubDocInvalidationFunc aCallback) { return nsIntRect(); }
virtual nsIntRegion ComputeChangeInternal(NotifySubDocInvalidationFunc aCallback,
bool& aGeometryChanged)
{
return nsIntRect();
}
nsRefPtr<Layer> mLayer;
nsAutoPtr<LayerPropertiesBase> mMaskLayer;
@ -220,7 +231,8 @@ struct ContainerLayerProperties : public LayerPropertiesBase
}
}
virtual nsIntRegion ComputeChangeInternal(NotifySubDocInvalidationFunc aCallback)
virtual nsIntRegion ComputeChangeInternal(NotifySubDocInvalidationFunc aCallback,
bool& aGeometryChanged)
{
ContainerLayer* container = mLayer->AsContainerLayer();
nsIntRegion result;
@ -255,7 +267,7 @@ struct ContainerLayerProperties : public LayerPropertiesBase
AddRegion(result, mChildren[j]->OldTransformedBounds());
}
// Invalidate any regions of the child that have changed:
AddRegion(result, mChildren[childsOldIndex]->ComputeChange(aCallback));
AddRegion(result, mChildren[childsOldIndex]->ComputeChange(aCallback, aGeometryChanged));
i = childsOldIndex + 1;
} else {
// We've already seen this child in mChildren (which means it must
@ -309,7 +321,8 @@ struct ColorLayerProperties : public LayerPropertiesBase
, mColor(aLayer->GetColor())
{ }
virtual nsIntRegion ComputeChangeInternal(NotifySubDocInvalidationFunc aCallback)
virtual nsIntRegion ComputeChangeInternal(NotifySubDocInvalidationFunc aCallback,
bool& aGeometryChanged)
{
ColorLayer* color = static_cast<ColorLayer*>(mLayer.get());
@ -334,7 +347,8 @@ struct ImageLayerProperties : public LayerPropertiesBase
{
}
virtual nsIntRegion ComputeChangeInternal(NotifySubDocInvalidationFunc aCallback)
virtual nsIntRegion ComputeChangeInternal(NotifySubDocInvalidationFunc aCallback,
bool& aGeometryChanged)
{
ImageLayer* imageLayer = static_cast<ImageLayer*>(mLayer.get());
@ -407,7 +421,8 @@ LayerProperties::ClearInvalidations(Layer *aLayer)
}
nsIntRegion
LayerPropertiesBase::ComputeDifferences(Layer* aRoot, NotifySubDocInvalidationFunc aCallback)
LayerPropertiesBase::ComputeDifferences(Layer* aRoot, NotifySubDocInvalidationFunc aCallback,
bool* aGeometryChanged = nullptr)
{
NS_ASSERTION(aRoot, "Must have a layer tree to compare against!");
if (mLayer != aRoot) {
@ -420,9 +435,17 @@ LayerPropertiesBase::ComputeDifferences(Layer* aRoot, NotifySubDocInvalidationFu
gfx::To3DMatrix(aRoot->GetTransform(), transform);
nsIntRect result = TransformRect(aRoot->GetVisibleRegion().GetBounds(), transform);
result = result.Union(OldTransformedBounds());
if (aGeometryChanged != nullptr) {
*aGeometryChanged = true;
}
return result;
} else {
return ComputeChange(aCallback);
bool geometryChanged = (aGeometryChanged != nullptr) ? *aGeometryChanged : false;
nsIntRegion invalid = ComputeChange(aCallback, geometryChanged);
if (aGeometryChanged != nullptr) {
*aGeometryChanged = geometryChanged;
}
return invalid;
}
}

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

@ -59,7 +59,8 @@ struct LayerProperties
* @return Painted area changed by the layer tree changes.
*/
virtual nsIntRegion ComputeDifferences(Layer* aRoot,
NotifySubDocInvalidationFunc aCallback) = 0;
NotifySubDocInvalidationFunc aCallback,
bool* aGeometryChanged = nullptr) = 0;
virtual void MoveBy(const nsIntPoint& aOffset) = 0;

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

@ -104,6 +104,7 @@ LayerManagerComposite::LayerManagerComposite(Compositor* aCompositor)
, mInTransaction(false)
, mIsCompositorReady(false)
, mDebugOverlayWantsNextFrame(false)
, mGeometryChanged(true)
{
mTextRenderer = new TextRenderer(aCompositor);
MOZ_ASSERT(aCompositor);
@ -155,7 +156,8 @@ LayerManagerComposite::BeginTransaction()
mIsCompositorReady = true;
if (Compositor::GetBackend() == LayersBackend::LAYERS_BASIC) {
if (Compositor::GetBackend() == LayersBackend::LAYERS_OPENGL ||
Compositor::GetBackend() == LayersBackend::LAYERS_BASIC) {
mClonedLayerTreeProperties = LayerProperties::CloneFrom(GetRoot());
}
}
@ -223,7 +225,8 @@ LayerManagerComposite::EndTransaction(DrawThebesLayerCallback aCallback,
}
if (mRoot && mClonedLayerTreeProperties) {
nsIntRegion invalid = mClonedLayerTreeProperties->ComputeDifferences(mRoot, nullptr);
nsIntRegion invalid =
mClonedLayerTreeProperties->ComputeDifferences(mRoot, nullptr, &mGeometryChanged);
mClonedLayerTreeProperties = nullptr;
mInvalidRegion.Or(mInvalidRegion, invalid);
@ -243,6 +246,7 @@ LayerManagerComposite::EndTransaction(DrawThebesLayerCallback aCallback,
mRoot->ComputeEffectiveTransforms(gfx::Matrix4x4());
Render();
mGeometryChanged = false;
}
mCompositor->SetTargetContext(nullptr);
@ -448,7 +452,7 @@ LayerManagerComposite::Render()
/** Our more efficient but less powerful alter ego, if one is available. */
nsRefPtr<Composer2D> composer2D = mCompositor->GetWidget()->GetComposer2D();
if (!mTarget && composer2D && composer2D->TryRender(mRoot, mWorldMatrix)) {
if (!mTarget && composer2D && composer2D->TryRender(mRoot, mWorldMatrix, mGeometryChanged)) {
if (mFPS) {
double fps = mFPS->mCompositionFps.AddFrameAndGetFps(TimeStamp::Now());
if (gfxPrefs::LayersDrawFPS()) {

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

@ -278,6 +278,7 @@ private:
bool mDebugOverlayWantsNextFrame;
RefPtr<TextRenderer> mTextRenderer;
bool mGeometryChanged;
};
/**

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

@ -56,7 +56,8 @@ public:
* Currently, when TryRender() returns true, the entire framebuffer
* must have been rendered.
*/
virtual bool TryRender(Layer* aRoot, const gfx::Matrix& aWorldTransform) = 0;
virtual bool TryRender(Layer* aRoot, const gfx::Matrix& aWorldTransform,
bool aGeometryChanged) = 0;
};
} // namespace layers

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

@ -3565,7 +3565,7 @@ RasterImage::DecodeDoneWorker::NotifyFinishedSomeDecoding(RasterImage* image, De
{
image->mDecodingMonitor.AssertCurrentThreadIn();
nsCOMPtr<DecodeDoneWorker> worker = new DecodeDoneWorker(image, request);
nsCOMPtr<nsIRunnable> worker = new DecodeDoneWorker(image, request);
NS_DispatchToMainThread(worker);
}
@ -3588,7 +3588,7 @@ RasterImage::FrameNeededWorker::FrameNeededWorker(RasterImage* image)
void
RasterImage::FrameNeededWorker::GetNewFrame(RasterImage* image)
{
nsCOMPtr<FrameNeededWorker> worker = new FrameNeededWorker(image);
nsCOMPtr<nsIRunnable> worker = new FrameNeededWorker(image);
NS_DispatchToMainThread(worker);
}

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

@ -214,8 +214,6 @@ class INTR(PrettyPrinted):
pretty = 'intr'
class SYNC(PrettyPrinted):
pretty = 'sync'
class URGENT(PrettyPrinted):
pretty = 'urgent'
class RPC(PrettyPrinted):
pretty = 'rpc'
@ -223,26 +221,8 @@ class INOUT(PrettyPrinted):
pretty = 'inout'
class IN(PrettyPrinted):
pretty = 'in'
@staticmethod
def prettySS(cls, ss): return _prettyTable['in'][ss.pretty]
class OUT(PrettyPrinted):
pretty = 'out'
@staticmethod
def prettySS(ss): return _prettyTable['out'][ss.pretty]
_prettyTable = {
IN : { 'async': 'AsyncRecv',
'sync': 'SyncRecv',
'intr': 'IntrAnswer',
'rpc': 'RPCAnswer',
'urgent': 'UrgentAnswer' },
OUT : { 'async': 'AsyncSend',
'sync': 'SyncSend',
'intr': 'IntrCall',
'rpc': 'RPCCall',
'urgent': 'UrgentCall' }
# inout doesn't make sense here
}
class Namespace(Node):

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

@ -5,7 +5,7 @@
import os, sys
from ipdl.ast import Visitor
from ipdl.ast import IN, OUT, INOUT, ASYNC, SYNC, INTR, URGENT
from ipdl.ast import IN, OUT, INOUT, ASYNC, SYNC, INTR
class CodePrinter:
def __init__(self, outf=sys.stdout, indentCols=4):

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

@ -277,13 +277,13 @@ def _putInNamespaces(cxxthing, namespaces):
def _sendPrefix(msgtype):
"""Prefix of the name of the C++ method that sends |msgtype|."""
if msgtype.isInterrupt() or msgtype.isUrgent() or msgtype.isRpc():
if msgtype.isInterrupt() or msgtype.isRpc():
return 'Call'
return 'Send'
def _recvPrefix(msgtype):
"""Prefix of the name of the C++ method that handles |msgtype|."""
if msgtype.isInterrupt() or msgtype.isUrgent() or msgtype.isRpc():
if msgtype.isInterrupt() or msgtype.isRpc():
return 'Answer'
return 'Recv'
@ -4776,7 +4776,7 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
self.asyncSwitch.addcase(lbl, case)
elif sems is ipdl.ast.SYNC:
self.syncSwitch.addcase(lbl, case)
elif sems is ipdl.ast.INTR or sems is ipdl.ast.URGENT or sems is ipdl.ast.RPC:
elif sems is ipdl.ast.INTR or sems is ipdl.ast.RPC:
self.interruptSwitch.addcase(lbl, case)
else: assert 0
@ -5171,15 +5171,20 @@ class _GenerateProtocolActorCode(ipdl.ast.Visitor):
if md.decl.type.isSync():
stmts.append(StmtExpr(ExprCall(
ExprSelect(var, '->', 'set_sync'))))
elif md.decl.type.isUrgent():
stmts.append(StmtExpr(ExprCall(
ExprSelect(var, '->', 'set_urgent'))))
elif md.decl.type.isRpc():
# We use urgent messages from the parent to the child and
# RPC messages from the child to the parent. However,
# replies should always be sent using the same semantics
# as the original message, so we need to flip.
if (self.side == 'parent') ^ reply:
stmts.append(StmtExpr(ExprCall(
ExprSelect(var, '->', 'set_urgent'))))
else:
stmts.append(StmtExpr(ExprCall(
ExprSelect(var, '->', 'set_rpc'))))
elif md.decl.type.isInterrupt():
stmts.append(StmtExpr(ExprCall(
ExprSelect(var, '->', 'set_interrupt'))))
elif md.decl.type.isRpc():
stmts.append(StmtExpr(ExprCall(
ExprSelect(var, '->', 'set_rpc'))))
if reply:
stmts.append(StmtExpr(ExprCall(

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