CLOSED TREE
This commit is contained in:
Phil Ringnalda 2015-09-10 15:34:04 -07:00
Родитель bc011003b3 22565071a2
Коммит 631a2b85f2
96 изменённых файлов: 852 добавлений и 303 удалений

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

@ -76,6 +76,11 @@ a11y::ProxyTextChangeEvent(ProxyAccessible* aText, const nsString& aStr,
int32_t aStart, uint32_t aLen, bool aInsert, bool)
{
AccessibleWrap* wrapper = WrapperFor(aText);
MOZ_ASSERT(wrapper);
if (!wrapper) {
return;
}
auto text = static_cast<HyperTextAccessibleWrap*>(wrapper->AsHyperText());
if (text) {
ia2AccessibleText::UpdateTextChangeData(text, aInsert, aStr, aStart, aLen);

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -4,11 +4,11 @@
"digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
"algorithm": "sha512",
"filename": "gcc.tar.xz",
"unpack": "True"
"unpack": true
},
{
"size": 12057960,
"digest": 6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
"digest": "6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
"algorithm": "sha512",
"filename": "gtk3.tar.xz",
"unpack": true

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

@ -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="47459eead04385e22f967012b824f5abdddcfb7c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="27eb2f04e149fc2c9976d881b1b5984bbe7ee089"/>

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

@ -4,11 +4,11 @@
"digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
"algorithm": "sha512",
"filename": "gcc.tar.xz",
"unpack": "True"
"unpack": true
},
{
"size": 12057960,
"digest": 6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
"digest": "6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
"algorithm": "sha512",
"filename": "gtk3.tar.xz",
"unpack": true

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

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>

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

@ -4,11 +4,11 @@
"digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
"algorithm": "sha512",
"filename": "gcc.tar.xz",
"unpack": "True"
"unpack": true
},
{
"size": 12057960,
"digest": 6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
"digest": "6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
"algorithm": "sha512",
"filename": "gtk3.tar.xz",
"unpack": true

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -4,11 +4,11 @@
"digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
"algorithm": "sha512",
"filename": "gcc.tar.xz",
"unpack": "True"
"unpack": true
},
{
"size": 12057960,
"digest": 6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
"digest": "6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
"algorithm": "sha512",
"filename": "gtk3.tar.xz",
"unpack": true

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -4,11 +4,11 @@
"digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
"algorithm": "sha512",
"filename": "gcc.tar.xz",
"unpack": "True"
"unpack": true
},
{
"size": 12057960,
"digest": 6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
"digest": "6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
"algorithm": "sha512",
"filename": "gtk3.tar.xz",
"unpack": true

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

@ -4,11 +4,11 @@
"digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
"algorithm": "sha512",
"filename": "gcc.tar.xz",
"unpack": "True"
"unpack": true
},
{
"size": 12057960,
"digest": 6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
"digest": "6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
"algorithm": "sha512",
"filename": "gtk3.tar.xz",
"unpack": true

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

@ -4,7 +4,7 @@
"digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
"algorithm": "sha512",
"filename": "gcc.tar.xz",
"unpack": "True"
"unpack": true
},
{
"size": 12057960,

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

@ -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="47459eead04385e22f967012b824f5abdddcfb7c"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="27eb2f04e149fc2c9976d881b1b5984bbe7ee089"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "47459eead04385e22f967012b824f5abdddcfb7c",
"git_revision": "6280500a6cb8d1b178cdd163450e36d22846fbed",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "a28498a478babbaf0aa08c7ff84159330920961b",
"revision": "dc781340a4ceea99ea5f3e1be005befeff2be31b",
"repo_path": "integration/gaia-central"
}

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

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -4,9 +4,6 @@
# 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/.
if CONFIG['_MSC_VER'] and CONFIG['OS_TEST'] != 'x86_64':
TEST_DIRS += ['vmwarerecordinghelper']
TEST_DIRS += ['crashinjectdll']
if CONFIG['ENABLE_TESTS']:

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

@ -1,15 +0,0 @@
# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
SOURCES += [
'vmwarerecordinghelper.cpp',
]
SharedLibrary('vmwarerecordinghelper')
DEFFILE = '%s/%s.def' % (SRCDIR, LIBRARY_NAME)
USE_STATIC_LIBS = True

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

@ -1,34 +0,0 @@
/* 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/. */
/**
* The following code comes from "Starting and Stopping Recording of Virtual
* Machine Activity from Within the Guest":
*
* http://kb.vmware.com/selfservice/documentLink.do?externalID=1001401
*/
void __cdecl
StartRecording()
{
__asm {
mov eax, 564d5868h
mov ebx, 1
mov cx, 47
mov dx, 5658h
in eax, dx
}
}
void __cdecl
StopRecording()
{
__asm {
mov eax, 564d5868h
mov ebx, 2
mov cx, 47
mov dx, 5658h
in eax, dx
}
}

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

@ -1,8 +0,0 @@
;+# 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/.
LIBRARY vmwarerecordinghelper
EXPORTS
StartRecording
StopRecording

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

@ -25,7 +25,8 @@ Convert(bool aIn, BluetoothScanMode& aOut)
[false] = SCAN_MODE_CONNECTABLE,
[true] = SCAN_MODE_CONNECTABLE_DISCOVERABLE
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sScanMode))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sScanMode), bool, BluetoothScanMode)) {
aOut = SCAN_MODE_NONE; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -42,8 +43,11 @@ Convert(int32_t aIn, BluetoothTypeOfDevice& aOut)
[0x02] = TYPE_OF_DEVICE_BLE,
[0x03] = TYPE_OF_DEVICE_DUAL
};
if (NS_WARN_IF(!aIn) ||
NS_WARN_IF(static_cast<size_t>(aIn) >= MOZ_ARRAY_LENGTH(sTypeOfDevice))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
!aIn, int32_t, BluetoothTypeOfDevice) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
static_cast<size_t>(aIn) >= MOZ_ARRAY_LENGTH(sTypeOfDevice), int32_t,
BluetoothTypeOfDevice)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sTypeOfDevice[aIn];
@ -58,8 +62,11 @@ Convert(int32_t aIn, BluetoothScanMode& aOut)
[0x01] = SCAN_MODE_CONNECTABLE,
[0x02] = SCAN_MODE_CONNECTABLE_DISCOVERABLE
};
if (NS_WARN_IF(aIn < 0) ||
NS_WARN_IF(static_cast<size_t>(aIn) >= MOZ_ARRAY_LENGTH(sScanMode))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn < 0, int32_t, BluetoothScanMode) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
static_cast<size_t>(aIn) >= MOZ_ARRAY_LENGTH(sScanMode), int32_t,
BluetoothScanMode)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sScanMode[aIn];
@ -74,7 +81,9 @@ Convert(uint8_t aIn, BluetoothA2dpAudioState& aOut)
[0x01] = A2DP_AUDIO_STATE_STOPPED,
[0x02] = A2DP_AUDIO_STATE_STARTED
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAudioState))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sAudioState), uint8_t,
BluetoothA2dpAudioState)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sAudioState[aIn];
@ -90,7 +99,9 @@ Convert(uint8_t aIn, BluetoothA2dpConnectionState& aOut)
[0x02] = A2DP_CONNECTION_STATE_CONNECTED,
[0x03] = A2DP_CONNECTION_STATE_DISCONNECTING
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sConnectionState))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sConnectionState), uint8_t,
BluetoothA2dpConnectionState)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sConnectionState[aIn];
@ -104,7 +115,8 @@ Convert(uint8_t aIn, BluetoothAclState& aOut)
[0x00] = ACL_STATE_CONNECTED,
[0x01] = ACL_STATE_DISCONNECTED
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAclState))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sAclState), uint8_t, BluetoothAclState)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sAclState[aIn];
@ -125,10 +137,14 @@ Convert(uint8_t aIn, BluetoothAvrcpEvent& aOut)
[0x07] = static_cast<BluetoothAvrcpEvent>(0),
[0x08] = AVRCP_EVENT_APP_SETTINGS_CHANGED
};
if (NS_WARN_IF(!aIn) ||
NS_WARN_IF(aIn == 0x06) ||
NS_WARN_IF(aIn == 0x07) ||
NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAvrcpEvent))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
!aIn, uint8_t, BluetoothAvrcpEvent) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn == 0x06, uint8_t, BluetoothAvrcpEvent) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn == 0x07, uint8_t, BluetoothAvrcpEvent) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sAvrcpEvent), uint8_t, BluetoothAvrcpEvent)) {
aOut = static_cast<BluetoothAvrcpEvent>(0); // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -149,8 +165,11 @@ Convert(uint8_t aIn, BluetoothAvrcpMediaAttribute& aOut)
[0x06] = AVRCP_MEDIA_ATTRIBUTE_GENRE,
[0x07] = AVRCP_MEDIA_ATTRIBUTE_PLAYING_TIME
};
if (NS_WARN_IF(!aIn) ||
NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAvrcpMediaAttribute))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
!aIn, uint8_t, BluetoothAvrcpMediaAttrbiute) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sAvrcpMediaAttribute), uint8_t,
BluetoothAvrcpMediaAttribute)) {
// silences compiler warning
aOut = static_cast<BluetoothAvrcpMediaAttribute>(0);
return NS_ERROR_ILLEGAL_VALUE;
@ -169,8 +188,11 @@ Convert(uint8_t aIn, BluetoothAvrcpPlayerAttribute& aOut)
[0x03] = AVRCP_PLAYER_ATTRIBUTE_SHUFFLE,
[0x04] = AVRCP_PLAYER_ATTRIBUTE_SCAN
};
if (NS_WARN_IF(!aIn) ||
NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAvrcpPlayerAttribute))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
!aIn, uint8_t, BluetoothAvrcpPlayerAttrbiute) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sAvrcpPlayerAttribute), uint8_t,
BluetoothAvrcpPlayerAttribute)) {
// silences compiler warning
aOut = static_cast<BluetoothAvrcpPlayerAttribute>(0);
return NS_ERROR_ILLEGAL_VALUE;
@ -188,8 +210,11 @@ Convert(uint8_t aIn, BluetoothAvrcpRemoteFeature& aOut)
[0x02] = AVRCP_REMOTE_FEATURE_ABSOLUTE_VOLUME,
[0x03] = AVRCP_REMOTE_FEATURE_BROWSE
};
if (NS_WARN_IF(!aIn) ||
NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAvrcpRemoteFeature))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
!aIn, uint8_t, BluetoothAvrcpRemoteFeature) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sAvrcpRemoteFeature), uint8_t,
BluetoothAvrcpRemoteFeature)) {
// silences compiler warning
aOut = static_cast<BluetoothAvrcpRemoteFeature>(0);
return NS_ERROR_ILLEGAL_VALUE;
@ -206,7 +231,8 @@ Convert(uint8_t aIn, BluetoothBondState& aOut)
[0x01] = BOND_STATE_BONDING,
[0x02] = BOND_STATE_BONDED
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sBondState))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sBondState), uint8_t, BluetoothBondState)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sBondState[aIn];
@ -222,7 +248,9 @@ Convert(uint8_t aIn, BluetoothHandsfreeAudioState& aOut)
[0x02] = HFP_AUDIO_STATE_CONNECTED,
[0x03] = HFP_AUDIO_STATE_DISCONNECTING
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAudioState))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sAudioState), uint8_t,
BluetoothHandsfreeAudioState)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sAudioState[aIn];
@ -238,7 +266,9 @@ Convert(uint8_t aIn, BluetoothHandsfreeCallHoldType& aOut)
[0x02] = HFP_CALL_HOLD_HOLDACTIVE_ACCEPTHELD,
[0x03] = HFP_CALL_HOLD_ADDHELDTOCONF
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallHoldType))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sCallHoldType), uint8_t,
BluetoothHandsfreeCallHoldType)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sCallHoldType[aIn];
@ -255,7 +285,9 @@ Convert(uint8_t aIn, BluetoothHandsfreeConnectionState& aOut)
[0x03] = HFP_CONNECTION_STATE_SLC_CONNECTED,
[0x04] = HFP_CONNECTION_STATE_DISCONNECTING
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sConnectionState))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sConnectionState), uint8_t,
BluetoothHandsfreeConnectionState)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sConnectionState[aIn];
@ -269,7 +301,9 @@ Convert(uint8_t aIn, BluetoothHandsfreeNRECState& aOut)
[0x00] = HFP_NREC_STOPPED,
[0x01] = HFP_NREC_STARTED
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sNRECState))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sNRECState), uint8_t,
BluetoothHandsfreeNRECState)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sNRECState[aIn];
@ -283,7 +317,9 @@ Convert(uint8_t aIn, BluetoothHandsfreeVoiceRecognitionState& aOut)
[0x00] = HFP_VOICE_RECOGNITION_STOPPED,
[0x01] = HFP_VOICE_RECOGNITION_STARTED
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sState))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sState), uint8_t,
BluetoothHandsfreeVoiceRecognitionState)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sState[aIn];
@ -297,7 +333,9 @@ Convert(uint8_t aIn, BluetoothHandsfreeVolumeType& aOut)
[0x00] = HFP_VOLUME_TYPE_SPEAKER,
[0x01] = HFP_VOLUME_TYPE_MICROPHONE
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sVolumeType))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sVolumeType), uint8_t,
BluetoothHandsfreeVolumeType)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sVolumeType[aIn];
@ -312,7 +350,9 @@ Convert(uint8_t aIn, BluetoothHandsfreeWbsConfig& aOut)
[0x01] = HFP_WBS_NO,
[0x02] = HFP_WBS_YES
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sWbsConfig))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sWbsConfig), uint8_t,
BluetoothHandsfreeWbsConfig)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sWbsConfig[aIn];
@ -349,8 +389,11 @@ Convert(uint8_t aIn, BluetoothPropertyType& aOut)
aOut = PROPERTY_REMOTE_DEVICE_TIMESTAMP;
return NS_OK;
}
if (NS_WARN_IF(!aIn) ||
NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sPropertyType))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
!aIn, uint8_t, BluetoothPropertyType) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sPropertyType), uint8_t,
BluetoothPropertyType)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sPropertyType[aIn];
@ -367,9 +410,12 @@ Convert(BluetoothSocketType aIn, uint8_t& aOut)
[BluetoothSocketType::L2CAP] = 0x03
// EL2CAP not supported
};
if (NS_WARN_IF(aIn == BluetoothSocketType::EL2CAP) ||
NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sSocketType)) ||
NS_WARN_IF(!sSocketType[aIn])) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn == BluetoothSocketType::EL2CAP, BluetoothSocketType, uint8_t) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sSocketType), BluetoothSocketType, uint8_t) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
!sSocketType[aIn], BluetoothSocketType, uint8_t)) {
aOut = 0; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -386,7 +432,8 @@ Convert(uint8_t aIn, BluetoothSspVariant& aOut)
[0x02] = SSP_VARIANT_CONSENT,
[0x03] = SSP_VARIANT_PASSKEY_NOTIFICATION
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sSspVariant))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sSspVariant), uint8_t, BluetoothSspVariant)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sSspVariant[aIn];
@ -409,7 +456,8 @@ Convert(uint8_t aIn, BluetoothStatus& aOut)
[0x09] = STATUS_AUTH_FAILURE,
[0x0a] = STATUS_RMT_DEV_DOWN
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sStatus))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sStatus), uint8_t, BluetoothStatus)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sStatus[aIn];
@ -440,8 +488,11 @@ Convert(int32_t aIn, BluetoothGattStatus& aOut)
[0x0010] = GATT_STATUS_UNSUPPORTED_GROUP_TYPE,
[0x0011] = GATT_STATUS_INSUFFICIENT_RESOURCES
};
if (NS_WARN_IF(aIn < 0) ||
NS_WARN_IF(aIn >= static_cast<ssize_t>(MOZ_ARRAY_LENGTH(sGattStatus)))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn < 0, int32_t, BluetoothGattStatus) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= static_cast<ssize_t>(MOZ_ARRAY_LENGTH(sGattStatus)), int32_t,
BluetoothGattStatus)) {
aOut = GATT_STATUS_UNKNOWN_ERROR;
} else {
aOut = sGattStatus[aIn];
@ -466,7 +517,9 @@ Convert(const nsAString& aIn, BluetoothAddress& aOut)
nsresult
Convert(const nsAString& aIn, BluetoothPinCode& aOut)
{
if (NS_WARN_IF(aIn.Length() > MOZ_ARRAY_LENGTH(aOut.mPinCode))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn.Length() > MOZ_ARRAY_LENGTH(aOut.mPinCode), nsAString,
BluetoothPinCode)) {
return NS_ERROR_ILLEGAL_VALUE;
}
@ -499,7 +552,8 @@ Convert(const nsAString& aIn, BluetoothPropertyType& aOut)
aOut = PROPERTY_ADAPTER_SCAN_MODE;
} else if (aIn.EqualsLiteral("DiscoverableTimeout")) {
aOut = PROPERTY_ADAPTER_DISCOVERY_TIMEOUT;
} else {
} else if (MOZ_HAL_IPC_CONVERT_WARN_IF(
false, nsAString, BluetoothPropertyType)) {
BT_LOGR("Invalid property name: %s", NS_ConvertUTF16toUTF8(aIn).get());
aOut = static_cast<BluetoothPropertyType>(0); // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
@ -514,7 +568,8 @@ Convert(const nsAString& aIn, BluetoothServiceName& aOut)
const char* str = serviceNameUTF8.get();
size_t len = strlen(str);
if (NS_WARN_IF(len > sizeof(aOut.mName))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
len > sizeof(aOut.mName), nsAString, BluetoothServiceName)) {
return NS_ERROR_ILLEGAL_VALUE;
}
@ -544,7 +599,8 @@ Convert(BluetoothAclState aIn, bool& aOut)
[ACL_STATE_CONNECTED] = true,
[ACL_STATE_DISCONNECTED] = false
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sBool))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sBool), BluetoothAclState, bool)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sBool[aIn];
@ -563,9 +619,11 @@ Convert(const BluetoothAddress& aIn, nsAString& aOut)
static_cast<int>(aIn.mAddr[3]),
static_cast<int>(aIn.mAddr[4]),
static_cast<int>(aIn.mAddr[5]));
if (NS_WARN_IF(res < 0)) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
res < 0, BluetoothAddress, nsAString)) {
return NS_ERROR_ILLEGAL_VALUE;
} else if (NS_WARN_IF((size_t)res >= sizeof(str))) {
} else if (MOZ_HAL_IPC_CONVERT_WARN_IF(
(size_t)res >= sizeof(str), BluetoothAddress, nsAString)) {
return NS_ERROR_OUT_OF_MEMORY; /* string buffer too small */
}
@ -585,7 +643,8 @@ Convert(BluetoothAvrcpEvent aIn, uint8_t& aOut)
[AVRCP_EVENT_PLAY_POS_CHANGED] = 0x05,
[AVRCP_EVENT_APP_SETTINGS_CHANGED] = 0x08
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sValue), BluetoothAvrcpEvent, uint8_t)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sValue[aIn];
@ -599,7 +658,9 @@ Convert(BluetoothAvrcpNotification aIn, uint8_t& aOut)
[AVRCP_NTF_INTERIM] = 0x00,
[AVRCP_NTF_CHANGED] = 0x01
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sValue), BluetoothAvrcpNotification,
uint8_t)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sValue[aIn];
@ -615,7 +676,8 @@ Convert(BluetoothAvrcpPlayerAttribute aIn, uint8_t& aOut)
[AVRCP_PLAYER_ATTRIBUTE_SHUFFLE] = 0x03,
[AVRCP_PLAYER_ATTRIBUTE_SCAN] = 0x04
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sValue), BluetoothAvrcpPlayerAttribute, uint8_t)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sValue[aIn];
@ -625,8 +687,12 @@ Convert(BluetoothAvrcpPlayerAttribute aIn, uint8_t& aOut)
nsresult
Convert(BluetoothAvrcpRemoteFeature aIn, unsigned long& aOut)
{
if (NS_WARN_IF(aIn < std::numeric_limits<unsigned long>::min()) ||
NS_WARN_IF(aIn > std::numeric_limits<unsigned long>::max())) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn < std::numeric_limits<unsigned long>::min(),
BluetoothAvrcpRemoteFeature, unsigned long) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn > std::numeric_limits<unsigned long>::max(),
BluetoothAvrcpRemoteFeature, unsigned long)) {
aOut = 0; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -644,7 +710,8 @@ Convert(BluetoothAvrcpStatus aIn, uint8_t& aOut)
[AVRCP_STATUS_INTERNAL_ERROR] = 0x03,
[AVRCP_STATUS_SUCCESS] = 0x04
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sValue), BluetoothAvrcpStatus, uint8_t)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sValue[aIn];
@ -658,7 +725,9 @@ Convert(BluetoothHandsfreeAtResponse aIn, uint8_t& aOut)
[HFP_AT_RESPONSE_ERROR] = 0x00,
[HFP_AT_RESPONSE_OK] = 0x01
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAtResponse))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sAtResponse), BluetoothHandsfreeAtResponse,
uint8_t)) {
aOut = 0x00; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -673,7 +742,9 @@ Convert(BluetoothHandsfreeCallAddressType aIn, uint8_t& aOut)
[HFP_CALL_ADDRESS_TYPE_UNKNOWN] = 0x81,
[HFP_CALL_ADDRESS_TYPE_INTERNATIONAL] = 0x91
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallAddressType))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sCallAddressType),
BluetoothHandsfreeCallAddressType, uint8_t)) {
aOut = 0x00; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -688,7 +759,9 @@ Convert(BluetoothHandsfreeCallDirection aIn, uint8_t& aOut)
[HFP_CALL_DIRECTION_OUTGOING] = 0x00,
[HFP_CALL_DIRECTION_INCOMING] = 0x01
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallDirection))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sCallDirection),
BluetoothHandsfreeCallDirection, uint8_t)) {
aOut = 0x00; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -708,7 +781,9 @@ Convert(BluetoothHandsfreeCallState aIn, uint8_t& aOut)
[HFP_CALL_STATE_WAITING] = 0x05,
[HFP_CALL_STATE_IDLE] = 0x06
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallState))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sCallState), BluetoothHandsfreeCallState,
uint8_t)) {
aOut = 0x00; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -724,7 +799,8 @@ Convert(BluetoothHandsfreeCallMode aIn, uint8_t& aOut)
[HFP_CALL_MODE_DATA] = 0x01,
[HFP_CALL_MODE_FAX] = 0x02
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallMode))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sCallMode), BluetoothHandsfreeCallMode, uint8_t)) {
aOut = 0x00; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -739,7 +815,9 @@ Convert(BluetoothHandsfreeCallMptyType aIn, uint8_t& aOut)
[HFP_CALL_MPTY_TYPE_SINGLE] = 0x00,
[HFP_CALL_MPTY_TYPE_MULTI] = 0x01
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallMptyType))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sCallMptyType),
BluetoothHandsfreeCallMptyType, uint8_t)) {
aOut = 0x00; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -754,7 +832,9 @@ Convert(BluetoothHandsfreeNetworkState aIn, uint8_t& aOut)
[HFP_NETWORK_STATE_NOT_AVAILABLE] = 0x00,
[HFP_NETWORK_STATE_AVAILABLE] = 0x01
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sNetworkState))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sNetworkState), BluetoothHandsfreeNetworkState,
uint8_t)) {
aOut = 0x00; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -769,7 +849,9 @@ Convert(BluetoothHandsfreeServiceType aIn, uint8_t& aOut)
[HFP_SERVICE_TYPE_HOME] = 0x00,
[HFP_SERVICE_TYPE_ROAMING] = 0x01
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sServiceType))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sServiceType), BluetoothHandsfreeServiceType,
uint8_t)) {
aOut = 0x00; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -784,7 +866,9 @@ Convert(BluetoothHandsfreeVolumeType aIn, uint8_t& aOut)
[HFP_VOLUME_TYPE_SPEAKER] = 0x00,
[HFP_VOLUME_TYPE_MICROPHONE] = 0x01
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sVolumeType))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sVolumeType), BluetoothHandsfreeVolumeType,
uint8_t)) {
aOut = 0x00; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -800,7 +884,9 @@ Convert(BluetoothHandsfreeWbsConfig aIn, uint8_t& aOut)
[HFP_WBS_NO] = 0x01,
[HFP_WBS_YES] = 0x02
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sWbsConfig))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sWbsConfig), BluetoothHandsfreeWbsConfig,
uint8_t)) {
aOut = 0x00; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -827,7 +913,9 @@ Convert(BluetoothPropertyType aIn, uint8_t& aOut)
[PROPERTY_REMOTE_VERSION_INFO] = 0x0c,
[PROPERTY_REMOTE_DEVICE_TIMESTAMP] = 0xff
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sPropertyType))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sPropertyType), BluetoothPropertyType,
uint8_t)) {
aOut = 0x00; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -855,7 +943,8 @@ Convert(BluetoothScanMode aIn, int32_t& aOut)
[SCAN_MODE_CONNECTABLE] = 0x01,
[SCAN_MODE_CONNECTABLE_DISCOVERABLE] = 0x02
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sScanMode))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sScanMode), BluetoothScanMode, int32_t)) {
aOut = 0; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -872,7 +961,8 @@ Convert(BluetoothSspVariant aIn, uint8_t& aOut)
[SSP_VARIANT_CONSENT] = 0x02,
[SSP_VARIANT_PASSKEY_NOTIFICATION] = 0x03
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sValue), BluetoothSspVariant, uint8_t)) {
aOut = 0; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -896,7 +986,8 @@ Convert(ControlPlayStatus aIn, uint8_t& aOut)
aOut = 0xff;
return NS_OK;
}
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sValue), ControlPlayStatus, uint8_t)) {
aOut = 0; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -914,7 +1005,9 @@ Convert(BluetoothGattAuthReq aIn, int32_t& aOut)
[GATT_AUTH_REQ_SIGNED_NO_MITM] = 0x03,
[GATT_AUTH_REQ_SIGNED_MITM] = 0x04
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sGattAuthReq))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sGattAuthReq), BluetoothGattAuthReq,
int32_t)) {
aOut = GATT_AUTH_REQ_NONE; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -931,7 +1024,9 @@ Convert(BluetoothGattWriteType aIn, int32_t& aOut)
[GATT_WRITE_TYPE_PREPARE] = 0x03,
[GATT_WRITE_TYPE_SIGNED] = 0x04
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sGattWriteType))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sGattWriteType), BluetoothGattWriteType,
int32_t)) {
aOut = GATT_WRITE_TYPE_NORMAL; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -1048,7 +1143,8 @@ PackPDU(const BluetoothAvrcpElementAttribute& aIn, DaemonSocketPDU& aPDU)
const NS_ConvertUTF16toUTF8 cstr(aIn.mValue);
if (NS_WARN_IF(cstr.Length() == PR_UINT32_MAX)) {
if (MOZ_HAL_IPC_PACK_WARN_IF(
cstr.Length() == PR_UINT32_MAX, BluetoothAvrcpElementAttribute)) {
return NS_ERROR_ILLEGAL_VALUE; /* integer overflow detected */
}
@ -1238,7 +1334,7 @@ PackPDU(const BluetoothNamedValue& aIn, DaemonSocketPDU& aPDU)
rv = PackPDU(static_cast<uint16_t>(sizeof(int32_t)),
PackConversion<bool, BluetoothScanMode>(value), aPDU);
} else {
} else if (MOZ_HAL_IPC_PACK_WARN_IF(true, BluetoothNamedValue)) {
BT_LOGR("Invalid property value type");
rv = NS_ERROR_ILLEGAL_VALUE;
}
@ -1490,7 +1586,7 @@ UnpackPDU(DaemonSocketPDU& aPDU, BluetoothProperty& aOut)
/* fall through */
case PROPERTY_REMOTE_FRIENDLY_NAME: {
const uint8_t* data = aPDU.Consume(len);
if (NS_WARN_IF(!data)) {
if (MOZ_HAL_IPC_UNPACK_WARN_IF(!data, BluetoothProperty)) {
return NS_ERROR_ILLEGAL_VALUE;
}
// We construct an nsCString here because the string

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

@ -319,7 +319,8 @@ BluetoothServiceBluedroid::StopInternal(BluetoothReplyRunnable* aRunnable)
if (sProfiles[i]->IsConnected()) {
sProfiles[i]->Disconnect(nullptr);
} else if (!profileName.EqualsLiteral("OPP") &&
!profileName.EqualsLiteral("PBAP")) {
!profileName.EqualsLiteral("PBAP") &&
!profileName.EqualsLiteral("MapSms")) {
sProfiles[i]->Reset();
}
}

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

@ -532,8 +532,6 @@ BluetoothService::HandleShutdown()
// bluetooth is going away, and then we wait for them to acknowledge. Then we
// close down all the bluetooth machinery.
sInShutdown = true;
Cleanup();
AutoInfallibleTArray<BluetoothParent*, 10> childActors;
@ -633,6 +631,13 @@ BluetoothService::Observe(nsISupports* aSubject, const char* aTopic,
}
if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
/**
* |sInShutdown| flag should be set for instances created in content
* processes or parent processes. Please see bug 1199653 for detailed
* information.
*/
sInShutdown = true;
return HandleShutdown();
}

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

@ -4917,9 +4917,10 @@ HTMLInputElement::GetFilesAndDirectories(ErrorResult& aRv)
}
int32_t leafSeparatorIndex = path.RFind(FILE_PATH_SEPARATOR);
nsDependentSubstring dirname = Substring(path, 0, leafSeparatorIndex);
nsDependentSubstring basename = Substring(path, leafSeparatorIndex);
fs = MakeOrReuseFileSystem(dirname, fs, window);
filesAndDirsSeq[i].SetAsDirectory() = new Directory(fs, basename);
nsAutoString dompath(NS_LITERAL_STRING(FILESYSTEM_DOM_PATH_SEPARATOR));
dompath.Append(Substring(path, leafSeparatorIndex + 1));
filesAndDirsSeq[i].SetAsDirectory() = new Directory(fs, dompath);
} else {
filesAndDirsSeq[i].SetAsFile() = filesAndDirs[i];
}

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

@ -42,6 +42,7 @@ NS_IMPL_ELEMENT_CLONE(HTMLVideoElement)
HTMLVideoElement::HTMLVideoElement(already_AddRefed<NodeInfo>& aNodeInfo)
: HTMLMediaElement(aNodeInfo)
, mUseScreenWakeLock(true)
{
}
@ -186,6 +187,19 @@ bool HTMLVideoElement::MozHasAudio() const
return HasAudio();
}
bool HTMLVideoElement::MozUseScreenWakeLock() const
{
MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
return mUseScreenWakeLock;
}
void HTMLVideoElement::SetMozUseScreenWakeLock(bool aValue)
{
MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
mUseScreenWakeLock = aValue;
UpdateScreenWakeLock();
}
JSObject*
HTMLVideoElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
@ -250,14 +264,15 @@ HTMLVideoElement::UpdateScreenWakeLock()
{
bool hidden = OwnerDoc()->Hidden();
if (mScreenWakeLock && (mPaused || hidden)) {
if (mScreenWakeLock && (mPaused || hidden || !mUseScreenWakeLock)) {
ErrorResult rv;
mScreenWakeLock->Unlock(rv);
mScreenWakeLock = nullptr;
return;
}
if (!mScreenWakeLock && !mPaused && !hidden && HasVideo()) {
if (!mScreenWakeLock && !mPaused && !hidden &&
mUseScreenWakeLock && HasVideo()) {
nsRefPtr<power::PowerManagerService> pmService =
power::PowerManagerService::GetInstance();
NS_ENSURE_TRUE_VOID(pmService);

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

@ -105,6 +105,10 @@ public:
bool MozHasAudio() const;
bool MozUseScreenWakeLock() const;
void SetMozUseScreenWakeLock(bool aValue);
bool NotifyOwnerDocumentActivityChangedInternal() override;
already_AddRefed<VideoPlaybackQuality> GetVideoPlaybackQuality();
@ -118,6 +122,7 @@ protected:
virtual void WakeLockRelease() override;
void UpdateScreenWakeLock();
bool mUseScreenWakeLock;
nsRefPtr<WakeLock> mScreenWakeLock;
private:

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

@ -31,6 +31,7 @@ function testVideoPlayPause() {
var content = document.getElementById('content');
var video = document.createElement('video');
ok(video.mozUseScreenWakeLock, "#1 Video element uses screen wake lock by default");
video.src = "wakelock.ogv";
content.appendChild(video);
@ -83,6 +84,7 @@ function testVideoPlay() {
var content = document.getElementById('content');
var video = document.createElement('video');
ok(video.mozUseScreenWakeLock, "#2 Video element uses screen wake lock by default");
video.src = "wakelock.ogv";
content.appendChild(video);
@ -124,7 +126,57 @@ function testVideoPlay() {
video.play();
}
var tests = [ testVideoPlayPause, testVideoPlay ];
function testVideoNoScreenWakeLock() {
info("#3 testVideoNoScreenWakeLock");
var lockState_cpu = true;
var lockState_screen = false;
var count_cpu = 0;
var content = document.getElementById('content');
var video = document.createElement('video');
video.mozUseScreenWakeLock = false;
video.src = "wakelock.ogv";
content.appendChild(video);
var startDate;
function testVideoNoScreenWakeLockListener(topic, state) {
info("#3 topic=" + topic + ", state=" + state);
var locked = state == "locked-foreground" ||
state == "locked-background";
if (topic == "cpu") {
is(locked, lockState_cpu, "#3 Video element locked the cpu");
count_cpu++;
} else if (topic == "screen") {
is(locked, lockState_screen, "#3 Video element locked the screen");
}
if (count_cpu == 1) {
info("#3 Cpu is locked");
// The next step is to unlock the resource.
lockState_cpu = false;
video.pause();
startDate = new Date();
}
if (count_cpu == 2) {
var diffDate = (new Date() - startDate);
ok(diffDate > 200, "#3 There was at least 200 milliseconds between the stop and the wakelock release");
content.removeChild(video);
navigator.mozPower.removeWakeLockListener(testVideoNoScreenWakeLockListener);
runTests();
}
}
navigator.mozPower.addWakeLockListener(testVideoNoScreenWakeLockListener);
video.play();
}
var tests = [ testVideoPlayPause, testVideoPlay, testVideoNoScreenWakeLock ];
function runTests() {
if (!tests.length) {
SimpleTest.finish();
@ -138,7 +190,8 @@ function runTests() {
SpecialPowers.pushPermissions(
[{'type': 'power', 'allow': true, 'context': document}],
function() {
SpecialPowers.pushPrefEnv({"set": [["media.wakelock_timeout", 500]]}, runTests);
SpecialPowers.pushPrefEnv({"set": [["media.wakelock_timeout", 500],
["dom.wakelock.enabled", true]]}, runTests);
});
SimpleTest.waitForExplicitFinish();

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

@ -142,6 +142,7 @@
#include "nsIXULRuntime.h"
#include "gfxDrawable.h"
#include "ImageOps.h"
#include "mozilla/dom/nsMixedContentBlocker.h"
#include "nsMemoryInfoDumper.h"
#include "nsMemoryReporterManager.h"
#include "nsServiceManagerUtils.h"
@ -4175,6 +4176,17 @@ ContentParent::RecvIsSecureURI(const uint32_t& type,
return NS_SUCCEEDED(rv);
}
bool
ContentParent::RecvAccumulateMixedContentHSTS(const URIParams& aURI, const bool& aActive)
{
nsCOMPtr<nsIURI> ourURI = DeserializeURI(aURI);
if (!ourURI) {
return false;
}
nsMixedContentBlocker::AccumulateMixedContentHSTS(ourURI, aActive);
return true;
}
bool
ContentParent::RecvLoadURIExternal(const URIParams& uri)
{

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

@ -626,6 +626,8 @@ private:
virtual bool RecvIsSecureURI(const uint32_t& aType, const URIParams& aURI,
const uint32_t& aFlags, bool* aIsSecureURI) override;
virtual bool RecvAccumulateMixedContentHSTS(const URIParams& aURI, const bool& aActive) override;
virtual bool DeallocPHalParent(PHalParent*) override;
virtual PIccParent* AllocPIccParent(const uint32_t& aServiceId) override;

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

@ -751,6 +751,8 @@ parent:
sync IsSecureURI(uint32_t type, URIParams uri, uint32_t flags)
returns (bool isSecureURI);
async AccumulateMixedContentHSTS(URIParams uri, bool active);
sync GetLookAndFeelCache()
returns (LookAndFeelInt[] lookAndFeelIntCache);
@ -788,7 +790,7 @@ parent:
PFMRadio();
PWebrtcGlobal();
PPresentation();
// Services remoting

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

@ -134,6 +134,7 @@ LOCAL_INCLUDES += [
'/dom/geolocation',
'/dom/media/webspeech/synth/ipc',
'/dom/mobilemessage/ipc',
'/dom/security',
'/dom/storage',
'/dom/workers',
'/editor/libeditor',

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

@ -84,7 +84,7 @@ static const char kContentTimeoutPref[] = "dom.ipc.plugins.contentTimeoutSecs";
static const char kChildTimeoutPref[] = "dom.ipc.plugins.timeoutSecs";
static const char kParentTimeoutPref[] = "dom.ipc.plugins.parentTimeoutSecs";
static const char kLaunchTimeoutPref[] = "dom.ipc.plugins.processLaunchTimeoutSecs";
static const char kAsyncInitPref[] = "dom.ipc.plugins.asyncInit";
static const char kAsyncInitPref[] = "dom.ipc.plugins.asyncInit.enabled";
#ifdef XP_WIN
static const char kHangUITimeoutPref[] = "dom.ipc.plugins.hangUITimeoutSecs";
static const char kHangUIMinDisplayPref[] = "dom.ipc.plugins.hangUIMinDisplaySecs";

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

@ -33,6 +33,8 @@ UNIFIED_SOURCES += [
'SRIMetadata.cpp',
]
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'/caps',
@ -40,5 +42,5 @@ LOCAL_INCLUDES += [
]
if CONFIG['GNU_CC']:
CFLAGS += ['-Wshadow', '-Wformat-security']
CXXFLAGS += ['-Wshadow', '-Wformat-security']
CFLAGS += ['-Wformat-security']
CXXFLAGS += ['-Wformat-security']

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

@ -32,8 +32,13 @@
#include "nsIChannelEventSink.h"
#include "nsAsyncRedirectVerifyHelper.h"
#include "mozilla/LoadInfo.h"
#include "nsISiteSecurityService.h"
#include "mozilla/Logging.h"
#include "mozilla/Telemetry.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/ipc/URIUtils.h"
using namespace mozilla;
@ -342,7 +347,7 @@ nsMixedContentBlocker::ShouldLoad(uint32_t aContentType,
// callers of this method don't know whether the load went through cached
// image redirects. This is handled by direct callers of the static
// ShouldLoad.
nsresult rv = ShouldLoad(false, //aHadInsecureImageRedirect
nsresult rv = ShouldLoad(false, // aHadInsecureImageRedirect
aContentType,
aContentLocation,
aRequestingLocation,
@ -381,7 +386,6 @@ nsMixedContentBlocker::ShouldLoad(bool aHadInsecureImageRedirect,
// Make decision to block/reject by default
*aDecision = REJECT_REQUEST;
// Notes on non-obvious decisions:
//
// TYPE_DTD: A DTD can contain entity definitions that expand to scripts.
@ -718,6 +722,33 @@ nsMixedContentBlocker::ShouldLoad(bool aHadInsecureImageRedirect,
}
nsresult stateRV = securityUI->GetState(&state);
// At this point we know that the request is mixed content, and the only
// question is whether we block it. Record telemetry at this point as to
// whether HSTS would have fixed things by making the content location
// into an HTTPS URL.
//
// Note that we count this for redirects as well as primary requests. This
// will cause some degree of double-counting, especially when mixed content
// is not blocked (e.g., for images). For more detail, see:
// https://bugzilla.mozilla.org/show_bug.cgi?id=1198572#c19
//
// We do not count requests aHadInsecureImageRedirect=true, since these are
// just an artifact of the image caching system.
bool active = (classification == eMixedScript);
if (!aHadInsecureImageRedirect) {
if (XRE_IsParentProcess()) {
AccumulateMixedContentHSTS(aContentLocation, active);
} else {
// Ask the parent process to do the same call
mozilla::dom::ContentChild* cc = mozilla::dom::ContentChild::GetSingleton();
if (cc) {
mozilla::ipc::URIParams uri;
SerializeURI(aContentLocation, uri);
cc->SendAccumulateMixedContentHSTS(uri, active);
}
}
}
// If the content is display content, and the pref says display content should be blocked, block it.
if (sBlockMixedDisplay && classification == eMixedDisplay) {
if (allowMixedContent) {
@ -857,3 +888,54 @@ nsMixedContentBlocker::ShouldProcess(uint32_t aContentType,
aRequestingContext, aMimeGuess, aExtra, aRequestPrincipal,
aDecision);
}
enum MixedContentHSTSState {
MCB_HSTS_PASSIVE_NO_HSTS = 0,
MCB_HSTS_PASSIVE_WITH_HSTS = 1,
MCB_HSTS_ACTIVE_NO_HSTS = 2,
MCB_HSTS_ACTIVE_WITH_HSTS = 3
};
// Record information on when HSTS would have made mixed content not mixed
// content (regardless of whether it was actually blocked)
void
nsMixedContentBlocker::AccumulateMixedContentHSTS(nsIURI* aURI, bool aActive)
{
// This method must only be called in the parent, because
// nsSiteSecurityService is only available in the parent
if (!XRE_IsParentProcess()) {
MOZ_ASSERT(false);
return;
}
bool hsts;
nsresult rv;
nsCOMPtr<nsISiteSecurityService> sss = do_GetService(NS_SSSERVICE_CONTRACTID, &rv);
if (NS_FAILED(rv)) {
return;
}
rv = sss->IsSecureURI(nsISiteSecurityService::HEADER_HSTS, aURI, 0, &hsts);
if (NS_FAILED(rv)) {
return;
}
if (!aActive) {
if (!hsts) {
Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS,
MCB_HSTS_PASSIVE_NO_HSTS);
}
else {
Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS,
MCB_HSTS_PASSIVE_WITH_HSTS);
}
} else {
if (!hsts) {
Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS,
MCB_HSTS_ACTIVE_NO_HSTS);
}
else {
Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS,
MCB_HSTS_ACTIVE_WITH_HSTS);
}
}
}

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

@ -59,6 +59,7 @@ public:
nsISupports* aExtra,
nsIPrincipal* aRequestPrincipal,
int16_t* aDecision);
static void AccumulateMixedContentHSTS(nsIURI* aURI, bool aActive);
static bool sBlockMixedScript;
static bool sBlockMixedDisplay;
};

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

@ -486,6 +486,18 @@ NetworkManager.prototype = {
networkInterfaceLinks: null,
get allNetworkInfo() {
let allNetworkInfo = {};
for (let networkId in this.networkInterfaces) {
if (this.networkInterfaces.hasOwnProperty(networkId)) {
allNetworkInfo[networkId] = this.networkInterfaces[networkId].info;
}
}
return allNetworkInfo;
},
_preferredNetworkType: DEFAULT_PREFERRED_NETWORK_TYPE,
get preferredNetworkType() {
return this._preferredNetworkType;

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

@ -5,6 +5,7 @@ MARIONETTE_CONTEXT = "chrome";
const SETTINGS_KEY_DATA_ENABLED = "ril.data.enabled";
const SETTINGS_KEY_DATA_APN_SETTINGS = "ril.data.apnSettings";
const SETTINGS_KEY_WIFI_ENABLED = "wifi.enabled";
const TOPIC_CONNECTION_STATE_CHANGED = "network-connection-state-changed";
const TOPIC_NETWORK_ACTIVE_CHANGED = "network-active-changed";
@ -129,6 +130,34 @@ function waitForObserverEvent(aTopic) {
return deferred.promise;
}
/**
* Wait for one named event.
*
* Resolve if that named event occurs. Never reject.
*
* Fulfill params: the DOMEvent passed.
*
* @param aEventTarget
* An EventTarget object.
* @param aEventName
* A string event name.
* @param aMatchFun [optional]
* A matching function returns true or false to filter the event.
*
* @return A deferred promise.
*/
function waitForTargetEvent(aEventTarget, aEventName, aMatchFun) {
return new Promise(function(aResolve, aReject) {
aEventTarget.addEventListener(aEventName, function onevent(aEvent) {
if (!aMatchFun || aMatchFun(aEvent)) {
aEventTarget.removeEventListener(aEventName, onevent);
ok(true, "Event '" + aEventName + "' got.");
aResolve(aEvent);
}
});
});
}
/**
* Set the default data connection enabling state, wait for
* "network-connection-state-changed" event and verify state.

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

@ -14,3 +14,4 @@ disabled = Bug 808783
[test_multiple_data_connection.js]
[test_data_connection_proxy.js]
[test_network_interface_list_service.js]
[test_all_network_info.js]

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

@ -0,0 +1,106 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
let networkManager =
Cc["@mozilla.org/network/manager;1"].getService(Ci.nsINetworkManager);
ok(networkManager,
"networkManager.constructor is " + networkManager.constructor);
let wifiManager = window.navigator.mozWifiManager;
ok(wifiManager, "wifiManager.constructor is " + wifiManager.constructor);
function setEmulatorAPN() {
let apn = [
[{"carrier":"T-Mobile US",
"apn":"epc.tmobile.com",
"mmsc":"http://mms.msg.eng.t-mobile.com/mms/wapenc",
"types":["default","supl","mms","ims","dun", "fota"]}]
];
return setSettings(SETTINGS_KEY_DATA_APN_SETTINGS, apn);
}
function ensureWifiEnabled(aEnabled) {
if (wifiManager.enabled === aEnabled) {
log('Already ' + (aEnabled ? 'enabled' : 'disabled'));
return Promise.resolve();
}
return requestWifiEnabled(aEnabled);
}
function requestWifiEnabled(aEnabled) {
let promises = [];
promises.push(waitForTargetEvent(wifiManager, aEnabled ? 'enabled' : 'disabled',
function() {
return wifiManager.enabled === aEnabled ? true : false;
}));
promises.push(setSettings(SETTINGS_KEY_WIFI_ENABLED, aEnabled));
return Promise.all(promises);
}
// Test initial State
function verifyInitialState() {
log("= verifyInitialState =");
// Data and wifi should be off before starting any test.
return getSettings(SETTINGS_KEY_DATA_ENABLED)
.then(value => {
is(value, false, "Data must be off");
})
.then(() => ensureWifiEnabled(false));
}
function testAllNetworkInfo(aAnyConnected) {
log("= testAllNetworkInfo = " + aAnyConnected);
let allNetworkInfo = networkManager.allNetworkInfo;
ok(allNetworkInfo, "NetworkManager.allNetworkInfo");
let count = Object.keys(allNetworkInfo).length;
ok(count > 0, "NetworkManager.allNetworkInfo count");
let connected = false;
for (let networkId in allNetworkInfo) {
if (allNetworkInfo.hasOwnProperty(networkId)) {
let networkInfo = allNetworkInfo[networkId];
if (networkInfo.state == Ci.nsINetworkInfo.NETWORK_STATE_CONNECTED) {
connected = true;
break;
}
}
}
is(aAnyConnected, connected, "NetworkManager.allNetworkInfo any connected");
}
// Start test
startTestBase(function() {
let origApnSettings, origWifiEnabled;
return Promise.resolve()
.then(() => {
origWifiEnabled = wifiManager.enabled;
})
.then(() => verifyInitialState())
.then(() => getSettings(SETTINGS_KEY_DATA_APN_SETTINGS))
.then(value => {
origApnSettings = value;
})
.then(() => setEmulatorAPN())
.then(() => setDataEnabledAndWait(true))
.then(() => testAllNetworkInfo(true))
.then(() => setDataEnabledAndWait(false))
.then(() => testAllNetworkInfo(false))
// Restore original apn settings and wifi state.
.then(() => {
if (origApnSettings) {
return setSettings(SETTINGS_KEY_DATA_APN_SETTINGS, origApnSettings);
}
})
.then(() => ensureWifiEnabled(origWifiEnabled));
});

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

@ -44,6 +44,10 @@ partial interface HTMLVideoElement {
// True if the video has an audio track available.
readonly attribute boolean mozHasAudio;
// True if the video should use a screen wake lock.
[Pref="dom.wakelock.enabled", Func="Navigator::HasWakeLockSupport"]
attribute boolean mozUseScreenWakeLock;
};
// https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#idl-def-HTMLVideoElement

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

@ -651,7 +651,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
bool* aIsReady, nsXBLBinding** aResult)
{
// More than 6 binding URIs are rare, see bug 55070 comment 18.
nsAutoTArray<nsIURI*, 6> uris;
nsAutoTArray<nsCOMPtr<nsIURI>, 6> uris;
return GetBinding(aBoundElement, aURI, aPeekOnly, aOriginPrincipal, aIsReady,
aResult, uris);
}
@ -708,7 +708,7 @@ nsresult
nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
bool aPeekOnly, nsIPrincipal* aOriginPrincipal,
bool* aIsReady, nsXBLBinding** aResult,
nsTArray<nsIURI*>& aDontExtendURIs)
nsTArray<nsCOMPtr<nsIURI>>& aDontExtendURIs)
{
NS_ASSERTION(aPeekOnly || aResult,
"Must have non-null out param if not just peeking to see "
@ -784,7 +784,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
rv = protoBinding->ResolveBaseBinding();
NS_ENSURE_SUCCESS(rv, rv);
nsIURI* baseBindingURI;
nsCOMPtr<nsIURI> baseBindingURI;
nsXBLPrototypeBinding* baseProto = protoBinding->GetBasePrototype();
if (baseProto) {
baseBindingURI = baseProto->BindingURI();
@ -818,7 +818,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
nsRefPtr<nsXBLBinding> baseBinding;
if (baseBindingURI) {
nsIContent* child = protoBinding->GetBindingElement();
nsCOMPtr<nsIContent> child = protoBinding->GetBindingElement();
rv = GetBinding(aBoundElement, baseBindingURI, aPeekOnly,
child->NodePrincipal(), aIsReady,
getter_AddRefs(baseBinding), aDontExtendURIs);
@ -830,6 +830,8 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
if (!aPeekOnly) {
// Make a new binding
protoBinding = docInfo->GetPrototypeBinding(ref);
NS_ENSURE_STATE(protoBinding);
nsXBLBinding *newBinding = new nsXBLBinding(protoBinding);
if (baseBinding) {

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

@ -109,7 +109,7 @@ protected:
nsresult GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
bool aPeekFlag, nsIPrincipal* aOriginPrincipal,
bool* aIsReady, nsXBLBinding** aResult,
nsTArray<nsIURI*>& aDontExtendURIs);
nsTArray<nsCOMPtr<nsIURI>>& aDontExtendURIs);
// MEMBER VARIABLES
public:

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

@ -7,23 +7,60 @@
#include "DaemonSocketPDUHelpers.h"
#include <limits>
// Enable this constant to abort Gecko on IPC errors. This is helpful
// for debugging, but should *never* be enabled by default.
#define MOZ_HAL_ABORT_ON_IPC_ERRORS (0)
#ifdef CHROMIUM_LOG
#undef CHROMIUM_LOG
#endif
#if defined(MOZ_WIDGET_GONK)
#include <android/log.h>
#define CHROMIUM_LOG(args...) __android_log_print(ANDROID_LOG_INFO, "I/O", args);
#define CHROMIUM_LOG(args...) \
__android_log_print(ANDROID_LOG_INFO, "HAL-IPC", args);
#define CHROMIUM_LOG_VA(fmt, ap) \
__android_log_vprint(ANDROID_LOG_INFO, "HAL-IPC", fmt, ap);
#else
#include <stdio.h>
#define IODEBUG true
#define CHROMIUM_LOG(args...) if (IODEBUG) printf(args);
#define CHROMIUM_LOG(args...) if (IODEBUG) { printf(args); }
#define CHROMIUM_LOG_VA(fmt, ap) if (IODEBUG) { vprintf(fmt, ap); }
#endif
namespace mozilla {
namespace ipc {
namespace DaemonSocketPDUHelpers {
//
// Logging
//
namespace detail {
void
LogProtocolError(const char* aFmt, ...)
{
va_list ap;
va_start(ap, aFmt);
CHROMIUM_LOG_VA(aFmt, ap);
va_end(ap);
if (MOZ_HAL_ABORT_ON_IPC_ERRORS) {
MOZ_CRASH("HAL IPC protocol error");
}
}
} // namespace detail
//
// Conversion
//
@ -35,7 +72,8 @@ Convert(bool aIn, uint8_t& aOut)
[false] = 0x00,
[true] = 0x01
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sValue), bool, uint8_t)) {
aOut = 0;
return NS_ERROR_ILLEGAL_VALUE;
}
@ -59,8 +97,10 @@ Convert(bool aIn, int32_t& aOut)
nsresult
Convert(int aIn, uint8_t& aOut)
{
if (NS_WARN_IF(aIn < std::numeric_limits<uint8_t>::min()) ||
NS_WARN_IF(aIn > std::numeric_limits<uint8_t>::max())) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn < std::numeric_limits<uint8_t>::min(), int, uint8_t) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn > std::numeric_limits<uint8_t>::max(), int, uint8_t)) {
aOut = 0; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -71,8 +111,10 @@ Convert(int aIn, uint8_t& aOut)
nsresult
Convert(int aIn, int16_t& aOut)
{
if (NS_WARN_IF(aIn < std::numeric_limits<int16_t>::min()) ||
NS_WARN_IF(aIn > std::numeric_limits<int16_t>::max())) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn < std::numeric_limits<int16_t>::min(), int, int16_t) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn > std::numeric_limits<int16_t>::max(), int, int16_t)) {
aOut = 0; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -83,8 +125,10 @@ Convert(int aIn, int16_t& aOut)
nsresult
Convert(int aIn, int32_t& aOut)
{
if (NS_WARN_IF(aIn < std::numeric_limits<int32_t>::min()) ||
NS_WARN_IF(aIn > std::numeric_limits<int32_t>::max())) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn < std::numeric_limits<int32_t>::min(), int, int32_t) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn > std::numeric_limits<int32_t>::max(), int, int32_t)) {
aOut = 0; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -99,7 +143,8 @@ Convert(uint8_t aIn, bool& aOut)
[0x00] = false,
[0x01] = true
};
if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sBool))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn >= MOZ_ARRAY_LENGTH(sBool), uint8_t, bool)) {
return NS_ERROR_ILLEGAL_VALUE;
}
aOut = sBool[aIn];
@ -137,8 +182,10 @@ Convert(uint32_t aIn, int& aOut)
nsresult
Convert(uint32_t aIn, uint8_t& aOut)
{
if (NS_WARN_IF(aIn < std::numeric_limits<uint8_t>::min()) ||
NS_WARN_IF(aIn > std::numeric_limits<uint8_t>::max())) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn < std::numeric_limits<uint8_t>::min(), uint32_t, uint8_t) ||
MOZ_HAL_IPC_CONVERT_WARN_IF(
aIn > std::numeric_limits<uint8_t>::max(), uint32_t, uint8_t)) {
aOut = 0; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -149,7 +196,7 @@ Convert(uint32_t aIn, uint8_t& aOut)
nsresult
Convert(size_t aIn, uint16_t& aOut)
{
if (NS_WARN_IF(aIn >= (1ul << 16))) {
if (MOZ_HAL_IPC_CONVERT_WARN_IF(aIn >= (1ul << 16), size_t, uint16_t)) {
aOut = 0; // silences compiler warning
return NS_ERROR_ILLEGAL_VALUE;
}
@ -209,19 +256,19 @@ UnpackPDU(DaemonSocketPDU& aPDU, nsDependentCString& aOut)
// the string in the PDU, we can copy the actual bytes.
const char* str = reinterpret_cast<const char*>(aPDU.Consume(1));
if (NS_WARN_IF(!str)) {
if (MOZ_HAL_IPC_UNPACK_WARN_IF(!str, nsDependentCString)) {
return NS_ERROR_ILLEGAL_VALUE; // end of PDU
}
const char* end = static_cast<char*>(memchr(str, '\0', aPDU.GetSize() + 1));
if (NS_WARN_IF(!end)) {
if (MOZ_HAL_IPC_UNPACK_WARN_IF(!end, nsDependentCString)) {
return NS_ERROR_ILLEGAL_VALUE; // no string terminator
}
ptrdiff_t len = end - str;
const uint8_t* rest = aPDU.Consume(len);
if (NS_WARN_IF(!rest)) {
if (MOZ_HAL_IPC_UNPACK_WARN_IF(!rest, nsDependentCString)) {
// We couldn't consume bytes that should have been there.
return NS_ERROR_ILLEGAL_VALUE;
}
@ -278,7 +325,7 @@ PDUInitOp::WarnAboutTrailingData() const
uint16_t payloadSize;
mPDU->GetHeader(service, opcode, payloadSize);
CHROMIUM_LOG(
detail::LogProtocolError(
"Unpacked PDU of type (%x,%x) still contains %zu Bytes of data.",
service, opcode, size);
}

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

@ -34,6 +34,78 @@ struct DaemonSocketPDUHeader {
namespace DaemonSocketPDUHelpers {
//
// Logging
//
// The HAL IPC logging macros below print clear error messages for
// failed IPC operations. Use |MOZ_HAL_IPC_CONVERT_WARN_IF|,
// |MOZ_HAL_IPC_PACK_WARN_IF| and |MOZ_HAL_IPC_UNPACK_WARN_IF| to
// test for failures when processing PDUs.
//
// All macros accept the test condition as their first argument, and
// additional type information: the convert macro takes the input and
// output types, the pack macro takes the input type, and the unpack
// macro takes output type. All macros return the result of the test
// condition. If the test fails (i.e., the condition is true), they
// output a warning to the log.
//
// Don't call the functions in the detail namespace. They are helpers
// and not for general use.
//
namespace detail {
void
LogProtocolError(const char*, ...);
inline bool
ConvertWarnIfImpl(const char* aFile, unsigned long aLine,
bool aCondition, const char* aExpr, const char* aIn,
const char* aOut)
{
if (MOZ_UNLIKELY(aCondition)) {
LogProtocolError("%s:%d: Convert('%s' to '%s') failed: %s",
aFile, aLine, aIn, aOut, aExpr);
}
return aCondition;
}
inline bool
PackWarnIfImpl(const char* aFile, unsigned long aLine,
bool aCondition, const char* aExpr, const char* aIn)
{
if (MOZ_UNLIKELY(aCondition)) {
LogProtocolError("%s:%d: Pack('%s') failed: %s",
aFile, aLine, aIn, aExpr);
}
return aCondition;
}
inline bool
UnpackWarnIfImpl(const char* aFile, unsigned long aLine,
bool aCondition, const char* aExpr, const char* aOut)
{
if (MOZ_UNLIKELY(aCondition)) {
LogProtocolError("%s:%d: Unpack('%s') failed: %s",
aFile, aLine, aOut, aExpr);
}
return aCondition;
}
} // namespace detail
#define MOZ_HAL_IPC_CONVERT_WARN_IF(condition, in, out) \
::mozilla::ipc::DaemonSocketPDUHelpers::detail:: \
ConvertWarnIfImpl(__FILE__, __LINE__, condition, #condition, #in, #out)
#define MOZ_HAL_IPC_PACK_WARN_IF(condition, in) \
::mozilla::ipc::DaemonSocketPDUHelpers::detail:: \
PackWarnIfImpl(__FILE__, __LINE__, condition, #condition, #in)
#define MOZ_HAL_IPC_UNPACK_WARN_IF(condition, out) \
::mozilla::ipc::DaemonSocketPDUHelpers::detail:: \
UnpackWarnIfImpl(__FILE__, __LINE__, condition, #condition, #out)
//
// Conversion
//

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

@ -547,12 +547,14 @@ CodeGeneratorARM::visitDivI(LDivI* ins)
if (mir->canTruncateRemainder()) {
masm.ma_sdiv(lhs, rhs, output);
} else {
ScratchRegisterScope scratch(masm);
masm.ma_sdiv(lhs, rhs, scratch);
masm.ma_mul(scratch, rhs, temp);
masm.ma_cmp(lhs, temp);
{
ScratchRegisterScope scratch(masm);
masm.ma_sdiv(lhs, rhs, temp);
masm.ma_mul(temp, rhs, scratch);
masm.ma_cmp(lhs, scratch);
}
bailoutIf(Assembler::NotEqual, ins->snapshot());
masm.ma_mov(scratch, output);
masm.ma_mov(temp, output);
}
masm.bind(&done);

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

@ -3670,7 +3670,7 @@ GetScrollClipIntersection(nsDisplayListBuilder* aBuilder, const nsIFrame* aAnima
continue;
}
const DisplayItemClip* clip = scrollFrame->ComputeScrollClip(aIsCaret);
Maybe<DisplayItemClip> clip = scrollFrame->ComputeScrollClip(aIsCaret);
if (clip) {
resultClip.IntersectWith(*clip);
}
@ -4542,7 +4542,7 @@ ContainerState::SetupScrollingMetadata(NewLayerEntry* aEntry)
}
FrameMetrics& metrics = info->metrics;
const DisplayItemClip* clip = info->clip;
Maybe<DisplayItemClip> clip = info->clip;
if (clip &&
clip->HasClip() &&

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

@ -1806,8 +1806,6 @@ ScrollFrameHelper::ScrollFrameHelper(nsContainerFrame* aOuter,
, mResolution(1.0)
, mScrollPosForLayerPixelAlignment(-1, -1)
, mLastUpdateImagesPos(-1, -1)
, mAncestorClip(nullptr)
, mAncestorClipForCaret(nullptr)
, mNeverHasVerticalScrollbar(false)
, mNeverHasHorizontalScrollbar(false)
, mHasVerticalScrollbar(false)
@ -2786,8 +2784,8 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
// Clear the scroll port clip that was set during the last paint.
mAncestorClip = nullptr;
mAncestorClipForCaret = nullptr;
mAncestorClip = Nothing();
mAncestorClipForCaret = Nothing();
// We put non-overlay scrollbars in their own layers when this is the root
// scroll frame and we are a toplevel content document. In this situation,
@ -3028,7 +3026,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
// Capture the clip state of the parent scroll frame. This will be saved
// on FrameMetrics for layers with this frame as their animated geoemetry
// root.
mAncestorClipForCaret = aBuilder->ClipState().GetCurrentCombinedClip(aBuilder);
mAncestorClipForCaret = ToMaybe(aBuilder->ClipState().GetCurrentCombinedClip(aBuilder));
// Add the non-caret content box clip here so that it gets picked up by
// mAncestorClip.
@ -3041,7 +3039,7 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
clipStateNonCaret->ClipContainingBlockDescendants(*contentBoxClipForNonCaretContent);
}
}
mAncestorClip = aBuilder->ClipState().GetCurrentCombinedClip(aBuilder);
mAncestorClip = ToMaybe(aBuilder->ClipState().GetCurrentCombinedClip(aBuilder));
// If we are using a display port, then ignore any pre-existing clip
// passed down from our parents. The pre-existing clip would just defeat
@ -3121,12 +3119,12 @@ ScrollFrameHelper::BuildDisplayList(nsDisplayListBuilder* aBuilder,
scrolledContent.MoveTo(aLists);
}
const DisplayItemClip*
Maybe<DisplayItemClip>
ScrollFrameHelper::ComputeScrollClip(bool aIsForCaret) const
{
const DisplayItemClip* ancestorClip = aIsForCaret ? mAncestorClipForCaret : mAncestorClip;
const Maybe<DisplayItemClip>& ancestorClip = aIsForCaret ? mAncestorClipForCaret : mAncestorClip;
if (!mShouldBuildScrollableLayer || mIsScrollableLayerInRootContainer) {
return nullptr;
return Nothing();
}
return ancestorClip;
@ -3148,7 +3146,7 @@ ScrollFrameHelper::ComputeFrameMetrics(Layer* aLayer,
needsParentLayerClip = false;
}
const DisplayItemClip* ancestorClip = aIsForCaret ? mAncestorClipForCaret : mAncestorClip;
const Maybe<DisplayItemClip>& ancestorClip = aIsForCaret ? mAncestorClipForCaret : mAncestorClip;
nsPoint toReferenceFrame = mOuter->GetOffsetToCrossDoc(aContainerReferenceFrame);
bool isRootContent = mIsRoot && mOuter->PresContext()->IsRootContentDocument();

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

@ -382,7 +382,7 @@ public:
Layer* aLayer, nsIFrame* aContainerReferenceFrame,
const ContainerLayerParameters& aParameters,
bool aIsForCaret) const;
virtual const mozilla::DisplayItemClip* ComputeScrollClip(bool aIsForCaret) const;
virtual mozilla::Maybe<mozilla::DisplayItemClip> ComputeScrollClip(bool aIsForCaret) const;
// nsIScrollbarMediator
void ScrollByPage(nsScrollbarFrame* aScrollbar, int32_t aDirection,
@ -461,9 +461,9 @@ public:
FrameMetrics::ViewID mScrollParentID;
// The scroll port clip. Only valid during painting.
const DisplayItemClip* mAncestorClip;
const DisplayItemClip* mAncestorClipForCaret;
// The scroll port clip.
Maybe<DisplayItemClip> mAncestorClip;
Maybe<DisplayItemClip> mAncestorClipForCaret;
bool mNeverHasVerticalScrollbar:1;
bool mNeverHasHorizontalScrollbar:1;
@ -845,7 +845,7 @@ public:
{
return mHelper.ComputeFrameMetrics(aLayer, aContainerReferenceFrame, aParameters, aIsForCaret);
}
virtual const mozilla::DisplayItemClip* ComputeScrollClip(bool aIsForCaret) const override
virtual mozilla::Maybe<mozilla::DisplayItemClip> ComputeScrollClip(bool aIsForCaret) const override
{
return mHelper.ComputeScrollClip(aIsForCaret);
}
@ -1245,7 +1245,7 @@ public:
{
return mHelper.ComputeFrameMetrics(aLayer, aContainerReferenceFrame, aParameters, aIsForCaret);
}
virtual const mozilla::DisplayItemClip* ComputeScrollClip(bool aIsForCaret) const override
virtual mozilla::Maybe<mozilla::DisplayItemClip> ComputeScrollClip(bool aIsForCaret) const override
{
return mHelper.ComputeScrollClip(aIsForCaret);
}

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

@ -11,6 +11,7 @@
#define nsIScrollFrame_h___
#include "nsCoord.h"
#include "DisplayItemClip.h"
#include "ScrollbarStyles.h"
#include "mozilla/Maybe.h"
#include "mozilla/gfx/Point.h"
@ -32,7 +33,6 @@ class nsDisplayListBuilder;
namespace mozilla {
struct ContainerLayerParameters;
class DisplayItemClip;
namespace layers {
class Layer;
} // namespace layers
@ -40,7 +40,7 @@ class Layer;
struct FrameMetricsAndClip
{
layers::FrameMetrics metrics;
const DisplayItemClip* clip;
mozilla::Maybe<DisplayItemClip> clip;
};
} // namespace mozilla
@ -449,7 +449,7 @@ public:
*/
virtual bool UsesContainerScrolling() const = 0;
virtual const mozilla::DisplayItemClip* ComputeScrollClip(bool aIsForCaret) const = 0;
virtual mozilla::Maybe<mozilla::DisplayItemClip> ComputeScrollClip(bool aIsForCaret) const = 0;
};
#endif

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

@ -26,7 +26,6 @@ public:
uint32_t ReadBits(size_t aNum)
{
MOZ_ASSERT(mBitReader.numBitsLeft());
MOZ_ASSERT(aNum <= 32);
if (mBitReader.numBitsLeft() < aNum) {
return 0;
@ -48,7 +47,10 @@ public:
i++;
}
if (i == 32) {
MOZ_ASSERT(false);
// This can happen if the data is invalid, or if it's
// short, since ReadBit() will return 0 when it runs
// off the end of the buffer.
NS_WARNING("Invalid H.264 data");
return 0;
}
uint32_t r = ReadBits(i);

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

@ -2543,9 +2543,9 @@ pref("dom.ipc.plugins.unloadTimeoutSecs", 30);
// Asynchronous plugin initialization should only be enabled on non-e10s
// channels until some remaining bugs are resolved.
#ifdef E10S_TESTING_ONLY
pref("dom.ipc.plugins.asyncInit", false);
pref("dom.ipc.plugins.asyncInit.enabled", false);
#else
pref("dom.ipc.plugins.asyncInit", true);
pref("dom.ipc.plugins.asyncInit.enabled", true);
#endif
pref("dom.ipc.processCount", 1);

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

@ -47,7 +47,7 @@ this.Dispatcher = function(connId, transport, driverFactory, stopSignal) {
// and Dispatcher.prototype.onClosed
this.conn.hooks = this;
this.emulator = new Emulator(msg => this.sendResponse(msg, -1));
this.emulator = new Emulator(msg => this.send(msg, -1));
this.driver = driverFactory(this.emulator);
this.commandProcessor = new CommandProcessor(this.driver);

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

@ -32,7 +32,6 @@ ifeq ($(OS_ARCH),WINNT)
TEST_HARNESS_BINS += \
crashinject$(BIN_SUFFIX) \
crashinjectdll$(DLL_SUFFIX) \
vmwarerecordinghelper$(DLL_SUFFIX) \
$(NULL)
endif

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

@ -30,9 +30,6 @@ except ImportError:
conditions = None
VMWARE_RECORDING_HELPER_BASENAME = "vmwarerecordinghelper"
class ArgumentContainer():
__metaclass__ = ABCMeta
@ -290,14 +287,6 @@ class MochitestArguments(ArgumentContainer):
"help": "Directory where testing-only JS modules are located.",
"suppress": True,
}],
[["--use-vmware-recording"],
{"action": "store_true",
"dest": "vmwareRecording",
"default": False,
"help": "Enables recording while the application is running inside a VMware "
"Workstation 7.0 or later VM.",
"suppress": True,
}],
[["--repeat"],
{"type": int,
"default": 0,
@ -627,16 +616,6 @@ class MochitestArguments(ArgumentContainer):
elif not options.symbolsPath and build_obj:
options.symbolsPath = os.path.join(build_obj.distdir, 'crashreporter-symbols')
if options.vmwareRecording:
if not mozinfo.isWin:
parser.error(
"use-vmware-recording is only supported on Windows.")
options.vmwareHelperPath = os.path.join(
options.utilityPath, VMWARE_RECORDING_HELPER_BASENAME + ".dll")
if not os.path.exists(options.vmwareHelperPath):
parser.error("%s not found, cannot automate VMware recording." %
options.vmwareHelperPath)
if options.webapprtContent and options.webapprtChrome:
parser.error(
"Only one of --webapprt-content and --webapprt-chrome may be given.")

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

@ -1217,7 +1217,6 @@ class Mochitest(MochitestUtilsMixin):
_active_tests = None
certdbNew = False
sslTunnel = None
vmwareHelper = None
DEFAULT_TIMEOUT = 60.0
mediaDevices = None
@ -1624,37 +1623,6 @@ class Mochitest(MochitestUtilsMixin):
return foundZombie
def startVMwareRecording(self, options):
""" starts recording inside VMware VM using the recording helper dll """
assert mozinfo.isWin
from ctypes import cdll
self.vmwareHelper = cdll.LoadLibrary(self.vmwareHelperPath)
if self.vmwareHelper is None:
self.log.warning("runtests.py | Failed to load "
"VMware recording helper")
return
self.log.info("runtests.py | Starting VMware recording.")
try:
self.vmwareHelper.StartRecording()
except Exception as e:
self.log.warning("runtests.py | Failed to start "
"VMware recording: (%s)" % str(e))
self.vmwareHelper = None
def stopVMwareRecording(self):
""" stops recording inside VMware VM using the recording helper dll """
try:
assert mozinfo.isWin
if self.vmwareHelper is not None:
self.log.info("runtests.py | Stopping VMware recording.")
self.vmwareHelper.StopRecording()
except Exception as e:
self.log.warning("runtests.py | Failed to stop "
"VMware recording: (%s)" % str(e))
self.log.exception('Error stopping VMWare recording')
self.vmwareHelper = None
def runApp(self,
testUrl,
env,
@ -2242,9 +2210,6 @@ class Mochitest(MochitestUtilsMixin):
else:
timeout = 330.0 # default JS harness timeout is 300 seconds
if options.vmwareRecording:
self.startVMwareRecording(options)
# detect shutdown leaks for m-bc runs
detectShutdownLeaks = mozinfo.info[
"debug"] and options.browserChrome and not options.webapprtChrome
@ -2276,8 +2241,6 @@ class Mochitest(MochitestUtilsMixin):
status = 1
finally:
if options.vmwareRecording:
self.stopVMwareRecording()
self.stopServers()
mozleak.process_leak_log(

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

@ -114,6 +114,10 @@ class B2GBuild(LocalesMixin, PurgeMixin,
"dest": "platform",
"help": "the platform used by balrog submmiter.",
}],
[["--gecko-objdir"], {
"dest": "gecko_objdir",
"help": "Specifies the gecko object directory.",
}],
]
def __init__(self, require_config_file=False, config={},
@ -157,7 +161,8 @@ class B2GBuild(LocalesMixin, PurgeMixin,
)
dirs = self.query_abs_dirs()
self.objdir = os.path.join(dirs['work_dir'], 'objdir-gecko')
self.objdir = self.config.get("gecko_objdir",
os.path.join(dirs['work_dir'], 'objdir-gecko'))
self.abs_dirs['abs_obj_dir'] = self.objdir
if self.config.get("update_type", "ota") == "fota":
self.make_updates_cmd = ['./build.sh', 'gecko-update-fota']
@ -557,6 +562,9 @@ class B2GBuild(LocalesMixin, PurgeMixin,
env['PYTHONPATH'] = os.environ.get('PYTHONPATH', '')
env['PYTHONPATH'] += ':%s' % os.path.join(dirs['compare_locales_dir'], 'lib')
with open(os.path.join(dirs['work_dir'], '.userconfig'), 'w') as cfg:
cfg.write('GECKO_OBJDIR={0}'.format(self.objdir))
self.enable_mock()
if self.config['ccache']:
self.run_command('ccache -z', cwd=dirs['work_dir'], env=env)

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

@ -25,6 +25,9 @@ tc-vcs repo-checkout $WORKSPACE/B2G https://git.mozilla.org/b2g/B2G.git $MANIFES
rm -f $WORKSPACE/B2G/gecko
ln -s $WORKSPACE/gecko $WORKSPACE/B2G/gecko
### Install package dependencies
install-packages.sh $WORKSPACE/gecko
debug_flag=""
if [ 0$B2G_DEBUG -ne 0 ]; then
debug_flag='--debug'
@ -32,6 +35,8 @@ fi
rm -rf $WORKSPACE/B2G/out/target/product/generic_x86/tests/
gecko_objdir=/home/worker/objdir-gecko/objdir
$WORKSPACE/gecko/testing/mozharness/scripts/b2g_build.py \
--config b2g/taskcluster-emulator.py \
"$debug_flag" \
@ -41,21 +46,22 @@ $WORKSPACE/gecko/testing/mozharness/scripts/b2g_build.py \
--target=$TARGET \
--b2g-config-dir=$TARGET \
--checkout-revision=$GECKO_HEAD_REV \
--repo=$WORKSPACE/gecko
--repo=$WORKSPACE/gecko \
--gecko-objdir=$gecko_objdir
# Move files into artifact locations!
mkdir -p $HOME/artifacts
ls -lah $WORKSPACE/B2G/out
ls -lah $WORKSPACE/B2G/objdir-gecko/dist/
ls -lah $gecko_objdir/dist/
mv $WORKSPACE/B2G/sources.xml $HOME/artifacts/sources.xml
mv $WORKSPACE/B2G/out/target/product/generic_x86/tests/gaia-tests.zip $HOME/artifacts/gaia-tests.zip
for name in common cppunittest reftest mochitest xpcshell web-platform; do
mv $WORKSPACE/B2G/objdir-gecko/dist/*.$name.tests.zip $HOME/artifacts/target.$name.tests.zip ;
mv $gecko_objdir/dist/*.$name.tests.zip $HOME/artifacts/target.$name.tests.zip ;
done
mv $WORKSPACE/B2G/objdir-gecko/dist/test_packages_tc.json $HOME/artifacts/test_packages.json
mv $gecko_objdir/dist/test_packages_tc.json $HOME/artifacts/test_packages.json
mv $WORKSPACE/B2G/out/emulator.tar.gz $HOME/artifacts/emulator.tar.gz
mv $WORKSPACE/B2G/objdir-gecko/dist/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
mv $gecko_objdir/dist/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
ccache -s

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

@ -27,6 +27,9 @@ tc-vcs repo-checkout $WORKSPACE/B2G https://git.mozilla.org/b2g/B2G.git $MANIFES
rm -f $WORKSPACE/B2G/gecko
ln -s $WORKSPACE/gecko $WORKSPACE/B2G/gecko
### Install package dependencies
install-packages.sh $WORKSPACE/gecko
debug_flag=""
if [ 0$B2G_DEBUG -ne 0 ]; then
debug_flag='--debug'
@ -34,6 +37,8 @@ fi
rm -rf $WORKSPACE/B2G/out/target/product/generic/tests/
gecko_objdir=/home/worker/objdir-gecko/objdir
$WORKSPACE/gecko/testing/mozharness/scripts/b2g_build.py \
--config b2g/taskcluster-emulator.py \
"$debug_flag" \
@ -43,21 +48,22 @@ $WORKSPACE/gecko/testing/mozharness/scripts/b2g_build.py \
--target=$TARGET \
--b2g-config-dir=$TARGET \
--checkout-revision=$GECKO_HEAD_REV \
--repo=$WORKSPACE/gecko
--repo=$WORKSPACE/gecko \
--gecko-objdir=$gecko_objdir
# Move files into artifact locations!
mkdir -p $HOME/artifacts
ls -lah $WORKSPACE/B2G/out
ls -lah $WORKSPACE/B2G/objdir-gecko/dist/
ls -lah $gecko_objdir/dist/
mv $WORKSPACE/B2G/sources.xml $HOME/artifacts/sources.xml
mv $WORKSPACE/B2G/out/target/product/generic/tests/gaia-tests.zip $HOME/artifacts/gaia-tests.zip
for name in common cppunittest reftest mochitest xpcshell web-platform; do
mv $WORKSPACE/B2G/objdir-gecko/dist/*.$name.tests.zip $HOME/artifacts/target.$name.tests.zip ;
mv $gecko_objdir/dist/*.$name.tests.zip $HOME/artifacts/target.$name.tests.zip ;
done
mv $WORKSPACE/B2G/objdir-gecko/dist/test_packages_tc.json $HOME/artifacts/test_packages.json
mv $gecko_objdir/dist/test_packages_tc.json $HOME/artifacts/test_packages.json
mv $WORKSPACE/B2G/out/emulator.tar.gz $HOME/artifacts/emulator.tar.gz
mv $WORKSPACE/B2G/objdir-gecko/dist/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
mv $gecko_objdir/dist/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
ccache -s

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

@ -4,7 +4,7 @@
if [ $TARGET == "aries" -o $TARGET == "shinano" ]; then
# caching objects might be dangerous for some devices (aka aries)
rm -rf $WORKSPACE/B2G/objdir*
rm -rf $gecko_objdir
rm -rf $WORKSPACE/B2G/out
fi
@ -40,6 +40,7 @@ $WORKSPACE/gecko/testing/mozharness/scripts/b2g_build.py \
--checkout-revision=$GECKO_HEAD_REV \
--repo=$WORKSPACE/gecko \
--platform $PLATFORM \
--gecko-objdir=$gecko_objdir \
--complete-mar-url https://queue.taskcluster.net/v1/task/$TASK_ID/runs/$RUN_ID/artifacts/public/build/$mar_file
. post-build.sh

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

@ -4,7 +4,7 @@
if [ $TARGET == "aries" -o $TARGET == "shinano" ]; then
# caching objects might be dangerous for some devices (aka aries)
rm -rf $WORKSPACE/B2G/objdir*
rm -rf $gecko_objdir
rm -rf $WORKSPACE/B2G/out
fi
@ -23,6 +23,7 @@ $WORKSPACE/gecko/testing/mozharness/scripts/b2g_build.py \
--target=$TARGET \
--b2g-config-dir=$TARGET \
--checkout-revision=$GECKO_HEAD_REV \
--repo=$WORKSPACE/gecko
--repo=$WORKSPACE/gecko \
--gecko-objdir=$gecko_objdir
. post-build.sh

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

@ -6,6 +6,8 @@ PATH=$DIRNAME:$PATH
WORKSPACE=$1
gecko_objdir=/home/worker/objdir-gecko/objdir
### Check that require variables are defined
test -d $WORKSPACE
test $GECKO_HEAD_REPOSITORY # Should be an hg repository url to pull from

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

@ -7,12 +7,14 @@ task:
workerType: flame-kk
scopes:
- 'docker-worker:cache:build-aries-debug'
- 'docker-worker:cache:build-aries-debug-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G Aries Debug'
payload:
cache:
build-aries-debug: /home/worker/workspace
build-aries-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'aries'
DEBUG: 0

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

@ -8,9 +8,11 @@ task:
name: '[TC] B2G Aries Dogfood'
scopes:
- 'docker-worker:cache:build-aries-spark-dogfood'
- 'docker-worker:cache:build-aries-spark-dogfood-objdir-gecko-{{project}}'
payload:
cache:
build-aries-spark-dogfood: /home/worker/workspace
build-aries-spark-dogfood-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
VARIANT: userdebug
DOGFOOD: 1

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

@ -6,12 +6,14 @@ $inherits:
task:
scopes:
- 'docker-worker:cache:build-aries-eng'
- 'docker-worker:cache:build-aries-eng-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G Aries Eng'
payload:
cache:
build-aries-eng: /home/worker/workspace
build-aries-eng-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'aries'
MOZHARNESS_CONFIG: b2g/taskcluster-spark.py

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

@ -7,12 +7,14 @@ task:
workerType: flame-kk
scopes:
- 'docker-worker:cache:build-aries-opt'
- 'docker-worker:cache:build-aries-opt-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G Aries Opt'
payload:
cache:
build-aries-opt: /home/worker/workspace
build-aries-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'aries'
DEBUG: 0

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

@ -8,9 +8,11 @@ task:
name: '[TC] B2G Aries OTA (userdebug)'
scopes:
- 'docker-worker:cache:build-aries-spark-ota-debug'
- 'docker-worker:cache:build-aries-spark-ota-debug-objdir-gecko-{{project}}'
payload:
cache:
build-aries-spark-ota-debug: /home/worker/workspace
build-aries-spark-ota-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
VARIANT: userdebug
B2G_DEBUG: 0

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

@ -8,9 +8,11 @@ task:
name: '[TC] B2G Aries OTA (user)'
scopes:
- 'docker-worker:cache:build-aries-spark-ota-user'
- 'docker-worker:cache:build-aries-spark-ota-user-objdir-gecko-{{project}}'
payload:
cache:
build-aries-spark-ota-user: /home/worker/workspace
build-aries-spark-ota-user-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
VARIANT: user

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

@ -1,10 +1,16 @@
$inherits:
from: 'tasks/builds/b2g_base.yml'
task:
scopes:
- 'docker-worker:cache:tooltool-cache'
metadata:
description: |
Android emulators + b2g environment used in full stack testing.
payload:
cache:
tooltool-cache: '/home/worker/tooltool-cache'
env:
TARGET: 'emulator'
B2G_DEBUG: 0

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

@ -7,6 +7,7 @@ task:
workerType: emulator-ics-debug
scopes:
- 'docker-worker:cache:workspace-emulator-ics-debug'
- 'docker-worker:cache:workspace-emulator-ics-debug-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G Emulator ICS Debug'
extra:
@ -20,6 +21,8 @@ task:
payload:
cache:
workspace-emulator-ics-debug: /home/worker/workspace
workspace-emulator-ics-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'emulator'
B2G_DEBUG: 1
TOOLTOOL_MANIFEST: 'b2g/config/emulator-ics/releng-emulator-ics.tt'

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

@ -10,6 +10,7 @@ task:
- 'index.buildbot.revisions.{{head_rev}}.{{project}}.emulator-ics'
scopes:
- 'docker-worker:cache:workspace-emulator-ics-opt'
- 'docker-worker:cache:workspace-emulator-ics-opt-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G Emulator ICS Opt'
@ -21,6 +22,8 @@ task:
payload:
cache:
workspace-emulator-ics-opt: /home/worker/workspace
workspace-emulator-ics-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'emulator'
TOOLTOOL_MANIFEST: 'b2g/config/emulator-ics/releng-emulator-ics.tt'

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

@ -7,6 +7,7 @@ task:
workerType: emulator-jb-debug
scopes:
- 'docker-worker:cache:workspace-emulator-jb-debug'
- 'docker-worker:cache:workspace-emulator-jb-debug-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G Emulator JB (Debug)'
@ -25,6 +26,8 @@ task:
payload:
cache:
workspace-emulator-jb-debug: /home/worker/workspace
workspace-emulator-jb-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'emulator-jb'
B2G_DEBUG: 1
TOOLTOOL_MANIFEST: 'b2g/config/emulator-jb/releng-emulator-jb.tt'

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

@ -7,6 +7,7 @@ task:
workerType: emulator-jb
scopes:
- 'docker-worker:cache:workspace-emulator-jb-opt'
- 'docker-worker:cache:workspace-emulator-jb-opt-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G JB Emulator: (Opt)'
@ -23,5 +24,7 @@ task:
payload:
cache:
workspace-emulator-jb-opt: /home/worker/workspace
workspace-emulator-jb-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'emulator-jb'
TOOLTOOL_MANIFEST: 'b2g/config/emulator-jb/releng-emulator-jb.tt'

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

@ -7,6 +7,7 @@ task:
workerType: emulator-kk-debug
scopes:
- 'docker-worker:cache:workspace-emulator-kk-debug'
- 'docker-worker:cache:workspace-emulator-kk-debug-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G Emulator KK (Debug)'
@ -25,6 +26,8 @@ task:
payload:
cache:
workspace-emulator-kk-debug: /home/worker/workspace
workspace-emulator-kk-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'emulator-kk'
TOOLTOOL_MANIFEST: 'b2g/config/emulator-kk/releng-emulator-kk.tt'
B2G_DEBUG: 1

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

@ -10,6 +10,7 @@ task:
- 'index.buildbot.revisions.{{head_rev}}.{{project}}.emulator-kk'
scopes:
- 'docker-worker:cache:workspace-emulator-kk-opt'
- 'docker-worker:cache:workspace-emulator-kk-opt-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G KK Emulator (Opt)'
@ -26,5 +27,7 @@ task:
payload:
cache:
workspace-emulator-kk-opt: /home/worker/workspace
workspace-emulator-kk-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'emulator-kk'
TOOLTOOL_MANIFEST: 'b2g/config/emulator-kk/releng-emulator-kk.tt'

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

@ -7,6 +7,7 @@ task:
workerType: emulator-l-debug
scopes:
- 'docker-worker:cache:workspace-emulator-l-debug'
- 'docker-worker:cache:workspace-emulator-l-debug-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G Emulator L (Debug)'
@ -25,6 +26,8 @@ task:
payload:
cache:
workspace-emulator-l-debug: /home/worker/workspace
workspace-emulator-l-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'emulator-l'
TOOLTOOL_MANIFEST: 'b2g/config/emulator-l/releng-emulator-l.tt'
B2G_DEBUG: 1

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

@ -7,6 +7,7 @@ task:
workerType: emulator-l
scopes:
- 'docker-worker:cache:workspace-emulator-l-opt'
- 'docker-worker:cache:workspace-emulator-l-opt-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G L Emulator (Opt)'
@ -23,5 +24,7 @@ task:
payload:
cache:
workspace-emulator-l-opt: /home/worker/workspace
workspace-emulator-l-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'emulator-l'
TOOLTOOL_MANIFEST: 'b2g/config/emulator-l/releng-emulator-l.tt'

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

@ -7,6 +7,7 @@ task:
workerType: emulator-x86-kk
scopes:
- 'docker-worker:cache:workspace-emulator-kk-x86-debug'
- 'docker-worker:cache:workspace-emulator-kk-x86-debug-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G KK X86 Emulator (Debug)'
@ -25,6 +26,8 @@ task:
payload:
cache:
workspace-emulator-kk-x86-debug: /home/worker/workspace
workspace-emulator-kk-x86-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'emulator-x86-kk'
TOOLTOOL_MANIFEST: 'b2g/config/emulator-x86-kk/releng-emulator-kk.tt'
B2G_DEBUG: 1

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

@ -7,6 +7,7 @@ task:
workerType: emulator-x86-kk
scopes:
- 'docker-worker:cache:workspace-emulator-kk-x86-opt'
- 'docker-worker:cache:workspace-emulator-kk-x86-opt-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G KK X86 Emulator (Opt)'
@ -23,5 +24,7 @@ task:
payload:
cache:
workspace-emulator-kk-x86-opt: /home/worker/workspace
workspace-emulator-kk-x86-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'emulator-x86-kk'
TOOLTOOL_MANIFEST: 'b2g/config/emulator-x86-kk/releng-emulator-kk.tt'

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

@ -7,6 +7,7 @@ task:
workerType: emulator-l
scopes:
- 'docker-worker:cache:workspace-emulator-l-x86-opt'
- 'docker-worker:cache:workspace-emulator-l-x86-opt-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G X86 L Emulator (Opt)'
@ -30,5 +31,7 @@ task:
cache:
workspace-emulator-l-x86-opt: /home/worker/workspace
workspace-emulator-l-x86-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'emulator-x86-l'
TOOLTOOL_MANIFEST: 'b2g/config/emulator-x86-l/releng-emulator-l.tt'

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

@ -7,12 +7,14 @@ task:
workerType: flame-kk
scopes:
- 'docker-worker:cache:build-flame-kk-debug'
- 'docker-worker:cache:build-flame-kk-debug-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G Flame KK Debug'
payload:
cache:
build-flame-kk-debug: /home/worker/workspace
build-flame-kk-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'flame-kk'
DEBUG: 0

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

@ -6,12 +6,14 @@ $inherits:
task:
scopes:
- 'docker-worker:cache:build-flame-kk-eng'
- 'docker-worker:cache:build-flame-kk-eng-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G Flame KK Eng'
payload:
cache:
build-flame-kk-eng: /home/worker/workspace
build-flame-kk-eng-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'flame-kk'
extra:

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

@ -7,12 +7,14 @@ task:
workerType: flame-kk
scopes:
- 'docker-worker:cache:build-flame-kk-opt'
- 'docker-worker:cache:build-flame-kk-opt-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G Flame KK Opt'
payload:
cache:
build-flame-kk-opt: /home/worker/workspace
build-flame-kk-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'flame-kk'
DEBUG: 0

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

@ -8,10 +8,12 @@ task:
name: '[TC] B2G Flame KK OTA (userdebug)'
scopes:
- 'docker-worker:cache:build-flame-kk-ota-debug'
- 'docker-worker:cache:build-flame-kk-ota-debug-objdir-gecko-{{project}}'
payload:
cache:
build-flame-kk-ota-debug: /home/worker/workspace
build-flame-kk-ota-debug: /home/worker/workspace
build-flame-kk-ota-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
VARIANT: userdebug
B2G_DEBUG: 0

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

@ -8,9 +8,11 @@ task:
name: '[TC] B2G Flame KK OTA (user)'
scopes:
- 'docker-worker:cache:build-flame-kk-ota-user'
- 'docker-worker:cache:build-flame-kk-ota-user-objdir-gecko-{{project}}'
payload:
cache:
build-flame-kk-ota-user: /home/worker/workspace
build-flame-kk-ota-user-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
VARIANT: user

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

@ -6,12 +6,14 @@ $inherits:
task:
scopes:
- 'docker-worker:cache:build-flame-kk-spark-eng'
- 'docker-worker:cache:build-flame-kk-spark-eng-objdir-gecko-{{project}}'
metadata:
name: '[TC] B2G Flame KK Eng (spark)'
payload:
cache:
build-flame-kk-spark-eng: /home/worker/workspace
build-flame-kk-spark-eng-objdir-gecko-{{project}}: /home/worker/objdir-gecko
env:
TARGET: 'flame-kk'
MOZHARNESS_CONFIG: b2g/taskcluster-spark.py

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

@ -12,6 +12,7 @@ skip-if = true # Intermittent failures: Bug 1182296, bug 1148771
[browser_passwordmgr_editing.js]
skip-if = os == "linux"
[browser_context_menu.js]
skip-if = os == "linux"
[browser_passwordmgr_contextmenu.js]
[browser_passwordmgr_fields.js]
[browser_passwordmgr_observers.js]

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

@ -7334,6 +7334,13 @@
"n_values": 3,
"description": "A simple counter of daily mixed-content unblock operations and top documents loaded"
},
"MIXED_CONTENT_HSTS": {
"alert_emails": ["seceng@mozilla.org"],
"expires_in_version": "never",
"kind": "enumerated",
"n_values": 10,
"description": "How often would blocked mixed content be allowed if HSTS upgrades were allowed? 0=display/no-HSTS, 1=display/HSTS, 2=active/no-HSTS, 3=active/HSTS"
},
"NTLM_MODULE_USED_2": {
"expires_in_version": "never",
"kind": "enumerated",

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

@ -111,7 +111,7 @@ const DEFAULT_ENVIRONMENT_PREFS = new Map([
["devtools.chrome.enabled", {what: RECORD_PREF_VALUE}],
["devtools.debugger.enabled", {what: RECORD_PREF_VALUE}],
["devtools.debugger.remote-enabled", {what: RECORD_PREF_VALUE}],
["dom.ipc.plugins.asyncInit", {what: RECORD_PREF_VALUE}],
["dom.ipc.plugins.asyncInit.enabled", {what: RECORD_PREF_VALUE}],
["dom.ipc.plugins.enabled", {what: RECORD_PREF_VALUE}],
["dom.ipc.processCount", {what: RECORD_PREF_VALUE, requiresRestart: true}],
["experiments.manifest.uri", {what: RECORD_PREF_VALUE}],

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

@ -56,7 +56,7 @@ const LOGGER_PREFIX = "TelemetrySession" + (Utils.isContentProcess ? "#content::
const PREF_BRANCH = "toolkit.telemetry.";
const PREF_PREVIOUS_BUILDID = PREF_BRANCH + "previousBuildID";
const PREF_FHR_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
const PREF_ASYNC_PLUGIN_INIT = "dom.ipc.plugins.asyncInit";
const PREF_ASYNC_PLUGIN_INIT = "dom.ipc.plugins.asyncInit.enabled";
const PREF_UNIFIED = PREF_BRANCH + "unified";

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

@ -211,6 +211,12 @@ enum {
};
#endif
#if !defined(MAC_OS_X_VERSION_10_11) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11
enum {
NSVisualEffectMaterialMenu = 5
};
#endif
static NSUInteger
VisualEffectStateForVibrancyType(VibrancyType aType)
{
@ -263,13 +269,14 @@ VibrancyManager::CreateEffectView(VibrancyType aType, NSRect aRect)
[effectView setState:VisualEffectStateForVibrancyType(aType)];
if (aType == VibrancyType::MENU) {
// NSVisualEffectMaterialTitlebar doesn't match the native menu look
// perfectly but comes pretty close. Ideally we'd use a material with
// materialTypeName "MacLight", since that's what menus use, but there's
// no entry with that material in the internalMaterialType-to-
// CGSWindowBackdropViewSpec table which NSVisualEffectView consults when
// setting up the effect.
[effectView setMaterial:NSVisualEffectMaterialTitlebar];
if (nsCocoaFeatures::OnElCapitanOrLater()) {
[effectView setMaterial:NSVisualEffectMaterialMenu];
} else {
// Before 10.11 there is no material that perfectly matches the menu
// look. Of all available material types, NSVisualEffectMaterialTitlebar
// is the one that comes closest.
[effectView setMaterial:NSVisualEffectMaterialTitlebar];
}
} else if (aType == VibrancyType::HIGHLIGHTED_MENUITEM) {
[effectView setMaterial:NSVisualEffectMaterialMenuItem];
if ([effectView respondsToSelector:@selector(setEmphasized:)]) {

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

@ -6565,7 +6565,7 @@ HandleEvent(CGEventTapProxy aProxy, CGEventType aType,
[self performSelector:@selector(shutdownAndReleaseCalledOnEventThread) onThread:mThread withObject:nil waitUntilDone:NO];
}
static const CGEventField kCGWindowNumberField = 51;
static const CGEventField kCGWindowNumberField = (const CGEventField) 51;
// Called on scroll thread
- (void)handleEvent:(CGEventRef)cgEvent type:(CGEventType)type

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

@ -22,6 +22,7 @@ public:
static bool OnMountainLionOrLater();
static bool OnMavericksOrLater();
static bool OnYosemiteOrLater();
static bool OnElCapitanOrLater();
static bool AccelerateByDefault();
static bool IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix=0);

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

@ -18,6 +18,7 @@
#define MAC_OS_X_VERSION_10_8_HEX 0x00001080
#define MAC_OS_X_VERSION_10_9_HEX 0x00001090
#define MAC_OS_X_VERSION_10_10_HEX 0x000010A0
#define MAC_OS_X_VERSION_10_11_HEX 0x000010B0
#include "nsCocoaFeatures.h"
#include "nsCocoaUtils.h"
@ -172,6 +173,12 @@ nsCocoaFeatures::OnYosemiteOrLater()
return (OSXVersion() >= MAC_OS_X_VERSION_10_10_HEX);
}
/* static */ bool
nsCocoaFeatures::OnElCapitanOrLater()
{
return (OSXVersion() >= MAC_OS_X_VERSION_10_11_HEX);
}
/* static */ bool
nsCocoaFeatures::AccelerateByDefault()
{