mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Merge latest green fx-team changeset and mozilla-central
This commit is contained in:
commit
7804172987
@ -19,13 +19,13 @@
|
||||
<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="4142df90c71abdc1e3a87cd37dff1a22d5e38b34"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b669dd2cc321f37cebc7081a79b968cac36b4200"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="ca283b9db2b151d465cfd2e19346cf58fe89e413"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="5688c04e38ceacb9069b6157db69b37beafab331"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="64740b3467718db9a63560849b7789d3cf157963"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c5e563ed4ea69e3737bbbe6156f2915dd1e86226"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
|
||||
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
|
||||
|
@ -12,15 +12,15 @@
|
||||
<!--original fetch url was https://git.mozilla.org/releases-->
|
||||
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
|
||||
<!-- B2G specific things. -->
|
||||
<project name="platform_build" path="build" remote="b2g" revision="42c224f4304c10166739fd9e25b2db1036410bd8">
|
||||
<project name="platform_build" path="build" remote="b2g" revision="6e2a3b589d1e8cc1d9df25f5e630ce30a0aa39f3">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="4142df90c71abdc1e3a87cd37dff1a22d5e38b34"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="b669dd2cc321f37cebc7081a79b968cac36b4200"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="64740b3467718db9a63560849b7789d3cf157963"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c5e563ed4ea69e3737bbbe6156f2915dd1e86226"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<!-- Stock Android things -->
|
||||
@ -100,7 +100,7 @@
|
||||
<project name="platform/external/webrtc" path="external/webrtc" revision="1a1433203ddf6395516e065ada1dcdfc8bd5c654"/>
|
||||
<project name="platform/external/yaffs2" path="external/yaffs2" revision="d94a17182a88c2c2d865f50b728de8561d251efa"/>
|
||||
<project name="platform/external/zlib" path="external/zlib" revision="06608b270da9ec8a3e618f201d7356aad83f9ffe"/>
|
||||
<project name="platform_frameworks_av" path="frameworks/av" remote="b2g" revision="fa40716703edc8664365b46d206c11635d2b7a90"/>
|
||||
<project name="platform_frameworks_av" path="frameworks/av" remote="b2g" revision="f9000e9ec6fb84a24ffe049e6a6372c0305ee0f1"/>
|
||||
<project name="platform/frameworks/base" path="frameworks/base" revision="8fafbc6692a52d1f1417693f24f6349b4de5afbd"/>
|
||||
<project name="platform/frameworks/native" path="frameworks/native" revision="c135c11c422c1570fdae2e19336f06f39e723c5a"/>
|
||||
<project name="platform/frameworks/opt/emoji" path="frameworks/opt/emoji" revision="bc06a1779be6919a581a938e1c3118b3a4ab4c18"/>
|
||||
@ -131,6 +131,6 @@
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="02f0cc39345c36689ea4bca436b789b38f5751e0"/>
|
||||
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="dd94b2e17a146cb782d71933d25dcaa9c060e6ce"/>
|
||||
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="ea8011252172347bd7711f6fc9c5cc24ab1a109b"/>
|
||||
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="d0aa65b140a45016975ed0ecf35f280dd336e1d3"/>
|
||||
<project name="android-sdk" path="sdk" remote="b2g" revision="8b1365af38c9a653df97349ee53a3f5d64fd590a"/>
|
||||
</manifest>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<project name="platform_build" path="build" remote="b2g" revision="276ce45e78b09c4a4ee643646f691d22804754c1">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="4142df90c71abdc1e3a87cd37dff1a22d5e38b34"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="b669dd2cc321f37cebc7081a79b968cac36b4200"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="librecovery" patch="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
@ -23,7 +23,7 @@
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="64740b3467718db9a63560849b7789d3cf157963"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c5e563ed4ea69e3737bbbe6156f2915dd1e86226"/>
|
||||
<!-- Stock Android things -->
|
||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
|
||||
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>
|
||||
@ -120,7 +120,7 @@
|
||||
<project name="platform/system/security" path="system/security" revision="583374f69f531ba68fc3dcbff1f74893d2a96406"/>
|
||||
<project name="platform/system/vold" path="system/vold" revision="d4455b8cf361f8353e8aebac15ffd64b4aedd2b9"/>
|
||||
<project name="platform/external/icu4c" path="external/icu4c" remote="aosp" revision="b4c6379528887dc25ca9991a535a8d92a61ad6b6"/>
|
||||
<project name="platform_frameworks_av" path="frameworks/av" remote="b2g" revision="6c67114dfa109f31d37e880b9c009f2965a22261"/>
|
||||
<project name="platform_frameworks_av" path="frameworks/av" remote="b2g" revision="9c6cb3231dd096df10a11b4d76be3727bdeec08d"/>
|
||||
<project name="platform_system_core" path="system/core" remote="b2g" revision="9395eb5aa885cf6d305a202de6e9694a58a89717"/>
|
||||
<default remote="caf" revision="refs/tags/android-4.4.2_r1" sync-j="4"/>
|
||||
<!-- Emulator specific things -->
|
||||
|
@ -19,13 +19,13 @@
|
||||
<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="4142df90c71abdc1e3a87cd37dff1a22d5e38b34"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b669dd2cc321f37cebc7081a79b968cac36b4200"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="ca283b9db2b151d465cfd2e19346cf58fe89e413"/>
|
||||
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="5688c04e38ceacb9069b6157db69b37beafab331"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="64740b3467718db9a63560849b7789d3cf157963"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c5e563ed4ea69e3737bbbe6156f2915dd1e86226"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
|
||||
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>
|
||||
|
@ -12,15 +12,15 @@
|
||||
<!--original fetch url was https://git.mozilla.org/releases-->
|
||||
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
|
||||
<!-- B2G specific things. -->
|
||||
<project name="platform_build" path="build" remote="b2g" revision="42c224f4304c10166739fd9e25b2db1036410bd8">
|
||||
<project name="platform_build" path="build" remote="b2g" revision="6e2a3b589d1e8cc1d9df25f5e630ce30a0aa39f3">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="4142df90c71abdc1e3a87cd37dff1a22d5e38b34"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="b669dd2cc321f37cebc7081a79b968cac36b4200"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="64740b3467718db9a63560849b7789d3cf157963"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c5e563ed4ea69e3737bbbe6156f2915dd1e86226"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<!-- Stock Android things -->
|
||||
@ -140,7 +140,7 @@
|
||||
<project name="platform/hardware/ril" path="hardware/ril" revision="c4e2ac95907a5519a0e09f01a0d8e27fec101af0"/>
|
||||
<project name="platform/system/bluetooth" path="system/bluetooth" revision="e1eb226fa3ad3874ea7b63c56a9dc7012d7ff3c2"/>
|
||||
<project name="platform/system/core" path="system/core" revision="bbf7212289fc8311e43f9d11e10788e310d36a08"/>
|
||||
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="ea8011252172347bd7711f6fc9c5cc24ab1a109b"/>
|
||||
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="d0aa65b140a45016975ed0ecf35f280dd336e1d3"/>
|
||||
<project name="platform/system/qcom" path="system/qcom" revision="1cdab258b15258b7f9657da70e6f06ebd5a2fc25"/>
|
||||
<project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="4ae5df252123591d5b941191790e7abed1bce5a4"/>
|
||||
</manifest>
|
||||
|
@ -4,6 +4,6 @@
|
||||
"remote": "",
|
||||
"branch": ""
|
||||
},
|
||||
"revision": "debbe27e7bc38406aa50fdbcac1a5dc670959222",
|
||||
"revision": "b952ee87219852fc30f50b97238e16e01f9aa853",
|
||||
"repo_path": "/integration/gaia-central"
|
||||
}
|
||||
|
@ -17,12 +17,12 @@
|
||||
<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="4142df90c71abdc1e3a87cd37dff1a22d5e38b34"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b669dd2cc321f37cebc7081a79b968cac36b4200"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="64740b3467718db9a63560849b7789d3cf157963"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c5e563ed4ea69e3737bbbe6156f2915dd1e86226"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
<project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="4142df90c71abdc1e3a87cd37dff1a22d5e38b34"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b669dd2cc321f37cebc7081a79b968cac36b4200"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
|
@ -19,12 +19,12 @@
|
||||
<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="4142df90c71abdc1e3a87cd37dff1a22d5e38b34"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b669dd2cc321f37cebc7081a79b968cac36b4200"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="64740b3467718db9a63560849b7789d3cf157963"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c5e563ed4ea69e3737bbbe6156f2915dd1e86226"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
<project name="platform/bionic" path="bionic" revision="cd5dfce80bc3f0139a56b58aca633202ccaee7f8"/>
|
||||
|
@ -17,12 +17,12 @@
|
||||
<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="4142df90c71abdc1e3a87cd37dff1a22d5e38b34"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b669dd2cc321f37cebc7081a79b968cac36b4200"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="64740b3467718db9a63560849b7789d3cf157963"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c5e563ed4ea69e3737bbbe6156f2915dd1e86226"/>
|
||||
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
|
@ -12,15 +12,15 @@
|
||||
<!--original fetch url was https://git.mozilla.org/releases-->
|
||||
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
|
||||
<!-- B2G specific things. -->
|
||||
<project name="platform_build" path="build" remote="b2g" revision="42c224f4304c10166739fd9e25b2db1036410bd8">
|
||||
<project name="platform_build" path="build" remote="b2g" revision="6e2a3b589d1e8cc1d9df25f5e630ce30a0aa39f3">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="4142df90c71abdc1e3a87cd37dff1a22d5e38b34"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="b669dd2cc321f37cebc7081a79b968cac36b4200"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="64740b3467718db9a63560849b7789d3cf157963"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c5e563ed4ea69e3737bbbe6156f2915dd1e86226"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<!-- Stock Android things -->
|
||||
@ -100,7 +100,7 @@
|
||||
<project name="platform/external/webrtc" path="external/webrtc" revision="1a1433203ddf6395516e065ada1dcdfc8bd5c654"/>
|
||||
<project name="platform/external/yaffs2" path="external/yaffs2" revision="d94a17182a88c2c2d865f50b728de8561d251efa"/>
|
||||
<project name="platform/external/zlib" path="external/zlib" revision="06608b270da9ec8a3e618f201d7356aad83f9ffe"/>
|
||||
<project name="platform_frameworks_av" path="frameworks/av" remote="b2g" revision="fa40716703edc8664365b46d206c11635d2b7a90"/>
|
||||
<project name="platform_frameworks_av" path="frameworks/av" remote="b2g" revision="f9000e9ec6fb84a24ffe049e6a6372c0305ee0f1"/>
|
||||
<project name="platform/frameworks/base" path="frameworks/base" revision="8fafbc6692a52d1f1417693f24f6349b4de5afbd"/>
|
||||
<project name="platform/frameworks/native" path="frameworks/native" revision="c135c11c422c1570fdae2e19336f06f39e723c5a"/>
|
||||
<project name="platform/frameworks/opt/emoji" path="frameworks/opt/emoji" revision="bc06a1779be6919a581a938e1c3118b3a4ab4c18"/>
|
||||
@ -127,7 +127,7 @@
|
||||
<project name="device-mako" path="device/lge/mako" remote="b2g" revision="78d17f0c117f0c66dd55ee8d5c5dde8ccc93ecba"/>
|
||||
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
|
||||
<project name="device/lge/mako-kernel" path="device/lge/mako-kernel" revision="d1729e53d71d711c8fde25eab8728ff2b9b4df0e"/>
|
||||
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="ea8011252172347bd7711f6fc9c5cc24ab1a109b"/>
|
||||
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="d0aa65b140a45016975ed0ecf35f280dd336e1d3"/>
|
||||
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
|
||||
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
|
||||
<project name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="0e1929fa3aa38bf9d40e9e953d619fab8164c82e"/>
|
||||
|
@ -12,15 +12,15 @@
|
||||
<!--original fetch url was https://git.mozilla.org/releases-->
|
||||
<remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
|
||||
<!-- B2G specific things. -->
|
||||
<project name="platform_build" path="build" remote="b2g" revision="42c224f4304c10166739fd9e25b2db1036410bd8">
|
||||
<project name="platform_build" path="build" remote="b2g" revision="6e2a3b589d1e8cc1d9df25f5e630ce30a0aa39f3">
|
||||
<copyfile dest="Makefile" src="core/root.mk"/>
|
||||
</project>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="4142df90c71abdc1e3a87cd37dff1a22d5e38b34"/>
|
||||
<project name="gaia" path="gaia" remote="mozillaorg" revision="b669dd2cc321f37cebc7081a79b968cac36b4200"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="64740b3467718db9a63560849b7789d3cf157963"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c5e563ed4ea69e3737bbbe6156f2915dd1e86226"/>
|
||||
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
|
||||
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
|
||||
<!-- Stock Android things -->
|
||||
@ -100,7 +100,7 @@
|
||||
<project name="platform/external/webrtc" path="external/webrtc" revision="1a1433203ddf6395516e065ada1dcdfc8bd5c654"/>
|
||||
<project name="platform/external/yaffs2" path="external/yaffs2" revision="d94a17182a88c2c2d865f50b728de8561d251efa"/>
|
||||
<project name="platform/external/zlib" path="external/zlib" revision="06608b270da9ec8a3e618f201d7356aad83f9ffe"/>
|
||||
<project name="platform_frameworks_av" path="frameworks/av" remote="b2g" revision="fa40716703edc8664365b46d206c11635d2b7a90"/>
|
||||
<project name="platform_frameworks_av" path="frameworks/av" remote="b2g" revision="f9000e9ec6fb84a24ffe049e6a6372c0305ee0f1"/>
|
||||
<project name="platform/frameworks/base" path="frameworks/base" revision="8fafbc6692a52d1f1417693f24f6349b4de5afbd"/>
|
||||
<project name="platform/frameworks/native" path="frameworks/native" revision="c135c11c422c1570fdae2e19336f06f39e723c5a"/>
|
||||
<project name="platform/frameworks/opt/emoji" path="frameworks/opt/emoji" revision="bc06a1779be6919a581a938e1c3118b3a4ab4c18"/>
|
||||
@ -127,7 +127,7 @@
|
||||
<project name="device-mako" path="device/lge/mako" remote="b2g" revision="78d17f0c117f0c66dd55ee8d5c5dde8ccc93ecba"/>
|
||||
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="3a9a17613cc685aa232432566ad6cc607eab4ec1"/>
|
||||
<project name="device/lge/mako-kernel" path="device/lge/mako-kernel" revision="d1729e53d71d711c8fde25eab8728ff2b9b4df0e"/>
|
||||
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="ea8011252172347bd7711f6fc9c5cc24ab1a109b"/>
|
||||
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="d0aa65b140a45016975ed0ecf35f280dd336e1d3"/>
|
||||
<project name="platform/external/libnfc-nci" path="external/libnfc-nci" revision="7d33aaf740bbf6c7c6e9c34a92b371eda311b66b"/>
|
||||
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="0e56e450367cd802241b27164a2979188242b95f"/>
|
||||
<project name="platform/hardware/broadcom/wlan" path="hardware/broadcom/wlan" revision="0e1929fa3aa38bf9d40e9e953d619fab8164c82e"/>
|
||||
|
@ -17,12 +17,12 @@
|
||||
<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="4142df90c71abdc1e3a87cd37dff1a22d5e38b34"/>
|
||||
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="b669dd2cc321f37cebc7081a79b968cac36b4200"/>
|
||||
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="531cf670e485649c69746e46d567929fcd54cbc5"/>
|
||||
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
|
||||
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
|
||||
<project name="moztt" path="external/moztt" remote="b2g" revision="ce95d372e6d285725b96490afdaaf489ad8f9ca9"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="64740b3467718db9a63560849b7789d3cf157963"/>
|
||||
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="c5e563ed4ea69e3737bbbe6156f2915dd1e86226"/>
|
||||
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
|
||||
<!-- Stock Android things -->
|
||||
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
|
||||
|
@ -432,6 +432,13 @@ AudioChannelService::ContentOrNormalChannelIsActive()
|
||||
!mChannelCounters[AUDIO_CHANNEL_INT_NORMAL].IsEmpty();
|
||||
}
|
||||
|
||||
bool
|
||||
AudioChannelService::TelephonyChannelIsActive()
|
||||
{
|
||||
return !mChannelCounters[AUDIO_CHANNEL_INT_TELEPHONY].IsEmpty() ||
|
||||
!mChannelCounters[AUDIO_CHANNEL_INT_TELEPHONY_HIDDEN].IsEmpty();
|
||||
}
|
||||
|
||||
bool
|
||||
AudioChannelService::ProcessContentOrNormalChannelIsActive(uint64_t aChildID)
|
||||
{
|
||||
|
@ -74,6 +74,12 @@ public:
|
||||
*/
|
||||
virtual bool ContentOrNormalChannelIsActive();
|
||||
|
||||
/**
|
||||
* Return true if there is a telephony channel active in this process
|
||||
* or one of its subprocesses.
|
||||
*/
|
||||
virtual bool TelephonyChannelIsActive();
|
||||
|
||||
/**
|
||||
* Return true if a normal or content channel is active for the given
|
||||
* process ID.
|
||||
|
@ -33,33 +33,45 @@
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "mozilla/unused.h"
|
||||
|
||||
#define ENSURE_BLUETOOTH_IS_READY(runnable, result) \
|
||||
do { \
|
||||
if (!sBtInterface || !IsEnabled()) { \
|
||||
NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth is not ready"); \
|
||||
DispatchBluetoothReply(runnable, BluetoothValue(), errorStr); \
|
||||
return result; \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::ipc;
|
||||
USING_BLUETOOTH_NAMESPACE
|
||||
|
||||
/**
|
||||
* Static variables
|
||||
*/
|
||||
static bluetooth_device_t* sBtDevice;
|
||||
static const bt_interface_t* sBtInterface;
|
||||
static bool sAdapterDiscoverable = false;
|
||||
static bool sIsBtEnabled = false;
|
||||
// TODO: Non thread-safe static variables
|
||||
static nsString sAdapterBdAddress;
|
||||
static nsString sAdapterBdName;
|
||||
static uint32_t sAdapterDiscoverableTimeout;
|
||||
static InfallibleTArray<nsString> sAdapterBondedAddressArray;
|
||||
static InfallibleTArray<BluetoothNamedValue> sRemoteDevicesPack;
|
||||
|
||||
// Static variables below should only be used on *main thread*
|
||||
static const bt_interface_t* sBtInterface;
|
||||
static nsTArray<nsRefPtr<BluetoothProfileController> > sControllerArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sBondingRunnableArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sGetDeviceRunnableArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sSetPropertyRunnableArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sUnbondingRunnableArray;
|
||||
static nsTArray<int> sRequestedDeviceCountArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sSetPropertyRunnableArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sGetDeviceRunnableArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sBondingRunnableArray;
|
||||
static nsTArray<nsRefPtr<BluetoothReplyRunnable> > sUnbondingRunnableArray;
|
||||
|
||||
// Static variables below should only be used on *callback thread*
|
||||
|
||||
|
||||
// Atomic static variables
|
||||
static Atomic<bool> sAdapterDiscoverable(false);
|
||||
static Atomic<uint32_t> sAdapterDiscoverableTimeout(0);
|
||||
|
||||
/**
|
||||
* Classes only used in this file
|
||||
*/
|
||||
class DistributeBluetoothSignalTask : public nsRunnable {
|
||||
class DistributeBluetoothSignalTask MOZ_FINAL : public nsRunnable
|
||||
{
|
||||
public:
|
||||
DistributeBluetoothSignalTask(const BluetoothSignal& aSignal) :
|
||||
mSignal(aSignal)
|
||||
@ -83,12 +95,9 @@ private:
|
||||
BluetoothSignal mSignal;
|
||||
};
|
||||
|
||||
class SetupAfterEnabledTask : public nsRunnable
|
||||
class SetupAfterEnabledTask MOZ_FINAL : public nsRunnable
|
||||
{
|
||||
public:
|
||||
SetupAfterEnabledTask()
|
||||
{ }
|
||||
|
||||
NS_IMETHOD
|
||||
Run()
|
||||
{
|
||||
@ -133,12 +142,9 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class CleanupTask : public nsRunnable
|
||||
class CleanupTask MOZ_FINAL : public nsRunnable
|
||||
{
|
||||
public:
|
||||
CleanupTask()
|
||||
{ }
|
||||
|
||||
NS_IMETHOD
|
||||
Run()
|
||||
{
|
||||
@ -268,45 +274,61 @@ PlayStatusStringToControlPlayStatus(const nsAString& aPlayStatus)
|
||||
return playStatus;
|
||||
}
|
||||
|
||||
static bool
|
||||
IsReady()
|
||||
{
|
||||
if (!sBtInterface || !sIsBtEnabled) {
|
||||
BT_LOGR("Warning! Bluetooth Service is not ready");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bluedroid HAL callback functions
|
||||
*
|
||||
* Several callbacks are dispatched to main thread to avoid racing issues.
|
||||
*/
|
||||
static void
|
||||
AdapterStateChangeCallback(bt_state_t aStatus)
|
||||
{
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
|
||||
BT_LOGR("BT_STATE %d", aStatus);
|
||||
BT_LOGR("BT_STATE: %d", aStatus);
|
||||
|
||||
sIsBtEnabled = (aStatus == BT_STATE_ON);
|
||||
bool isBtEnabled = (aStatus == BT_STATE_ON);
|
||||
|
||||
if (!sIsBtEnabled && NS_FAILED(NS_DispatchToMainThread(new CleanupTask()))) {
|
||||
if (!isBtEnabled &&
|
||||
NS_FAILED(NS_DispatchToMainThread(new CleanupTask()))) {
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
return;
|
||||
}
|
||||
|
||||
nsRefPtr<nsRunnable> runnable =
|
||||
new BluetoothService::ToggleBtAck(sIsBtEnabled);
|
||||
new BluetoothService::ToggleBtAck(isBtEnabled);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (sIsBtEnabled &&
|
||||
if (isBtEnabled &&
|
||||
NS_FAILED(NS_DispatchToMainThread(new SetupAfterEnabledTask()))) {
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
class AdapterPropertiesCallbackTask MOZ_FINAL : public nsRunnable
|
||||
{
|
||||
public:
|
||||
NS_IMETHOD
|
||||
Run()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!sSetPropertyRunnableArray.IsEmpty()) {
|
||||
DispatchBluetoothReply(sSetPropertyRunnableArray[0],
|
||||
BluetoothValue(true), EmptyString());
|
||||
sSetPropertyRunnableArray.RemoveElementAt(0);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* AdapterPropertiesCallback will be called after enable() but before
|
||||
* AdapterStateChangeCallback sIsBtEnabled get updated. At that moment, both
|
||||
* AdapterStateChangeCallback is called. At that moment, both
|
||||
* BluetoothManager/BluetoothAdapter does not register observer yet.
|
||||
*/
|
||||
static void
|
||||
@ -383,14 +405,64 @@ AdapterPropertiesCallback(bt_status_t aStatus, int aNumProperties,
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
}
|
||||
|
||||
// bluedroid BTU task was stored in the task queue, see GKI_send_msg
|
||||
if (!sSetPropertyRunnableArray.IsEmpty()) {
|
||||
DispatchBluetoothReply(sSetPropertyRunnableArray[0], BluetoothValue(true),
|
||||
EmptyString());
|
||||
sSetPropertyRunnableArray.RemoveElementAt(0);
|
||||
}
|
||||
// Redirect to main thread to avoid racing problem
|
||||
NS_DispatchToMainThread(new AdapterPropertiesCallbackTask());
|
||||
}
|
||||
|
||||
class RemoteDevicePropertiesCallbackTask : public nsRunnable
|
||||
{
|
||||
const InfallibleTArray<BluetoothNamedValue> mProps;
|
||||
nsString mRemoteDeviceBdAddress;
|
||||
public:
|
||||
RemoteDevicePropertiesCallbackTask(
|
||||
const InfallibleTArray<BluetoothNamedValue>& aProps,
|
||||
const nsAString& aRemoteDeviceBdAddress)
|
||||
: mProps(aProps)
|
||||
, mRemoteDeviceBdAddress(aRemoteDeviceBdAddress)
|
||||
{ }
|
||||
|
||||
NS_IMETHOD
|
||||
Run()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (sRequestedDeviceCountArray.IsEmpty()) {
|
||||
// This is possible because the callback would be called after turning
|
||||
// Bluetooth on.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// Update to registered BluetoothDevice objects
|
||||
BluetoothSignal signal(NS_LITERAL_STRING("PropertyChanged"),
|
||||
mRemoteDeviceBdAddress, mProps);
|
||||
nsRefPtr<DistributeBluetoothSignalTask>
|
||||
t = new DistributeBluetoothSignalTask(signal);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(t))) {
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static InfallibleTArray<BluetoothNamedValue> sRemoteDevicesPack;
|
||||
|
||||
// Use address as the index
|
||||
sRemoteDevicesPack.AppendElement(
|
||||
BluetoothNamedValue(mRemoteDeviceBdAddress, mProps));
|
||||
|
||||
if (--sRequestedDeviceCountArray[0] == 0) {
|
||||
if (!sGetDeviceRunnableArray.IsEmpty()) {
|
||||
DispatchBluetoothReply(sGetDeviceRunnableArray[0],
|
||||
sRemoteDevicesPack, EmptyString());
|
||||
sGetDeviceRunnableArray.RemoveElementAt(0);
|
||||
}
|
||||
|
||||
sRequestedDeviceCountArray.RemoveElementAt(0);
|
||||
sRemoteDevicesPack.Clear();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* RemoteDevicePropertiesCallback will be called, as the following conditions:
|
||||
* 1. When BT is turning on, bluedroid automatically execute this callback
|
||||
@ -402,13 +474,6 @@ RemoteDevicePropertiesCallback(bt_status_t aStatus, bt_bdaddr_t *aBdAddress,
|
||||
{
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
|
||||
if (sRequestedDeviceCountArray.IsEmpty()) {
|
||||
MOZ_ASSERT(sGetDeviceRunnableArray.IsEmpty());
|
||||
return;
|
||||
}
|
||||
|
||||
sRequestedDeviceCountArray[0]--;
|
||||
|
||||
InfallibleTArray<BluetoothNamedValue> props;
|
||||
|
||||
nsString remoteDeviceBdAddress;
|
||||
@ -433,36 +498,9 @@ RemoteDevicePropertiesCallback(bt_status_t aStatus, bt_bdaddr_t *aBdAddress,
|
||||
}
|
||||
}
|
||||
|
||||
// Update to registered BluetoothDevice objects
|
||||
BluetoothSignal signal(NS_LITERAL_STRING("PropertyChanged"),
|
||||
remoteDeviceBdAddress, props);
|
||||
nsRefPtr<DistributeBluetoothSignalTask>
|
||||
t = new DistributeBluetoothSignalTask(signal);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(t))) {
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
}
|
||||
|
||||
// Use address as the index
|
||||
sRemoteDevicesPack.AppendElement(
|
||||
BluetoothNamedValue(remoteDeviceBdAddress, props));
|
||||
|
||||
if (sRequestedDeviceCountArray[0] == 0) {
|
||||
MOZ_ASSERT(!sGetDeviceRunnableArray.IsEmpty());
|
||||
|
||||
if (sGetDeviceRunnableArray.IsEmpty()) {
|
||||
BT_LOGR("No runnable to return");
|
||||
return;
|
||||
}
|
||||
|
||||
DispatchBluetoothReply(sGetDeviceRunnableArray[0],
|
||||
sRemoteDevicesPack, EmptyString());
|
||||
|
||||
// After firing it, clean up cache
|
||||
sRemoteDevicesPack.Clear();
|
||||
|
||||
sRequestedDeviceCountArray.RemoveElementAt(0);
|
||||
sGetDeviceRunnableArray.RemoveElementAt(0);
|
||||
}
|
||||
// Redirect to main thread to avoid racing problem
|
||||
NS_DispatchToMainThread(
|
||||
new RemoteDevicePropertiesCallbackTask(props, remoteDeviceBdAddress));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -581,26 +619,75 @@ SspRequestCallback(bt_bdaddr_t* aRemoteBdAddress, bt_bdname_t* aRemoteBdName,
|
||||
}
|
||||
}
|
||||
|
||||
class BondStateChangedCallbackTask : public nsRunnable
|
||||
{
|
||||
nsString mRemoteDeviceBdAddress;
|
||||
bool mBonded;
|
||||
public:
|
||||
BondStateChangedCallbackTask(const nsAString& aRemoteDeviceBdAddress,
|
||||
bool aBonded)
|
||||
: mRemoteDeviceBdAddress(aRemoteDeviceBdAddress)
|
||||
, mBonded(aBonded)
|
||||
{ }
|
||||
|
||||
NS_IMETHOD
|
||||
Run()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (mBonded && !sBondingRunnableArray.IsEmpty()) {
|
||||
DispatchBluetoothReply(sBondingRunnableArray[0],
|
||||
BluetoothValue(true), EmptyString());
|
||||
|
||||
sBondingRunnableArray.RemoveElementAt(0);
|
||||
} else if (!mBonded && !sUnbondingRunnableArray.IsEmpty()) {
|
||||
DispatchBluetoothReply(sUnbondingRunnableArray[0],
|
||||
BluetoothValue(true), EmptyString());
|
||||
|
||||
sUnbondingRunnableArray.RemoveElementAt(0);
|
||||
}
|
||||
|
||||
// Update bonding status to gaia
|
||||
InfallibleTArray<BluetoothNamedValue> propertiesArray;
|
||||
BT_APPEND_NAMED_VALUE(propertiesArray, "address", mRemoteDeviceBdAddress);
|
||||
BT_APPEND_NAMED_VALUE(propertiesArray, "status", mBonded);
|
||||
|
||||
BluetoothSignal signal(NS_LITERAL_STRING(PAIRED_STATUS_CHANGED_ID),
|
||||
NS_LITERAL_STRING(KEY_ADAPTER),
|
||||
BluetoothValue(propertiesArray));
|
||||
NS_DispatchToMainThread(new DistributeBluetoothSignalTask(signal));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
|
||||
static void
|
||||
BondStateChangedCallback(bt_status_t aStatus, bt_bdaddr_t* aRemoteBdAddress,
|
||||
bt_bond_state_t aState)
|
||||
{
|
||||
MOZ_ASSERT(!NS_IsMainThread());
|
||||
|
||||
nsAutoString remoteAddress;
|
||||
BdAddressTypeToString(aRemoteBdAddress, remoteAddress);
|
||||
if (aState == BT_BOND_STATE_BONDING) {
|
||||
// No need to handle bonding state
|
||||
return;
|
||||
}
|
||||
|
||||
nsAutoString remoteBdAddress;
|
||||
BdAddressTypeToString(aRemoteBdAddress, remoteBdAddress);
|
||||
|
||||
if (aState == BT_BOND_STATE_BONDED &&
|
||||
sAdapterBondedAddressArray.Contains(remoteBdAddress)) {
|
||||
// See bug 940271 for more details about this case.
|
||||
return;
|
||||
}
|
||||
|
||||
// We don't need to handle bonding state
|
||||
NS_ENSURE_TRUE_VOID(aState != BT_BOND_STATE_BONDING);
|
||||
NS_ENSURE_FALSE_VOID(aState == BT_BOND_STATE_BONDED &&
|
||||
sAdapterBondedAddressArray.Contains(remoteAddress));
|
||||
bool bonded;
|
||||
if (aState == BT_BOND_STATE_NONE) {
|
||||
bonded = false;
|
||||
sAdapterBondedAddressArray.RemoveElement(remoteAddress);
|
||||
sAdapterBondedAddressArray.RemoveElement(remoteBdAddress);
|
||||
} else if (aState == BT_BOND_STATE_BONDED) {
|
||||
bonded = true;
|
||||
sAdapterBondedAddressArray.AppendElement(remoteAddress);
|
||||
sAdapterBondedAddressArray.AppendElement(remoteBdAddress);
|
||||
}
|
||||
|
||||
// Update bonded address list to BluetoothAdapter
|
||||
@ -614,27 +701,9 @@ BondStateChangedCallback(bt_status_t aStatus, bt_bdaddr_t* aRemoteBdAddress,
|
||||
BluetoothValue(propertiesChangeArray));
|
||||
NS_DispatchToMainThread(new DistributeBluetoothSignalTask(signal));
|
||||
|
||||
// Update bonding status to gaia
|
||||
InfallibleTArray<BluetoothNamedValue> propertiesArray;
|
||||
BT_APPEND_NAMED_VALUE(propertiesArray, "address", remoteAddress);
|
||||
BT_APPEND_NAMED_VALUE(propertiesArray, "status", bonded);
|
||||
|
||||
BluetoothSignal newSignal(NS_LITERAL_STRING(PAIRED_STATUS_CHANGED_ID),
|
||||
NS_LITERAL_STRING(KEY_ADAPTER),
|
||||
BluetoothValue(propertiesArray));
|
||||
NS_DispatchToMainThread(new DistributeBluetoothSignalTask(newSignal));
|
||||
|
||||
if (bonded && !sBondingRunnableArray.IsEmpty()) {
|
||||
DispatchBluetoothReply(sBondingRunnableArray[0],
|
||||
BluetoothValue(true), EmptyString());
|
||||
|
||||
sBondingRunnableArray.RemoveElementAt(0);
|
||||
} else if (!bonded && !sUnbondingRunnableArray.IsEmpty()) {
|
||||
DispatchBluetoothReply(sUnbondingRunnableArray[0],
|
||||
BluetoothValue(true), EmptyString());
|
||||
|
||||
sUnbondingRunnableArray.RemoveElementAt(0);
|
||||
}
|
||||
// Redirect to main thread to avoid racing problem
|
||||
NS_DispatchToMainThread(
|
||||
new BondStateChangedCallbackTask(remoteBdAddress, bonded));
|
||||
}
|
||||
|
||||
static void
|
||||
@ -673,15 +742,17 @@ EnsureBluetoothHalLoad()
|
||||
{
|
||||
hw_module_t* module;
|
||||
hw_device_t* device;
|
||||
|
||||
int err = hw_get_module(BT_HARDWARE_MODULE_ID, (hw_module_t const**)&module);
|
||||
if (err != 0) {
|
||||
BT_LOGR("Error: %s", strerror(err));
|
||||
return false;
|
||||
}
|
||||
module->methods->open(module, BT_HARDWARE_MODULE_ID, &device);
|
||||
sBtDevice = (bluetooth_device_t *)device;
|
||||
NS_ENSURE_TRUE(sBtDevice, false);
|
||||
sBtInterface = sBtDevice->get_bluetooth_interface();
|
||||
bluetooth_device_t* btDevice = (bluetooth_device_t *)device;
|
||||
NS_ENSURE_TRUE(btDevice, false);
|
||||
|
||||
sBtInterface = btDevice->get_bluetooth_interface();
|
||||
NS_ENSURE_TRUE(sBtInterface, false);
|
||||
|
||||
return true;
|
||||
@ -709,12 +780,16 @@ static nsresult
|
||||
StartStopGonkBluetooth(bool aShouldEnable)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
NS_ENSURE_TRUE(sBtInterface, NS_ERROR_FAILURE);
|
||||
|
||||
if (sIsBtEnabled == aShouldEnable) {
|
||||
BluetoothService* bs = BluetoothService::Get();
|
||||
NS_ENSURE_TRUE(bs, NS_ERROR_FAILURE);
|
||||
|
||||
if (bs->IsEnabled() == aShouldEnable) {
|
||||
// Keep current enable status
|
||||
nsRefPtr<nsRunnable> runnable =
|
||||
new BluetoothService::ToggleBtAck(sIsBtEnabled);
|
||||
new BluetoothService::ToggleBtAck(aShouldEnable);
|
||||
if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
|
||||
BT_WARNING("Failed to dispatch to main thread!");
|
||||
}
|
||||
@ -813,6 +888,11 @@ BluetoothServiceBluedroid::GetDefaultAdapterPathInternal(
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
// Since Atomic<*> is not acceptable for BT_APPEND_NAMED_VALUE(),
|
||||
// create another variable to store data.
|
||||
bool discoverable = sAdapterDiscoverable;
|
||||
uint32_t discoverableTimeout = sAdapterDiscoverableTimeout;
|
||||
|
||||
BluetoothValue v = InfallibleTArray<BluetoothNamedValue>();
|
||||
|
||||
BT_APPEND_NAMED_VALUE(v.get_ArrayOfBluetoothNamedValue(),
|
||||
@ -822,10 +902,10 @@ BluetoothServiceBluedroid::GetDefaultAdapterPathInternal(
|
||||
"Name", sAdapterBdName);
|
||||
|
||||
BT_APPEND_NAMED_VALUE(v.get_ArrayOfBluetoothNamedValue(),
|
||||
"Discoverable", sAdapterDiscoverable);
|
||||
"Discoverable", discoverable);
|
||||
|
||||
BT_APPEND_NAMED_VALUE(v.get_ArrayOfBluetoothNamedValue(),
|
||||
"DiscoverableTimeout", sAdapterDiscoverableTimeout);
|
||||
"DiscoverableTimeout", discoverableTimeout);
|
||||
|
||||
BT_APPEND_NAMED_VALUE(v.get_ArrayOfBluetoothNamedValue(),
|
||||
"Devices", sAdapterBondedAddressArray);
|
||||
@ -841,11 +921,7 @@ BluetoothServiceBluedroid::GetConnectedDevicePropertiesInternal(
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!IsReady()) {
|
||||
NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
|
||||
DispatchBluetoothReply(aRunnable, BluetoothValue(), errorStr);
|
||||
return NS_OK;
|
||||
}
|
||||
ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
|
||||
|
||||
BluetoothProfileManagerBase* profile =
|
||||
BluetoothUuidHelper::GetBluetoothProfileManager(aServiceUuid);
|
||||
@ -895,11 +971,7 @@ BluetoothServiceBluedroid::GetPairedDevicePropertiesInternal(
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!IsReady()) {
|
||||
NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
|
||||
DispatchBluetoothReply(aRunnable, BluetoothValue(), errorStr);
|
||||
return NS_OK;
|
||||
}
|
||||
ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
|
||||
|
||||
int requestedDeviceCount = aDeviceAddress.Length();
|
||||
if (requestedDeviceCount == 0) {
|
||||
@ -932,11 +1004,7 @@ BluetoothServiceBluedroid::StartDiscoveryInternal(
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!IsReady()) {
|
||||
NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
|
||||
DispatchBluetoothReply(aRunnable, BluetoothValue(), errorStr);
|
||||
return NS_OK;
|
||||
}
|
||||
ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
|
||||
|
||||
int ret = sBtInterface->start_discovery();
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
@ -956,11 +1024,7 @@ BluetoothServiceBluedroid::StopDiscoveryInternal(
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!IsReady()) {
|
||||
NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
|
||||
DispatchBluetoothReply(aRunnable, BluetoothValue(), errorStr);
|
||||
return NS_OK;
|
||||
}
|
||||
ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
|
||||
|
||||
int ret = sBtInterface->cancel_discovery();
|
||||
if (ret != BT_STATUS_SUCCESS) {
|
||||
@ -980,12 +1044,7 @@ BluetoothServiceBluedroid::SetProperty(BluetoothObjectType aType,
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!IsReady()) {
|
||||
NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
|
||||
DispatchBluetoothReply(aRunnable, BluetoothValue(), errorStr);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
|
||||
|
||||
const nsString propName = aValue.name();
|
||||
bt_property_t prop;
|
||||
@ -1058,11 +1117,7 @@ BluetoothServiceBluedroid::CreatePairedDeviceInternal(
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!IsReady()) {
|
||||
NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
|
||||
DispatchBluetoothReply(aRunnable, BluetoothValue(), errorStr);
|
||||
return NS_OK;
|
||||
}
|
||||
ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
|
||||
|
||||
bt_bdaddr_t remoteAddress;
|
||||
StringToBdAddressType(aDeviceAddress, &remoteAddress);
|
||||
@ -1083,11 +1138,7 @@ BluetoothServiceBluedroid::RemoveDeviceInternal(
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!IsReady()) {
|
||||
NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
|
||||
DispatchBluetoothReply(aRunnable, BluetoothValue(), errorStr);
|
||||
return NS_OK;
|
||||
}
|
||||
ENSURE_BLUETOOTH_IS_READY(aRunnable, NS_OK);
|
||||
|
||||
bt_bdaddr_t remoteAddress;
|
||||
StringToBdAddressType(aDeviceAddress, &remoteAddress);
|
||||
@ -1110,11 +1161,7 @@ BluetoothServiceBluedroid::SetPinCodeInternal(
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!IsReady()) {
|
||||
NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
|
||||
DispatchBluetoothReply(aRunnable, BluetoothValue(), errorStr);
|
||||
return false;
|
||||
}
|
||||
ENSURE_BLUETOOTH_IS_READY(aRunnable, false);
|
||||
|
||||
bt_bdaddr_t remoteAddress;
|
||||
StringToBdAddressType(aDeviceAddress, &remoteAddress);
|
||||
@ -1147,11 +1194,7 @@ BluetoothServiceBluedroid::SetPairingConfirmationInternal(
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
if (!IsReady()) {
|
||||
NS_NAMED_LITERAL_STRING(errorStr, "Bluetooth service is not ready yet!");
|
||||
DispatchBluetoothReply(aRunnable, BluetoothValue(), errorStr);
|
||||
return false;
|
||||
}
|
||||
ENSURE_BLUETOOTH_IS_READY(aRunnable, false);
|
||||
|
||||
bt_bdaddr_t remoteAddress;
|
||||
StringToBdAddressType(aDeviceAddress, &remoteAddress);
|
||||
|
@ -285,6 +285,10 @@ const kEventConstructors = {
|
||||
return new MozWifiStatusChangeEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
MozWifiStationInfoEvent: { create: function (aName, aProps) {
|
||||
return new MozWifiStationInfoEvent(aName, aProps);
|
||||
},
|
||||
},
|
||||
MutationEvent: { create: function (aName, aProps) {
|
||||
var e = document.createEvent("mutationevent");
|
||||
e.initMutationEvent(aName, aProps.bubbles, aProps.cancelable,
|
||||
|
@ -2499,7 +2499,6 @@ TabChild::InitRenderingState()
|
||||
if (!sTabChildren) {
|
||||
sTabChildren = new TabChildMap;
|
||||
}
|
||||
MOZ_ASSERT(!sTabChildren->Get(id));
|
||||
sTabChildren->Put(id, this);
|
||||
mLayersId = id;
|
||||
}
|
||||
@ -2709,14 +2708,14 @@ TabChild::GetFrom(uint64_t aLayersId)
|
||||
}
|
||||
|
||||
void
|
||||
TabChild::DidComposite(uint64_t aTransactionId)
|
||||
TabChild::DidComposite()
|
||||
{
|
||||
MOZ_ASSERT(mWidget);
|
||||
MOZ_ASSERT(mWidget->GetLayerManager());
|
||||
MOZ_ASSERT(mWidget->GetLayerManager()->GetBackendType() == LayersBackend::LAYERS_CLIENT);
|
||||
|
||||
ClientLayerManager *manager = static_cast<ClientLayerManager*>(mWidget->GetLayerManager());
|
||||
manager->DidComposite(aTransactionId);
|
||||
manager->DidComposite();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -446,7 +446,7 @@ public:
|
||||
static TabChild* GetFrom(nsIPresShell* aPresShell);
|
||||
static TabChild* GetFrom(uint64_t aLayersId);
|
||||
|
||||
void DidComposite(uint64_t aTransactionId);
|
||||
void DidComposite();
|
||||
|
||||
static inline TabChild*
|
||||
GetFrom(nsIDOMWindow* aWindow)
|
||||
|
@ -60,7 +60,6 @@ skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled
|
||||
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) b2g-debug(Bug 960442, video support for WebRTC is disabled on b2g)
|
||||
[test_peerConnection_bug834153.html]
|
||||
[test_peerConnection_bug835370.html]
|
||||
[test_peerConnection_bug1013809.html]
|
||||
[test_peerConnection_close.html]
|
||||
[test_peerConnection_errorCallbacks.html]
|
||||
[test_peerConnection_offerRequiresReceiveAudio.html]
|
||||
|
@ -134,16 +134,6 @@ var commandsPeerConnection = [
|
||||
});
|
||||
}
|
||||
],
|
||||
[
|
||||
'PC_REMOTE_SET_LOCAL_DESCRIPTION',
|
||||
function (test) {
|
||||
test.setLocalDescription(test.pcRemote, test.pcRemote._last_answer, STABLE, function () {
|
||||
is(test.pcRemote.signalingState, STABLE,
|
||||
"signalingState after remote setLocalDescription is 'stable'");
|
||||
test.next();
|
||||
});
|
||||
}
|
||||
],
|
||||
[
|
||||
'PC_LOCAL_GET_ANSWER',
|
||||
function (test) {
|
||||
@ -171,6 +161,16 @@ var commandsPeerConnection = [
|
||||
});
|
||||
}
|
||||
],
|
||||
[
|
||||
'PC_REMOTE_SET_LOCAL_DESCRIPTION',
|
||||
function (test) {
|
||||
test.setLocalDescription(test.pcRemote, test.pcRemote._last_answer, STABLE, function () {
|
||||
is(test.pcRemote.signalingState, STABLE,
|
||||
"signalingState after remote setLocalDescription is 'stable'");
|
||||
test.next();
|
||||
});
|
||||
}
|
||||
],
|
||||
[
|
||||
'PC_LOCAL_WAIT_FOR_ICE_CONNECTED',
|
||||
function (test) {
|
||||
|
@ -1,30 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="head.js"></script>
|
||||
<script type="application/javascript" src="pc.js"></script>
|
||||
<script type="application/javascript" src="templates.js"></script>
|
||||
<script type="application/javascript" src="turnConfig.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
createHTML({
|
||||
bug: "1013809",
|
||||
title: "Audio-only peer connection with swapped setLocal and setRemote steps"
|
||||
});
|
||||
|
||||
var test;
|
||||
runTest(function (options) {
|
||||
test = new PeerConnectionTest(options);
|
||||
var sld = test.chain.remove("PC_REMOTE_SET_LOCAL_DESCRIPTION");
|
||||
test.chain.insertAfter("PC_LOCAL_SET_REMOTE_DESCRIPTION", sld);
|
||||
test.setMediaConstraints([{audio: true}], [{audio: true}]);
|
||||
test.run();
|
||||
});
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -47,12 +47,13 @@ using namespace mozilla::dom::bluetooth;
|
||||
|
||||
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "AudioManager" , ## args)
|
||||
|
||||
#define HEADPHONES_STATUS_HEADSET MOZ_UTF16("headset")
|
||||
#define HEADPHONES_STATUS_HEADPHONE MOZ_UTF16("headphone")
|
||||
#define HEADPHONES_STATUS_OFF MOZ_UTF16("off")
|
||||
#define HEADPHONES_STATUS_UNKNOWN MOZ_UTF16("unknown")
|
||||
#define HEADPHONES_STATUS_CHANGED "headphones-status-changed"
|
||||
#define MOZ_SETTINGS_CHANGE_ID "mozsettings-changed"
|
||||
#define HEADPHONES_STATUS_HEADSET MOZ_UTF16("headset")
|
||||
#define HEADPHONES_STATUS_HEADPHONE MOZ_UTF16("headphone")
|
||||
#define HEADPHONES_STATUS_OFF MOZ_UTF16("off")
|
||||
#define HEADPHONES_STATUS_UNKNOWN MOZ_UTF16("unknown")
|
||||
#define HEADPHONES_STATUS_CHANGED "headphones-status-changed"
|
||||
#define MOZ_SETTINGS_CHANGE_ID "mozsettings-changed"
|
||||
#define AUDIO_CHANNEL_PROCESS_CHANGED "audio-channel-process-changed"
|
||||
|
||||
static void BinderDeadCallback(status_t aErr);
|
||||
static void InternalSetAudioRoutes(SwitchState aState);
|
||||
@ -280,6 +281,32 @@ AudioManager::HandleBluetoothStatusChanged(nsISupports* aSubject,
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
AudioManager::HandleAudioChannelProcessChanged()
|
||||
{
|
||||
// Note: If the user answers a VoIP call (e.g. WebRTC calls) during the
|
||||
// telephony call (GSM/CDMA calls) the audio manager won't set the
|
||||
// PHONE_STATE_IN_COMMUNICATION audio state. Once the telephony call finishes
|
||||
// the RIL plumbing sets the PHONE_STATE_NORMAL audio state. This seems to be
|
||||
// an issue for the VoIP call but it is not. Once the RIL plumbing sets the
|
||||
// the PHONE_STATE_NORMAL audio state the AudioManager::mPhoneAudioAgent
|
||||
// member will call the StopPlaying() method causing that this function will
|
||||
// be called again and therefore the audio manager sets the
|
||||
// PHONE_STATE_IN_COMMUNICATION audio state.
|
||||
|
||||
if ((mPhoneState == PHONE_STATE_IN_CALL) ||
|
||||
(mPhoneState == PHONE_STATE_RINGTONE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
AudioChannelService *service = AudioChannelService::GetAudioChannelService();
|
||||
NS_ENSURE_TRUE_VOID(service);
|
||||
|
||||
bool telephonyChannelIsActive = service->TelephonyChannelIsActive();
|
||||
telephonyChannelIsActive ? SetPhoneState(PHONE_STATE_IN_COMMUNICATION) :
|
||||
SetPhoneState(PHONE_STATE_NORMAL);
|
||||
}
|
||||
|
||||
nsresult
|
||||
AudioManager::Observe(nsISupports* aSubject,
|
||||
const char* aTopic,
|
||||
@ -298,6 +325,11 @@ AudioManager::Observe(nsISupports* aSubject,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
else if (!strcmp(aTopic, AUDIO_CHANNEL_PROCESS_CHANGED)) {
|
||||
HandleAudioChannelProcessChanged();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// To process the volume control on each audio channel according to
|
||||
// change of settings
|
||||
else if (!strcmp(aTopic, MOZ_SETTINGS_CHANGE_ID)) {
|
||||
@ -429,6 +461,9 @@ AudioManager::AudioManager()
|
||||
if (NS_FAILED(obs->AddObserver(this, MOZ_SETTINGS_CHANGE_ID, false))) {
|
||||
NS_WARNING("Failed to add mozsettings-changed observer!");
|
||||
}
|
||||
if (NS_FAILED(obs->AddObserver(this, AUDIO_CHANNEL_PROCESS_CHANGED, false))) {
|
||||
NS_WARNING("Failed to add audio-channel-process-changed observer!");
|
||||
}
|
||||
|
||||
#ifdef MOZ_B2G_RIL
|
||||
char value[PROPERTY_VALUE_MAX];
|
||||
@ -456,6 +491,9 @@ AudioManager::~AudioManager() {
|
||||
if (NS_FAILED(obs->RemoveObserver(this, MOZ_SETTINGS_CHANGE_ID))) {
|
||||
NS_WARNING("Failed to remove mozsettings-changed observer!");
|
||||
}
|
||||
if (NS_FAILED(obs->RemoveObserver(this, AUDIO_CHANNEL_PROCESS_CHANGED))) {
|
||||
NS_WARNING("Failed to remove audio-channel-process-changed!");
|
||||
}
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -73,6 +73,7 @@ private:
|
||||
void HandleBluetoothStatusChanged(nsISupports* aSubject,
|
||||
const char* aTopic,
|
||||
const nsCString aAddress);
|
||||
void HandleAudioChannelProcessChanged();
|
||||
};
|
||||
|
||||
} /* namespace gonk */
|
||||
|
@ -3359,7 +3359,14 @@ RilObject.prototype = {
|
||||
iccStatus.gsmUmtsSubscriptionAppIndex;
|
||||
|
||||
if (RILQUIRKS_SUBSCRIPTION_CONTROL && index === -1) {
|
||||
// Should enable uicc scription.
|
||||
// Should enable uicc scription if index is not valid.
|
||||
if (this.radioState !== GECKO_RADIOSTATE_READY) {
|
||||
// Note: setUiccSubscription works abnormally when RADIO is OFF,
|
||||
// which causes SMS function broken in Flame.
|
||||
// See bug 1008557 for detailed info.
|
||||
return;
|
||||
}
|
||||
|
||||
for (let i = 0; i < iccStatus.apps.length; i++) {
|
||||
this.setUiccSubscription({appIndex: i, enabled: true});
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ let emulator = (function() {
|
||||
function run(cmd, callback) {
|
||||
pendingCmdCount++;
|
||||
originalRunEmulatorCmd(cmd, function(result) {
|
||||
is(result[result.length - 1], "OK", "emulator command should be OK.");
|
||||
pendingCmdCount--;
|
||||
if (callback && typeof callback === "function") {
|
||||
callback(result);
|
||||
|
@ -713,7 +713,9 @@ var interfaceNamesInGlobalScope =
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "MozWifiConnectionInfoEvent", b2g: true},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "MozWifiManager", b2g: true, permission: "wifi-manage"},
|
||||
{name: "MozWifiStationInfoEvent", b2g: true},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "MozWifiManager", b2g: true, permission: "wifi-manage"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
{name: "MozWifiNetwork", b2g: true, permission: "wifi-manage"},
|
||||
// IMPORTANT: Do not change this list without review from a DOM peer!
|
||||
|
@ -321,4 +321,10 @@ interface MozWifiManager : EventTarget {
|
||||
*/
|
||||
attribute EventHandler onenabled;
|
||||
attribute EventHandler ondisabled;
|
||||
|
||||
/**
|
||||
* An event listener that is called with information about the number
|
||||
* of wifi stations connected to wifi hotspot every 5 seconds.
|
||||
*/
|
||||
attribute EventHandler onstationInfoUpdate;
|
||||
};
|
||||
|
19
dom/webidl/MozWifiStationInfoEvent.webidl
Normal file
19
dom/webidl/MozWifiStationInfoEvent.webidl
Normal file
@ -0,0 +1,19 @@
|
||||
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
[Constructor(DOMString type, optional MozWifiStationInfoEventInit eventInitDict), HeaderFile="GeneratedEventClasses.h"]
|
||||
interface MozWifiStationInfoEvent : Event
|
||||
{
|
||||
/**
|
||||
* The number of wifi stations connected to wifi hotspot.
|
||||
*/
|
||||
readonly attribute short station;
|
||||
};
|
||||
|
||||
dictionary MozWifiStationInfoEventInit : EventInit
|
||||
{
|
||||
short station = 0;
|
||||
};
|
@ -595,6 +595,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
|
||||
'MozWifiManager.webidl',
|
||||
'MozWifiP2pManager.webidl',
|
||||
'MozWifiP2pStatusChangeEvent.webidl',
|
||||
'MozWifiStationInfoEvent.webidl',
|
||||
'MozWifiStatusChangeEvent.webidl',
|
||||
]
|
||||
else:
|
||||
|
@ -80,6 +80,7 @@ function DOMWifiManager() {
|
||||
this.defineEventHandlerGetterSetter("onconnectionInfoUpdate");
|
||||
this.defineEventHandlerGetterSetter("onenabled");
|
||||
this.defineEventHandlerGetterSetter("ondisabled");
|
||||
this.defineEventHandlerGetterSetter("onstationInfoUpdate");
|
||||
}
|
||||
|
||||
DOMWifiManager.prototype = {
|
||||
@ -99,6 +100,7 @@ DOMWifiManager.prototype = {
|
||||
this._enabled = false;
|
||||
this._lastConnectionInfo = null;
|
||||
this._capabilities = null;
|
||||
this._stationNumber = 0;
|
||||
|
||||
const messages = ["WifiManager:getNetworks:Return:OK", "WifiManager:getNetworks:Return:NO",
|
||||
"WifiManager:getKnownNetworks:Return:OK", "WifiManager:getKnownNetworks:Return:NO",
|
||||
@ -116,8 +118,8 @@ DOMWifiManager.prototype = {
|
||||
"WifiManager:onconnect", "WifiManager:ondisconnect",
|
||||
"WifiManager:onwpstimeout", "WifiManager:onwpsfail",
|
||||
"WifiManager:onwpsoverlap", "WifiManager:connectionInfoUpdate",
|
||||
"WifiManager:onauthenticating",
|
||||
"WifiManager:onconnectingfailed"];
|
||||
"WifiManager:onauthenticating", "WifiManager:onconnectingfailed",
|
||||
"WifiManager:stationInfoUpdate"];
|
||||
this.initDOMRequestHelper(aWindow, messages);
|
||||
this._mm = Cc["@mozilla.org/childprocessmessagemanager;1"].getService(Ci.nsISyncMessageSender);
|
||||
|
||||
@ -392,6 +394,10 @@ DOMWifiManager.prototype = {
|
||||
this._connectionStatus = "authenticating";
|
||||
this._fireStatusChangeEvent();
|
||||
break;
|
||||
case "WifiManager:stationInfoUpdate":
|
||||
this._stationNumber = msg.station;
|
||||
this._fireStationInfoUpdate(msg);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
@ -419,6 +425,13 @@ DOMWifiManager.prototype = {
|
||||
this.__DOM_IMPL__.dispatchEvent(evt);
|
||||
},
|
||||
|
||||
_fireStationInfoUpdate: function onStationInfoUpdate(info) {
|
||||
var evt = new this._window.MozWifiStationInfoEvent("stationInfoUpdate",
|
||||
{ station: this._stationNumber}
|
||||
);
|
||||
this.__DOM_IMPL__.dispatchEvent(evt);
|
||||
},
|
||||
|
||||
getNetworks: function getNetworks() {
|
||||
var request = this.createRequest();
|
||||
this._sendMessageForRequest("WifiManager:getNetworks", null, request);
|
||||
|
@ -276,6 +276,33 @@ this.WifiCommand = function(aControlMessage, aInterface, aSdkVersion) {
|
||||
});
|
||||
};
|
||||
|
||||
command.connectToHostapd = function(callback) {
|
||||
voidControlMessage("connect_to_hostapd", callback);
|
||||
};
|
||||
|
||||
command.closeHostapdConnection = function(callback) {
|
||||
voidControlMessage("close_hostapd_connection", callback);
|
||||
};
|
||||
|
||||
command.hostapdCommand = function (callback, request) {
|
||||
var msg = { cmd: "hostapd_command",
|
||||
request: request,
|
||||
iface: aInterface };
|
||||
|
||||
aControlMessage(msg, function(data) {
|
||||
callback(data.status ? null : data.reply);
|
||||
});
|
||||
};
|
||||
|
||||
command.hostapdGetStations = function (callback) {
|
||||
var msg = { cmd: "hostapd_get_stations",
|
||||
iface: aInterface };
|
||||
|
||||
aControlMessage(msg, function(data) {
|
||||
callback(data.status);
|
||||
});
|
||||
};
|
||||
|
||||
command.setPowerModeICS = function (mode, callback) {
|
||||
doBooleanCommand("DRIVER POWERMODE " + (mode === "AUTO" ? 0 : 1), "OK", callback);
|
||||
};
|
||||
|
185
dom/wifi/WifiHotspotUtils.cpp
Normal file
185
dom/wifi/WifiHotspotUtils.cpp
Normal file
@ -0,0 +1,185 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "WifiHotspotUtils.h"
|
||||
#include <dlfcn.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <dirent.h>
|
||||
#include <stdlib.h>
|
||||
#include <cutils/properties.h>
|
||||
|
||||
#include "prinit.h"
|
||||
#include "mozilla/Assertions.h"
|
||||
#include "nsDebug.h"
|
||||
#include "nsPrintfCString.h"
|
||||
|
||||
static void* sWifiHotspotUtilsLib;
|
||||
static PRCallOnceType sInitWifiHotspotUtilsLib;
|
||||
// Socket pair used to exit from a blocking read.
|
||||
static struct wpa_ctrl* ctrl_conn;
|
||||
static const char *ctrl_iface_dir = "/data/misc/wifi/hostapd";
|
||||
static char *ctrl_ifname = nullptr;
|
||||
|
||||
DEFINE_DLFUNC(wpa_ctrl_open, struct wpa_ctrl*, const char*)
|
||||
DEFINE_DLFUNC(wpa_ctrl_close, void, struct wpa_ctrl*)
|
||||
DEFINE_DLFUNC(wpa_ctrl_attach, int32_t, struct wpa_ctrl*)
|
||||
DEFINE_DLFUNC(wpa_ctrl_detach, int32_t, struct wpa_ctrl*)
|
||||
DEFINE_DLFUNC(wpa_ctrl_request, int32_t, struct wpa_ctrl*,
|
||||
const char*, size_t cmd_len, char *reply,
|
||||
size_t *reply_len, void (*msg_cb)(char *msg, size_t len))
|
||||
|
||||
|
||||
static PRStatus
|
||||
InitWifiHotspotUtilsLib()
|
||||
{
|
||||
sWifiHotspotUtilsLib = dlopen("/system/lib/libwpa_client.so", RTLD_LAZY);
|
||||
// We might fail to open the hardware lib. That's OK.
|
||||
return PR_SUCCESS;
|
||||
}
|
||||
|
||||
static void*
|
||||
GetWifiHotspotLibHandle()
|
||||
{
|
||||
PR_CallOnce(&sInitWifiHotspotUtilsLib, InitWifiHotspotUtilsLib);
|
||||
return sWifiHotspotUtilsLib;
|
||||
}
|
||||
|
||||
struct wpa_ctrl *
|
||||
WifiHotspotUtils::openConnection(const char *ifname)
|
||||
{
|
||||
if (!ifname) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
USE_DLFUNC(wpa_ctrl_open)
|
||||
ctrl_conn = wpa_ctrl_open(nsPrintfCString("%s/%s", ctrl_iface_dir, ifname).get());
|
||||
return ctrl_conn;
|
||||
}
|
||||
|
||||
int32_t
|
||||
WifiHotspotUtils::sendCommand(struct wpa_ctrl *ctrl, const char *cmd,
|
||||
char *reply, size_t *reply_len)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
if (!ctrl_conn) {
|
||||
NS_WARNING(nsPrintfCString("Not connected to hostapd - \"%s\" command dropped.\n", cmd).get());
|
||||
return -1;
|
||||
}
|
||||
|
||||
USE_DLFUNC(wpa_ctrl_request)
|
||||
ret = wpa_ctrl_request(ctrl, cmd, strlen(cmd), reply, reply_len, nullptr);
|
||||
if (ret == -2) {
|
||||
NS_WARNING(nsPrintfCString("'%s' command timed out.\n", cmd).get());
|
||||
return -2;
|
||||
} else if (ret < 0 || strncmp(reply, "FAIL", 4) == 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Make the reply printable.
|
||||
reply[*reply_len] = '\0';
|
||||
if (strncmp(cmd, "STA-FIRST", 9) == 0 ||
|
||||
strncmp(cmd, "STA-NEXT", 8) == 0) {
|
||||
char *pos = reply;
|
||||
|
||||
while (*pos && *pos != '\n')
|
||||
pos++;
|
||||
*pos = '\0';
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
void*
|
||||
WifiHotspotUtils::GetSharedLibrary()
|
||||
{
|
||||
void* wpaClientLib = GetWifiHotspotLibHandle();
|
||||
if (!wpaClientLib) {
|
||||
NS_WARNING("No /system/lib/libwpa_client.so");
|
||||
}
|
||||
return wpaClientLib;
|
||||
}
|
||||
|
||||
int32_t WifiHotspotUtils::do_wifi_connect_to_hostapd()
|
||||
{
|
||||
struct dirent *dent;
|
||||
|
||||
DIR *dir = opendir(ctrl_iface_dir);
|
||||
if (dir) {
|
||||
while ((dent = readdir(dir))) {
|
||||
if (strcmp(dent->d_name, ".") == 0 ||
|
||||
strcmp(dent->d_name, "..") == 0) {
|
||||
continue;
|
||||
}
|
||||
ctrl_ifname = strdup(dent->d_name);
|
||||
break;
|
||||
}
|
||||
closedir(dir);
|
||||
}
|
||||
|
||||
ctrl_conn = openConnection(ctrl_ifname);
|
||||
if (!ctrl_conn) {
|
||||
NS_WARNING(nsPrintfCString("Unable to open connection to hostapd on \"%s\": %s",
|
||||
ctrl_ifname, strerror(errno)).get());
|
||||
return -1;
|
||||
}
|
||||
|
||||
USE_DLFUNC(wpa_ctrl_attach)
|
||||
if (wpa_ctrl_attach(ctrl_conn) != 0) {
|
||||
USE_DLFUNC(wpa_ctrl_close)
|
||||
wpa_ctrl_close(ctrl_conn);
|
||||
ctrl_conn = nullptr;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t WifiHotspotUtils::do_wifi_close_hostapd_connection()
|
||||
{
|
||||
if (!ctrl_conn) {
|
||||
NS_WARNING("Invalid ctrl_conn.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
USE_DLFUNC(wpa_ctrl_detach)
|
||||
if (wpa_ctrl_detach(ctrl_conn) < 0) {
|
||||
NS_WARNING("Failed to detach wpa_ctrl.");
|
||||
}
|
||||
|
||||
USE_DLFUNC(wpa_ctrl_close)
|
||||
wpa_ctrl_close(ctrl_conn);
|
||||
ctrl_conn = nullptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t WifiHotspotUtils::do_wifi_hostapd_command(const char *command,
|
||||
char *reply,
|
||||
size_t *reply_len)
|
||||
{
|
||||
return sendCommand(ctrl_conn, command, reply, reply_len);
|
||||
}
|
||||
|
||||
int32_t WifiHotspotUtils::do_wifi_hostapd_get_stations()
|
||||
{
|
||||
char addr[32], cmd[64];
|
||||
int stations = 0;
|
||||
size_t addrLen = sizeof(addr);
|
||||
|
||||
if (sendCommand(ctrl_conn, "STA-FIRST", addr, &addrLen)) {
|
||||
return 0;
|
||||
}
|
||||
stations++;
|
||||
|
||||
sprintf(cmd, "STA-NEXT %s", addr);
|
||||
while (sendCommand(ctrl_conn, cmd, addr, &addrLen) == 0) {
|
||||
stations++;
|
||||
sprintf(cmd, "STA-NEXT %s", addr);
|
||||
}
|
||||
|
||||
return stations;
|
||||
}
|
44
dom/wifi/WifiHotspotUtils.h
Normal file
44
dom/wifi/WifiHotspotUtils.h
Normal file
@ -0,0 +1,44 @@
|
||||
/* 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/. */
|
||||
|
||||
/**
|
||||
* Abstraction on top of the network support from libnetutils that we
|
||||
* use to set up network connections.
|
||||
*/
|
||||
|
||||
#ifndef WifiHotspotUtils_h
|
||||
#define WifiHotspotUtils_h
|
||||
|
||||
// Forward declaration.
|
||||
struct wpa_ctrl;
|
||||
|
||||
class WifiHotspotUtils
|
||||
{
|
||||
public:
|
||||
static void* GetSharedLibrary();
|
||||
|
||||
int32_t do_wifi_connect_to_hostapd();
|
||||
int32_t do_wifi_close_hostapd_connection();
|
||||
int32_t do_wifi_hostapd_command(const char *command,
|
||||
char *reply,
|
||||
size_t *reply_len);
|
||||
int32_t do_wifi_hostapd_get_stations();
|
||||
|
||||
private:
|
||||
struct wpa_ctrl * openConnection(const char *ifname);
|
||||
int32_t sendCommand(struct wpa_ctrl *ctrl, const char *cmd,
|
||||
char *reply, size_t *reply_len);
|
||||
};
|
||||
|
||||
// Defines a function type with the right arguments and return type.
|
||||
#define DEFINE_DLFUNC(name, ret, args...) typedef ret (*FUNC##name)(args);
|
||||
|
||||
// Set up a dlsymed function ready to use.
|
||||
#define USE_DLFUNC(name) \
|
||||
FUNC##name name = (FUNC##name) dlsym(GetSharedLibrary(), #name); \
|
||||
if (!name) { \
|
||||
MOZ_ASSUME_UNREACHABLE("Symbol not found in shared library : " #name); \
|
||||
}
|
||||
|
||||
#endif // WifiHotspotUtils_h
|
@ -381,6 +381,7 @@ WpaSupplicant::WpaSupplicant()
|
||||
mImpl = new KKWpaSupplicantImpl();
|
||||
}
|
||||
mNetUtils = new NetUtils();
|
||||
mWifiHotspotUtils = new WifiHotspotUtils();
|
||||
};
|
||||
|
||||
void WpaSupplicant::WaitForEvent(nsAString& aEvent, const nsCString& aInterface)
|
||||
@ -414,6 +415,10 @@ bool WpaSupplicant::ExecuteCommand(CommandOptions aOptions,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mWifiHotspotUtils->GetSharedLibrary()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Always correlate the opaque ids.
|
||||
aResult.mId = aOptions.mId;
|
||||
|
||||
@ -518,6 +523,51 @@ bool WpaSupplicant::ExecuteCommand(CommandOptions aOptions,
|
||||
if (inet_ntop(AF_INET, &aResult.mMask, inet_str, sizeof(inet_str))) {
|
||||
aResult.mMask_str = NS_ConvertUTF8toUTF16(inet_str);
|
||||
}
|
||||
} else if (aOptions.mCmd.EqualsLiteral("hostapd_command")) {
|
||||
size_t len = BUFFER_SIZE - 1;
|
||||
char buffer[BUFFER_SIZE];
|
||||
NS_ConvertUTF16toUTF8 request(aOptions.mRequest);
|
||||
aResult.mStatus = mWifiHotspotUtils->do_wifi_hostapd_command(request.get(),
|
||||
buffer,
|
||||
&len);
|
||||
nsString value;
|
||||
if (aResult.mStatus == 0) {
|
||||
if (buffer[len - 1] == '\n') { // remove trailing new lines.
|
||||
len--;
|
||||
}
|
||||
buffer[len] = '\0';
|
||||
CheckBuffer(buffer, len, value);
|
||||
}
|
||||
aResult.mReply = value;
|
||||
} else if (aOptions.mCmd.EqualsLiteral("hostapd_get_stations")) {
|
||||
aResult.mStatus = mWifiHotspotUtils->do_wifi_hostapd_get_stations();
|
||||
} else if (aOptions.mCmd.EqualsLiteral("connect_to_hostapd")) {
|
||||
aResult.mStatus = mWifiHotspotUtils->do_wifi_connect_to_hostapd();
|
||||
} else if (aOptions.mCmd.EqualsLiteral("close_hostapd_connection")) {
|
||||
aResult.mStatus = mWifiHotspotUtils->do_wifi_close_hostapd_connection();
|
||||
} else if (aOptions.mCmd.EqualsLiteral("hostapd_command")) {
|
||||
size_t len = BUFFER_SIZE - 1;
|
||||
char buffer[BUFFER_SIZE];
|
||||
NS_ConvertUTF16toUTF8 request(aOptions.mRequest);
|
||||
aResult.mStatus = mWifiHotspotUtils->do_wifi_hostapd_command(request.get(),
|
||||
buffer,
|
||||
&len);
|
||||
nsString value;
|
||||
if (aResult.mStatus == 0) {
|
||||
if (buffer[len - 1] == '\n') { // remove trailing new lines.
|
||||
len--;
|
||||
}
|
||||
buffer[len] = '\0';
|
||||
CheckBuffer(buffer, len, value);
|
||||
}
|
||||
aResult.mReply = value;
|
||||
} else if (aOptions.mCmd.EqualsLiteral("hostapd_get_stations")) {
|
||||
aResult.mStatus = mWifiHotspotUtils->do_wifi_hostapd_get_stations();
|
||||
} else if (aOptions.mCmd.EqualsLiteral("connect_to_hostapd")) {
|
||||
aResult.mStatus = mWifiHotspotUtils->do_wifi_connect_to_hostapd();
|
||||
} else if (aOptions.mCmd.EqualsLiteral("close_hostapd_connection")) {
|
||||
aResult.mStatus = mWifiHotspotUtils->do_wifi_close_hostapd_connection();
|
||||
|
||||
} else {
|
||||
NS_WARNING("WpaSupplicant::ExecuteCommand : Unknown command");
|
||||
printf_stderr("WpaSupplicant::ExecuteCommand : Unknown command: %s",
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "nsAutoPtr.h"
|
||||
#include "mozilla/dom/WifiOptionsBinding.h"
|
||||
#include "mozilla/dom/network/NetUtils.h"
|
||||
#include "WifiHotspotUtils.h"
|
||||
#include "nsCxPusher.h"
|
||||
|
||||
// Needed to add a copy constructor to WifiCommandOptions.
|
||||
@ -131,6 +132,7 @@ public:
|
||||
private:
|
||||
nsAutoPtr<WpaSupplicantImpl> mImpl;
|
||||
nsAutoPtr<NetUtils> mNetUtils;
|
||||
nsAutoPtr<WifiHotspotUtils> mWifiHotspotUtils;
|
||||
|
||||
protected:
|
||||
void CheckBuffer(char* buffer, int32_t length, nsAString& aEvent);
|
||||
|
@ -1059,6 +1059,19 @@ var WifiManager = (function() {
|
||||
}
|
||||
}
|
||||
|
||||
var wifiHotspotStatusTimer = null;
|
||||
function cancelWifiHotspotStatusTimer() {
|
||||
if (wifiHotspotStatusTimer) {
|
||||
wifiHotspotStatusTimer.cancel();
|
||||
wifiHotspotStatusTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
function createWifiHotspotStatusTimer(onTimeout) {
|
||||
wifiHotspotStatusTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||
wifiHotspotStatusTimer.init(onTimeout, 5000, Ci.nsITimer.TYPE_REPEATING_SLACK);
|
||||
}
|
||||
|
||||
// Get wifi interface and load wifi driver when enable Ap mode.
|
||||
manager.setWifiApEnabled = function(enabled, configuration, callback) {
|
||||
if (enabled === manager.isWifiTetheringEnabled(manager.tetheringState)) {
|
||||
@ -1072,9 +1085,20 @@ var WifiManager = (function() {
|
||||
if (status < 0) {
|
||||
callback();
|
||||
manager.tetheringState = "UNINITIALIZED";
|
||||
if (wifiHotspotStatusTimer) {
|
||||
cancelWifiHotspotStatusTimer();
|
||||
wifiCommand.closeHostapdConnection(function(result) {
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
function getWifiHotspotStatus() {
|
||||
wifiCommand.hostapdGetStations(function(result) {
|
||||
notify("stationInfoUpdate", {station: result});
|
||||
});
|
||||
}
|
||||
|
||||
function doStartWifiTethering() {
|
||||
cancelWaitForDriverReadyTimer();
|
||||
WifiNetworkInterface.name = manager.ifname;
|
||||
@ -1084,6 +1108,13 @@ var WifiManager = (function() {
|
||||
manager.tetheringState = "UNINITIALIZED";
|
||||
} else {
|
||||
manager.tetheringState = "COMPLETED";
|
||||
wifiCommand.connectToHostapd(function(result) {
|
||||
if (result) {
|
||||
return;
|
||||
}
|
||||
// Create a timer to track the connection status.
|
||||
createWifiHotspotStatusTimer(getWifiHotspotStatus);
|
||||
});
|
||||
}
|
||||
// Pop out current request.
|
||||
callback();
|
||||
@ -2282,6 +2313,10 @@ function WifiWorker() {
|
||||
});
|
||||
};
|
||||
|
||||
WifiManager.onstationInfoUpdate = function() {
|
||||
self._fireEvent("stationInfoUpdate", { station: this.station });
|
||||
};
|
||||
|
||||
// Read the 'wifi.enabled' setting in order to start with a known
|
||||
// value at boot time. The handle() will be called after reading.
|
||||
//
|
||||
|
@ -7,6 +7,7 @@
|
||||
XPIDL_SOURCES += [
|
||||
'nsIDOMMozWifiConnectionInfoEvent.idl',
|
||||
'nsIDOMMozWifiP2pStatusChangeEvent.idl',
|
||||
'nsIDOMMozWifiStationInfoEvent.idl',
|
||||
'nsIDOMMozWifiStatusChangeEvent.idl',
|
||||
'nsIWifi.idl',
|
||||
'nsIWifiCertService.idl',
|
||||
@ -35,6 +36,7 @@ EXTRA_JS_MODULES += [
|
||||
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
|
||||
SOURCES = [
|
||||
'WifiCertService.cpp',
|
||||
'WifiHotspotUtils.cpp',
|
||||
'WifiProxyService.cpp',
|
||||
'WifiUtils.cpp',
|
||||
]
|
||||
|
19
dom/wifi/nsIDOMMozWifiStationInfoEvent.idl
Normal file
19
dom/wifi/nsIDOMMozWifiStationInfoEvent.idl
Normal file
@ -0,0 +1,19 @@
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIDOMEvent.idl"
|
||||
|
||||
[scriptable, builtinclass, uuid(97dc8040-d5c9-11e3-9c1a-0800200c9a66)]
|
||||
interface nsIDOMMozWifiStationInfoEvent : nsIDOMEvent
|
||||
{
|
||||
/**
|
||||
* The number of wifi stations connected to wifi hotspot.
|
||||
*/
|
||||
readonly attribute short station;
|
||||
|
||||
[noscript] void initMozWifiStationInfoEvent(in DOMString aType,
|
||||
in boolean aCanBubble,
|
||||
in boolean aCancelable,
|
||||
in short station);
|
||||
};
|
@ -564,6 +564,7 @@ private:
|
||||
MainThreadRun() MOZ_OVERRIDE
|
||||
{
|
||||
mProxy->Teardown();
|
||||
MOZ_ASSERT(!mProxy->mSyncLoopTarget);
|
||||
return NS_OK;
|
||||
}
|
||||
};
|
||||
@ -953,6 +954,17 @@ Proxy::Teardown()
|
||||
NS_RUNTIMEABORT("We're going to hang at shutdown anyways.");
|
||||
}
|
||||
|
||||
if (mSyncLoopTarget) {
|
||||
// We have an unclosed sync loop. Fix that now.
|
||||
nsRefPtr<MainThreadStopSyncLoopRunnable> runnable =
|
||||
new MainThreadStopSyncLoopRunnable(mWorkerPrivate,
|
||||
mSyncLoopTarget.forget(),
|
||||
false);
|
||||
if (!runnable->Dispatch(nullptr)) {
|
||||
NS_RUNTIMEABORT("We're going to hang at shutdown anyways.");
|
||||
}
|
||||
}
|
||||
|
||||
mWorkerPrivate = nullptr;
|
||||
mOutstandingSendCount = 0;
|
||||
}
|
||||
@ -960,6 +972,9 @@ Proxy::Teardown()
|
||||
mXHRUpload = nullptr;
|
||||
mXHR = nullptr;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(!mWorkerPrivate);
|
||||
MOZ_ASSERT(!mSyncLoopTarget);
|
||||
}
|
||||
|
||||
bool
|
||||
@ -1106,6 +1121,7 @@ LoadStartDetectionRunnable::Run()
|
||||
mXMLHttpRequestPrivate, mChannelId);
|
||||
if (runnable->Dispatch(nullptr)) {
|
||||
mProxy->mWorkerPrivate = nullptr;
|
||||
mProxy->mSyncLoopTarget = nullptr;
|
||||
mProxy->mOutstandingSendCount--;
|
||||
}
|
||||
}
|
||||
|
9
dom/workers/test/file_bug1010784_worker.js
Normal file
9
dom/workers/test/file_bug1010784_worker.js
Normal file
@ -0,0 +1,9 @@
|
||||
onmessage = function(event) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
|
||||
xhr.open("GET", event.data, false);
|
||||
xhr.send();
|
||||
xhr.open("GET", event.data, false);
|
||||
xhr.send();
|
||||
postMessage("done");
|
||||
}
|
@ -15,6 +15,7 @@ support-files =
|
||||
errorwarning_worker.js
|
||||
eventDispatch_worker.js
|
||||
fibonacci_worker.js
|
||||
file_bug1010784_worker.js
|
||||
importScripts_worker.js
|
||||
importScripts_worker_imported1.js
|
||||
importScripts_worker_imported2.js
|
||||
@ -45,6 +46,8 @@ support-files =
|
||||
suspend_iframe.html
|
||||
suspend_worker.js
|
||||
terminate_worker.js
|
||||
terminateSyncXHR_frame.html
|
||||
terminateSyncXHR_worker.js
|
||||
testXHR.txt
|
||||
threadErrors_worker1.js
|
||||
threadErrors_worker2.js
|
||||
@ -74,6 +77,7 @@ support-files =
|
||||
[test_blobConstructor.html]
|
||||
[test_blobWorkers.html]
|
||||
[test_bug949946.html]
|
||||
[test_bug1010784.html]
|
||||
[test_chromeWorker.html]
|
||||
[test_clearTimeouts.html]
|
||||
[test_close.html]
|
||||
@ -122,6 +126,7 @@ skip-if = buildapp == 'b2g' # b2g(Failed to load script: relativeLoad_import.js)
|
||||
[test_suspend.html]
|
||||
skip-if = buildapp == 'b2g' || e10s # b2g(test timed out, might need more time) b2g-debug(test timed out, might need more time) b2g-desktop(test timed out, might need more time)
|
||||
[test_terminate.html]
|
||||
[test_terminateSyncXHR.html]
|
||||
[test_threadErrors.html]
|
||||
[test_threadTimeouts.html]
|
||||
[test_throwingOnerror.html]
|
||||
|
25
dom/workers/test/terminateSyncXHR_frame.html
Normal file
25
dom/workers/test/terminateSyncXHR_frame.html
Normal file
@ -0,0 +1,25 @@
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Test for SharedWorker</title>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
function doStuff() {
|
||||
var worker = new Worker("terminateSyncXHR_worker.js");
|
||||
|
||||
worker.onmessage = function(event) {
|
||||
parent.postMessage(event.data, "*");
|
||||
};
|
||||
|
||||
worker.onerror = function(event) {
|
||||
parent.postMessage("ERROR!", "*");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
19
dom/workers/test/terminateSyncXHR_worker.js
Normal file
19
dom/workers/test/terminateSyncXHR_worker.js
Normal file
@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
onmessage = function(event) {
|
||||
throw "No messages should reach me!";
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "testXHR.txt", false);
|
||||
xhr.addEventListener("loadstart", function ()
|
||||
{
|
||||
// Tell the parent to terminate us.
|
||||
postMessage("TERMINATE");
|
||||
// And wait for it to do so.
|
||||
while(1) { true; }
|
||||
});
|
||||
xhr.send(null);
|
35
dom/workers/test/test_bug1010784.html
Normal file
35
dom/workers/test/test_bug1010784.html
Normal file
@ -0,0 +1,35 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1010784
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1010784</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1010784">Mozilla Bug 1010784</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
var worker = new Worker("file_bug1010784_worker.js");
|
||||
|
||||
worker.onmessage = function(event) {
|
||||
is(event.data, "done", "Got correct result");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
worker.postMessage("testXHR.txt");
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
45
dom/workers/test/test_terminateSyncXHR.html
Normal file
45
dom/workers/test/test_terminateSyncXHR.html
Normal file
@ -0,0 +1,45 @@
|
||||
<!--
|
||||
Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/
|
||||
-->
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
Tests of DOM Worker Threads XHR(Bug 450452 )
|
||||
-->
|
||||
<head>
|
||||
<title>Test for DOM Worker Threads XHR (Bug 450452 )</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=450452">DOM Worker Threads XHR (Bug 450452)</a>
|
||||
<p id="display"></p>
|
||||
<div id="content">
|
||||
<iframe id="iframe" src="terminateSyncXHR_frame.html"></iframe>
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
var ifr = document.getElementById("iframe");
|
||||
|
||||
window.onmessage = function(event) {
|
||||
if (event.data == "TERMINATE") {
|
||||
ok(true, "Got TERMINATE");
|
||||
ifr.parentNode.removeChild(ifr);
|
||||
SimpleTest.finish();
|
||||
} else {
|
||||
ok(false, "Unexpected message: " + event.data);
|
||||
}
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
window.onload = function() {
|
||||
ifr.contentWindow.doStuff();
|
||||
}
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,52 +0,0 @@
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef GFX_TRANSACTION_ID_ALLOCATOR_H
|
||||
#define GFX_TRANSACTION_ID_ALLOCATOR_H
|
||||
|
||||
#include "nsISupportsImpl.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace layers {
|
||||
|
||||
class TransactionIdAllocator {
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(TransactionIdAllocator)
|
||||
|
||||
virtual ~TransactionIdAllocator() {}
|
||||
|
||||
/**
|
||||
* Allocate a unique id number for the current refresh tick, can
|
||||
* only be called while IsInRefresh().
|
||||
*
|
||||
* If too many id's are allocated without being returned then
|
||||
* the refresh driver will suspend until they catch up.
|
||||
*/
|
||||
virtual uint64_t GetTransactionId() = 0;
|
||||
|
||||
/**
|
||||
* Notify that all work (including asynchronous composites)
|
||||
* for a given transaction id has been completed.
|
||||
*
|
||||
* If the refresh driver has been suspended because
|
||||
* of having too many outstanding id's, then this may
|
||||
* resume it.
|
||||
*/
|
||||
virtual void NotifyTransactionCompleted(uint64_t aTransactionId) = 0;
|
||||
|
||||
/**
|
||||
* Revoke a transaction id that isn't needed to track
|
||||
* completion of asynchronous work. This is similar
|
||||
* to NotifyTransactionCompleted except avoids
|
||||
* return ordering issues.
|
||||
*/
|
||||
virtual void RevokeTransactionId(uint64_t aTransactionId) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif /* GFX_TRANSACTION_ID_ALLOCATOR_H */
|
@ -40,7 +40,6 @@ using namespace mozilla::gfx;
|
||||
ClientLayerManager::ClientLayerManager(nsIWidget* aWidget)
|
||||
: mPhase(PHASE_NONE)
|
||||
, mWidget(aWidget)
|
||||
, mLatestTransactionId(0)
|
||||
, mTargetRotation(ROTATION_0)
|
||||
, mRepeatTransaction(false)
|
||||
, mIsRepeatTransaction(false)
|
||||
@ -55,9 +54,6 @@ ClientLayerManager::ClientLayerManager(nsIWidget* aWidget)
|
||||
|
||||
ClientLayerManager::~ClientLayerManager()
|
||||
{
|
||||
if (mTransactionIdAllocator) {
|
||||
DidComposite(mLatestTransactionId);
|
||||
}
|
||||
ClearCachedResources();
|
||||
// Stop receiveing AsyncParentMessage at Forwarder.
|
||||
// After the call, the message is directly handled by LayerTransactionChild.
|
||||
@ -289,7 +285,7 @@ ClientLayerManager::Composite()
|
||||
}
|
||||
|
||||
void
|
||||
ClientLayerManager::DidComposite(uint64_t aTransactionId)
|
||||
ClientLayerManager::DidComposite()
|
||||
{
|
||||
MOZ_ASSERT(mWidget);
|
||||
nsIWidgetListener *listener = mWidget->GetWidgetListener();
|
||||
@ -300,7 +296,6 @@ ClientLayerManager::DidComposite(uint64_t aTransactionId)
|
||||
if (listener) {
|
||||
listener->DidCompositeWindow();
|
||||
}
|
||||
mTransactionIdAllocator->NotifyTransactionCompleted(aTransactionId);
|
||||
}
|
||||
|
||||
void
|
||||
@ -426,13 +421,11 @@ ClientLayerManager::ForwardTransaction(bool aScheduleComposite)
|
||||
{
|
||||
mPhase = PHASE_FORWARD;
|
||||
|
||||
mLatestTransactionId = mTransactionIdAllocator->GetTransactionId();
|
||||
|
||||
// forward this transaction's changeset to our LayerManagerComposite
|
||||
bool sent;
|
||||
AutoInfallibleTArray<EditReply, 10> replies;
|
||||
if (HasShadowManager() && mForwarder->EndTransaction(&replies, mRegionToClear,
|
||||
mLatestTransactionId, aScheduleComposite, mPaintSequenceNumber, &sent)) {
|
||||
aScheduleComposite, mPaintSequenceNumber, &sent)) {
|
||||
for (nsTArray<EditReply>::size_type i = 0; i < replies.Length(); ++i) {
|
||||
const EditReply& reply = replies[i];
|
||||
|
||||
@ -486,12 +479,6 @@ ClientLayerManager::ForwardTransaction(bool aScheduleComposite)
|
||||
if (sent) {
|
||||
mNeedsComposite = false;
|
||||
}
|
||||
if (!sent || mForwarder->GetShadowManager()->HasNoCompositor()) {
|
||||
// Clear the transaction id so that it doesn't get returned
|
||||
// unless we forwarded to somewhere that doesn't actually
|
||||
// have a compositor.
|
||||
mTransactionIdAllocator->RevokeTransactionId(mLatestTransactionId);
|
||||
}
|
||||
} else if (HasShadowManager()) {
|
||||
NS_WARNING("failed to forward Layers transaction");
|
||||
}
|
||||
|
@ -24,7 +24,6 @@
|
||||
#include "nsRect.h" // for nsIntRect
|
||||
#include "nsTArray.h" // for nsTArray
|
||||
#include "nscore.h" // for nsAString
|
||||
#include "mozilla/layers/TransactionIdAllocator.h"
|
||||
|
||||
class nsIWidget;
|
||||
|
||||
@ -167,7 +166,7 @@ public:
|
||||
virtual bool RequestOverfill(mozilla::dom::OverfillCallback* aCallback) MOZ_OVERRIDE;
|
||||
virtual void RunOverfillCallback(const uint32_t aOverfill) MOZ_OVERRIDE;
|
||||
|
||||
virtual void DidComposite(uint64_t aTransactionId);
|
||||
virtual void DidComposite();
|
||||
|
||||
virtual bool SupportsMixBlendModes(EnumSet<gfx::CompositionOp>& aMixBlendModes) MOZ_OVERRIDE
|
||||
{
|
||||
@ -208,8 +207,6 @@ public:
|
||||
// Get a copy of the compositor-side APZ test data for our layers ID.
|
||||
void GetCompositorSideAPZTestData(APZTestData* aData) const;
|
||||
|
||||
void SetTransactionIdAllocator(TransactionIdAllocator* aAllocator) { mTransactionIdAllocator = aAllocator; }
|
||||
|
||||
protected:
|
||||
enum TransactionPhase {
|
||||
PHASE_NONE, PHASE_CONSTRUCTION, PHASE_DRAWING, PHASE_FORWARD
|
||||
@ -256,9 +253,6 @@ private:
|
||||
// back to mShadowTarget.
|
||||
nsRefPtr<gfxContext> mShadowTarget;
|
||||
|
||||
nsRefPtr<TransactionIdAllocator> mTransactionIdAllocator;
|
||||
uint64_t mLatestTransactionId;
|
||||
|
||||
// Sometimes we draw to targets that don't natively support
|
||||
// landscape/portrait orientation. When we need to implement that
|
||||
// ourselves, |mTargetRotation| describes the induced transform we
|
||||
|
@ -124,15 +124,15 @@ CompositorChild::RecvInvalidateAll()
|
||||
}
|
||||
|
||||
bool
|
||||
CompositorChild::RecvDidComposite(const uint64_t& aId, const uint64_t& aTransactionId)
|
||||
CompositorChild::RecvDidComposite(const uint64_t& aId)
|
||||
{
|
||||
if (mLayerManager) {
|
||||
MOZ_ASSERT(aId == 0);
|
||||
mLayerManager->DidComposite(aTransactionId);
|
||||
mLayerManager->DidComposite();
|
||||
} else if (aId != 0) {
|
||||
dom::TabChild *child = dom::TabChild::GetFrom(aId);
|
||||
if (child) {
|
||||
child->DidComposite(aTransactionId);
|
||||
child->DidComposite();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
virtual bool RecvOverfill(const uint32_t &aOverfill) MOZ_OVERRIDE;
|
||||
void AddOverfillObserver(ClientLayerManager* aLayerManager);
|
||||
|
||||
virtual bool RecvDidComposite(const uint64_t& aId, const uint64_t& aTransactionId) MOZ_OVERRIDE;
|
||||
virtual bool RecvDidComposite(const uint64_t& aId) MOZ_OVERRIDE;
|
||||
|
||||
private:
|
||||
// Private destructor, to discourage deletion outside of Release():
|
||||
|
@ -66,7 +66,6 @@ CompositorParent::LayerTreeState::LayerTreeState()
|
||||
: mParent(nullptr)
|
||||
, mLayerManager(nullptr)
|
||||
, mCrossProcessParent(nullptr)
|
||||
, mLayerTree(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@ -194,7 +193,6 @@ CompositorParent::CompositorParent(nsIWidget* aWidget,
|
||||
: mWidget(aWidget)
|
||||
, mCurrentCompositeTask(nullptr)
|
||||
, mIsTesting(false)
|
||||
, mPendingTransaction(0)
|
||||
, mPaused(false)
|
||||
, mUseExternalSurfaceSize(aUseExternalSurfaceSize)
|
||||
, mEGLSurfaceSize(aSurfaceWidth, aSurfaceHeight)
|
||||
@ -202,6 +200,7 @@ CompositorParent::CompositorParent(nsIWidget* aWidget,
|
||||
, mResumeCompositionMonitor("ResumeCompositionMonitor")
|
||||
, mOverrideComposeReadiness(false)
|
||||
, mForceCompositionTask(nullptr)
|
||||
, mWantDidCompositeEvent(false)
|
||||
{
|
||||
NS_ABORT_IF_FALSE(sCompositorThread != nullptr || sCompositorThreadID,
|
||||
"The compositor thread must be Initialized before instanciating a COmpositorParent.");
|
||||
@ -418,7 +417,6 @@ CompositorParent::PauseComposition()
|
||||
mPaused = true;
|
||||
|
||||
mCompositor->Pause();
|
||||
DidComposite();
|
||||
}
|
||||
|
||||
// if anyone's waiting to make sure that composition really got paused, tell them
|
||||
@ -445,7 +443,7 @@ CompositorParent::ResumeComposition()
|
||||
|
||||
mPaused = false;
|
||||
|
||||
CompositeToTarget(nullptr);
|
||||
Composite();
|
||||
|
||||
// if anyone's waiting to make sure that composition really got resumed, tell them
|
||||
lock.NotifyAll();
|
||||
@ -543,6 +541,8 @@ CompositorParent::NotifyShadowTreeTransaction(uint64_t aId, bool aIsFirstPaint,
|
||||
if (aScheduleComposite) {
|
||||
ScheduleComposition();
|
||||
}
|
||||
|
||||
mWantDidCompositeEvent = true;
|
||||
}
|
||||
|
||||
// Used when layout.frame_rate is -1. Needs to be kept in sync with
|
||||
@ -585,7 +585,7 @@ CompositorParent::ScheduleComposition()
|
||||
rate == 0 ? 0.0 : std::max(0.0, 1000.0 / rate));
|
||||
|
||||
|
||||
mCurrentCompositeTask = NewRunnableMethod(this, &CompositorParent::CompositeCallback);
|
||||
mCurrentCompositeTask = NewRunnableMethod(this, &CompositorParent::Composite);
|
||||
|
||||
if (!initialComposition && delta < minFrameDelta) {
|
||||
TimeDuration delay = minFrameDelta - delta;
|
||||
@ -602,9 +602,8 @@ CompositorParent::ScheduleComposition()
|
||||
}
|
||||
|
||||
void
|
||||
CompositorParent::CompositeCallback()
|
||||
CompositorParent::Composite()
|
||||
{
|
||||
mCurrentCompositeTask = nullptr;
|
||||
CompositeToTarget(nullptr);
|
||||
}
|
||||
|
||||
@ -625,10 +624,14 @@ CompositorParent::CompositeToTarget(DrawTarget* aTarget, const nsIntRect* aRect)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (mCurrentCompositeTask) {
|
||||
mCurrentCompositeTask->Cancel();
|
||||
mCurrentCompositeTask = nullptr;
|
||||
}
|
||||
|
||||
mLastCompose = TimeStamp::Now();
|
||||
|
||||
if (!CanComposite()) {
|
||||
DidComposite();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -669,8 +672,9 @@ CompositorParent::CompositeToTarget(DrawTarget* aTarget, const nsIntRect* aRect)
|
||||
mLayerManager->SetDebugOverlayWantsNextFrame(false);
|
||||
mLayerManager->EndEmptyTransaction();
|
||||
|
||||
if (!aTarget) {
|
||||
if (!aTarget && mWantDidCompositeEvent) {
|
||||
DidComposite();
|
||||
mWantDidCompositeEvent = false;
|
||||
}
|
||||
|
||||
if (mLayerManager->DebugOverlayWantsNextFrame()) {
|
||||
@ -700,6 +704,20 @@ CompositorParent::CompositeToTarget(DrawTarget* aTarget, const nsIntRect* aRect)
|
||||
profiler_tracing("Paint", "Composite", TRACING_INTERVAL_END);
|
||||
}
|
||||
|
||||
void
|
||||
CompositorParent::DidComposite()
|
||||
{
|
||||
unused << SendDidComposite(0);
|
||||
|
||||
for (LayerTreeMap::iterator it = sIndirectLayerTrees.begin();
|
||||
it != sIndirectLayerTrees.end(); it++) {
|
||||
LayerTreeState* lts = &it->second;
|
||||
if (lts->mParent == this && lts->mCrossProcessParent) {
|
||||
unused << lts->mCrossProcessParent->SendDidComposite(it->first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
CompositorParent::ForceComposeToTarget(DrawTarget* aTarget, const nsIntRect* aRect)
|
||||
{
|
||||
@ -755,7 +773,6 @@ CompositorParent::ScheduleRotationOnCompositorThread(const TargetConfig& aTarget
|
||||
|
||||
void
|
||||
CompositorParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& aTargetConfig,
|
||||
bool aIsFirstPaint,
|
||||
bool aScheduleComposite,
|
||||
@ -779,17 +796,11 @@ CompositorParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
||||
mRootLayerTreeID, aPaintSequenceNumber);
|
||||
}
|
||||
|
||||
MOZ_ASSERT(aTransactionId > mPendingTransaction);
|
||||
mPendingTransaction = aTransactionId;
|
||||
|
||||
if (root) {
|
||||
SetShadowProperties(root);
|
||||
}
|
||||
if (aScheduleComposite) {
|
||||
ScheduleComposition();
|
||||
if (mPaused) {
|
||||
DidComposite();
|
||||
}
|
||||
// When testing we synchronously update the shadow tree with the animated
|
||||
// values to avoid race conditions when calling GetAnimationTransform etc.
|
||||
// (since the above SetShadowProperties will remove animation effects).
|
||||
@ -802,12 +813,11 @@ CompositorParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
||||
mCompositionManager->TransformShadowTree(mTestTime);
|
||||
if (!requestNextFrame) {
|
||||
CancelCurrentCompositeTask();
|
||||
// Pretend we composited in case someone is wating for this event.
|
||||
DidComposite();
|
||||
}
|
||||
}
|
||||
}
|
||||
mLayerManager->NotifyShadowTreeTransaction();
|
||||
mWantDidCompositeEvent = true;
|
||||
}
|
||||
|
||||
void
|
||||
@ -833,8 +843,6 @@ CompositorParent::SetTestSampleTime(LayerTransactionParent* aLayerTree,
|
||||
bool requestNextFrame = mCompositionManager->TransformShadowTree(aTime);
|
||||
if (!requestNextFrame) {
|
||||
CancelCurrentCompositeTask();
|
||||
// Pretend we composited in case someone is wating for this event.
|
||||
DidComposite();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1143,7 +1151,6 @@ public:
|
||||
virtual bool DeallocPLayerTransactionParent(PLayerTransactionParent* aLayers) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& aTargetConfig,
|
||||
bool aIsFirstPaint,
|
||||
bool aScheduleComposite,
|
||||
@ -1157,7 +1164,6 @@ public:
|
||||
|
||||
virtual AsyncCompositionManager* GetCompositionManager(LayerTransactionParent* aParent) MOZ_OVERRIDE;
|
||||
|
||||
void DidComposite(uint64_t aId);
|
||||
private:
|
||||
// Private destructor, to discourage deletion outside of Release():
|
||||
virtual ~CrossProcessCompositorParent();
|
||||
@ -1173,23 +1179,6 @@ private:
|
||||
base::ProcessId mChildProcessId;
|
||||
};
|
||||
|
||||
void
|
||||
CompositorParent::DidComposite()
|
||||
{
|
||||
if (mPendingTransaction) {
|
||||
unused << SendDidComposite(0, mPendingTransaction);
|
||||
mPendingTransaction = 0;
|
||||
}
|
||||
|
||||
for (LayerTreeMap::iterator it = sIndirectLayerTrees.begin();
|
||||
it != sIndirectLayerTrees.end(); it++) {
|
||||
LayerTreeState* lts = &it->second;
|
||||
if (lts->mParent == this && lts->mCrossProcessParent) {
|
||||
static_cast<CrossProcessCompositorParent*>(lts->mCrossProcessParent)->DidComposite(it->first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
OpenCompositor(CrossProcessCompositorParent* aCompositor,
|
||||
Transport* aTransport, ProcessHandle aHandle,
|
||||
@ -1291,7 +1280,6 @@ CrossProcessCompositorParent::AllocPLayerTransactionParent(const nsTArray<Layers
|
||||
*aSuccess = true;
|
||||
LayerTransactionParent* p = new LayerTransactionParent(lm, this, aId, mChildProcessId);
|
||||
p->AddIPDLReference();
|
||||
sIndirectLayerTrees[aId].mLayerTree = p;
|
||||
return p;
|
||||
}
|
||||
|
||||
@ -1329,7 +1317,6 @@ CrossProcessCompositorParent::RecvNotifyChildCreated(const uint64_t& child)
|
||||
void
|
||||
CrossProcessCompositorParent::ShadowLayersUpdated(
|
||||
LayerTransactionParent* aLayerTree,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& aTargetConfig,
|
||||
bool aIsFirstPaint,
|
||||
bool aScheduleComposite,
|
||||
@ -1354,17 +1341,6 @@ CrossProcessCompositorParent::ShadowLayersUpdated(
|
||||
|
||||
state->mParent->NotifyShadowTreeTransaction(id, aIsFirstPaint, aScheduleComposite,
|
||||
aPaintSequenceNumber);
|
||||
aLayerTree->SetPendingTransactionId(aTransactionId);
|
||||
}
|
||||
|
||||
void
|
||||
CrossProcessCompositorParent::DidComposite(uint64_t aId)
|
||||
{
|
||||
LayerTransactionParent *layerTree = sIndirectLayerTrees[aId].mLayerTree;
|
||||
if (layerTree && layerTree->GetPendingTransactionId()) {
|
||||
unused << SendDidComposite(aId, layerTree->GetPendingTransactionId());
|
||||
layerTree->SetPendingTransactionId(0);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -96,7 +96,6 @@ public:
|
||||
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
||||
|
||||
virtual void ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& aTargetConfig,
|
||||
bool aIsFirstPaint,
|
||||
bool aScheduleComposite,
|
||||
@ -227,7 +226,6 @@ public:
|
||||
PCompositorParent* mCrossProcessParent;
|
||||
TargetConfig mTargetConfig;
|
||||
APZTestData mApzTestData;
|
||||
LayerTransactionParent* mLayerTree;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -255,7 +253,7 @@ private:
|
||||
bool* aSuccess) MOZ_OVERRIDE;
|
||||
virtual bool DeallocPLayerTransactionParent(PLayerTransactionParent* aLayers) MOZ_OVERRIDE;
|
||||
virtual void ScheduleTask(CancelableTask*, int);
|
||||
void CompositeCallback();
|
||||
void Composite();
|
||||
void CompositeToTarget(gfx::DrawTarget* aTarget, const nsIntRect* aRect = nullptr);
|
||||
void ForceComposeToTarget(gfx::DrawTarget* aTarget, const nsIntRect* aRect = nullptr);
|
||||
|
||||
@ -329,8 +327,6 @@ private:
|
||||
TimeStamp mExpectedComposeStartTime;
|
||||
#endif
|
||||
|
||||
uint64_t mPendingTransaction;
|
||||
|
||||
bool mPaused;
|
||||
|
||||
bool mUseExternalSurfaceSize;
|
||||
@ -347,6 +343,8 @@ private:
|
||||
|
||||
nsRefPtr<APZCTreeManager> mApzcTreeManager;
|
||||
|
||||
bool mWantDidCompositeEvent;
|
||||
|
||||
DISALLOW_EVIL_CONSTRUCTORS(CompositorParent);
|
||||
};
|
||||
|
||||
|
@ -39,9 +39,6 @@ public:
|
||||
|
||||
bool IPCOpen() const { return mIPCOpen; }
|
||||
|
||||
void SetHasNoCompositor() { mHasNoCompositor = true; }
|
||||
bool HasNoCompositor() { return mHasNoCompositor; }
|
||||
|
||||
void SetForwarder(ShadowLayerForwarder* aForwarder)
|
||||
{
|
||||
mForwarder = aForwarder;
|
||||
@ -49,10 +46,9 @@ public:
|
||||
|
||||
protected:
|
||||
LayerTransactionChild()
|
||||
: mForwarder(nullptr)
|
||||
, mIPCOpen(false)
|
||||
: mIPCOpen(false)
|
||||
, mDestroyed(false)
|
||||
, mHasNoCompositor(false)
|
||||
, mForwarder(nullptr)
|
||||
{}
|
||||
~LayerTransactionChild() { }
|
||||
|
||||
@ -84,10 +80,9 @@ protected:
|
||||
friend class CompositorChild;
|
||||
friend class layout::RenderFrameChild;
|
||||
|
||||
ShadowLayerForwarder* mForwarder;
|
||||
bool mIPCOpen;
|
||||
bool mDestroyed;
|
||||
bool mHasNoCompositor;
|
||||
ShadowLayerForwarder* mForwarder;
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
|
@ -148,7 +148,6 @@ LayerTransactionParent::LayerTransactionParent(LayerManagerComposite* aManager,
|
||||
: mLayerManager(aManager)
|
||||
, mShadowLayersManager(aLayersManager)
|
||||
, mId(aId)
|
||||
, mPendingTransaction(0)
|
||||
, mChildProcessId(aOtherProcess)
|
||||
, mDestroyed(false)
|
||||
, mIPCOpen(false)
|
||||
@ -180,19 +179,17 @@ LayerTransactionParent::GetCompositorBackendType() const
|
||||
|
||||
bool
|
||||
LayerTransactionParent::RecvUpdateNoSwap(const InfallibleTArray<Edit>& cset,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& targetConfig,
|
||||
const bool& isFirstPaint,
|
||||
const bool& scheduleComposite,
|
||||
const uint32_t& paintSequenceNumber)
|
||||
{
|
||||
return RecvUpdate(cset, aTransactionId, targetConfig, isFirstPaint,
|
||||
scheduleComposite, paintSequenceNumber, nullptr);
|
||||
return RecvUpdate(cset, targetConfig, isFirstPaint, scheduleComposite,
|
||||
paintSequenceNumber, nullptr);
|
||||
}
|
||||
|
||||
bool
|
||||
LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& targetConfig,
|
||||
const bool& isFirstPaint,
|
||||
const bool& scheduleComposite,
|
||||
@ -552,8 +549,8 @@ LayerTransactionParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
|
||||
// other's buffer contents.
|
||||
LayerManagerComposite::PlatformSyncBeforeReplyUpdate();
|
||||
|
||||
mShadowLayersManager->ShadowLayersUpdated(this, aTransactionId, targetConfig,
|
||||
isFirstPaint, scheduleComposite, paintSequenceNumber);
|
||||
mShadowLayersManager->ShadowLayersUpdated(this, targetConfig, isFirstPaint,
|
||||
scheduleComposite, paintSequenceNumber);
|
||||
|
||||
#ifdef COMPOSITOR_PERFORMANCE_WARNING
|
||||
int compositeTime = (int)(mozilla::TimeStamp::Now() - updateStart).ToMilliseconds();
|
||||
|
@ -81,9 +81,6 @@ public:
|
||||
|
||||
virtual bool IsSameProcess() const MOZ_OVERRIDE;
|
||||
|
||||
const uint64_t& GetPendingTransactionId() { return mPendingTransaction; }
|
||||
void SetPendingTransactionId(uint64_t aId) { mPendingTransaction = aId; }
|
||||
|
||||
// CompositableParentManager
|
||||
virtual void SendFenceHandle(AsyncTransactionTracker* aTracker,
|
||||
PTextureParent* aTexture,
|
||||
@ -98,7 +95,6 @@ public:
|
||||
|
||||
protected:
|
||||
virtual bool RecvUpdate(const EditArray& cset,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& targetConfig,
|
||||
const bool& isFirstPaint,
|
||||
const bool& scheduleComposite,
|
||||
@ -106,7 +102,6 @@ protected:
|
||||
EditReplyArray* reply) MOZ_OVERRIDE;
|
||||
|
||||
virtual bool RecvUpdateNoSwap(const EditArray& cset,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& targetConfig,
|
||||
const bool& isFirstPaint,
|
||||
const bool& scheduleComposite,
|
||||
@ -169,8 +164,6 @@ private:
|
||||
// mId != 0 => mRoot == null
|
||||
// because the "real tree" is owned by the compositor.
|
||||
uint64_t mId;
|
||||
|
||||
uint64_t mPendingTransaction;
|
||||
// When the widget/frame/browser stuff in this process begins its
|
||||
// destruction process, we need to Disconnect() all the currently
|
||||
// live shadow layers, because some of them might be orphaned from
|
||||
|
@ -42,7 +42,7 @@ child:
|
||||
// The compositor completed a layers transaction. id is the layers id
|
||||
// of the child layer tree that was composited (or 0 when notifying
|
||||
// the root layer tree).
|
||||
async DidComposite(uint64_t id, uint64_t transactionId);
|
||||
async DidComposite(uint64_t id);
|
||||
|
||||
// The parent sends the child the requested fill ratio numbers.
|
||||
async Overfill(uint32_t aOverfill);
|
||||
|
@ -52,14 +52,9 @@ parent:
|
||||
|
||||
// The isFirstPaint flag can be used to indicate that this is the first update
|
||||
// for a particular document.
|
||||
sync Update(Edit[] cset, uint64_t id, TargetConfig targetConfig, bool isFirstPaint,
|
||||
sync Update(Edit[] cset, TargetConfig targetConfig, bool isFirstPaint,
|
||||
bool scheduleComposite, uint32_t paintSequenceNumber)
|
||||
returns (EditReply[] reply);
|
||||
|
||||
// We don't need to send a sync transaction if
|
||||
// no transaction operate require a swap.
|
||||
async UpdateNoSwap(Edit[] cset, uint64_t id, TargetConfig targetConfig, bool isFirstPaint,
|
||||
bool scheduleComposite, uint32_t paintSequenceNumber);
|
||||
|
||||
// Testing APIs
|
||||
|
||||
@ -83,6 +78,11 @@ parent:
|
||||
// Useful for testing rendering of async scrolling.
|
||||
async SetAsyncScrollOffset(PLayer layer, int32_t x, int32_t y);
|
||||
|
||||
// We don't need to send a sync transaction if
|
||||
// no transaction operate require a swap.
|
||||
async UpdateNoSwap(Edit[] cset, TargetConfig targetConfig, bool isFirstPaint,
|
||||
bool scheduleComposite, uint32_t paintSequenceNumber);
|
||||
|
||||
// Drop any front buffers that might be retained on the compositor
|
||||
// side.
|
||||
async ClearCachedResources();
|
||||
|
@ -451,15 +451,12 @@ ShadowLayerForwarder::RemoveTexture(TextureClient* aTexture)
|
||||
bool
|
||||
ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies,
|
||||
const nsIntRegion& aRegionToClear,
|
||||
uint64_t aId,
|
||||
bool aScheduleComposite,
|
||||
uint32_t aPaintSequenceNumber,
|
||||
bool* aSent)
|
||||
{
|
||||
*aSent = false;
|
||||
|
||||
MOZ_ASSERT(aId);
|
||||
|
||||
PROFILER_LABEL("ShadowLayerForwarder", "EndTranscation");
|
||||
RenderTraceScope rendertrace("Foward Transaction", "000091");
|
||||
NS_ABORT_IF_FALSE(HasShadowManager(), "no manager to forward to");
|
||||
@ -565,7 +562,7 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies,
|
||||
RenderTraceScope rendertrace3("Forward Transaction", "000093");
|
||||
if (!HasShadowManager() ||
|
||||
!mShadowManager->IPCOpen() ||
|
||||
!mShadowManager->SendUpdate(cset, aId, targetConfig, mIsFirstPaint,
|
||||
!mShadowManager->SendUpdate(cset, targetConfig, mIsFirstPaint,
|
||||
aScheduleComposite, aPaintSequenceNumber,
|
||||
aReplies)) {
|
||||
MOZ_LAYERS_LOG(("[LayersForwarder] WARNING: sending transaction failed!"));
|
||||
@ -578,7 +575,7 @@ ShadowLayerForwarder::EndTransaction(InfallibleTArray<EditReply>* aReplies,
|
||||
RenderTraceScope rendertrace3("Forward NoSwap Transaction", "000093");
|
||||
if (!HasShadowManager() ||
|
||||
!mShadowManager->IPCOpen() ||
|
||||
!mShadowManager->SendUpdateNoSwap(cset, aId, targetConfig, mIsFirstPaint,
|
||||
!mShadowManager->SendUpdateNoSwap(cset, targetConfig, mIsFirstPaint,
|
||||
aPaintSequenceNumber, aScheduleComposite)) {
|
||||
MOZ_LAYERS_LOG(("[LayersForwarder] WARNING: sending transaction failed!"));
|
||||
return false;
|
||||
|
@ -295,7 +295,6 @@ public:
|
||||
*/
|
||||
bool EndTransaction(InfallibleTArray<EditReply>* aReplies,
|
||||
const nsIntRegion& aRegionToClear,
|
||||
uint64_t aId,
|
||||
bool aScheduleComposite,
|
||||
uint32_t aPaintSequenceNumber,
|
||||
bool* aSent);
|
||||
|
@ -19,7 +19,6 @@ class ShadowLayersManager
|
||||
{
|
||||
public:
|
||||
virtual void ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& aTargetConfig,
|
||||
bool aIsFirstPaint,
|
||||
bool aScheduleComposite,
|
||||
|
@ -163,7 +163,6 @@ EXPORTS.mozilla.layers += [
|
||||
'opengl/TextureClientOGL.h',
|
||||
'opengl/TextureHostOGL.h',
|
||||
'RenderTrace.h',
|
||||
'TransactionIdAllocator.h',
|
||||
'YCbCrImageDataSerializer.h',
|
||||
]
|
||||
|
||||
|
@ -217,6 +217,9 @@ class CxxCodeGen(CodePrinter, Visitor):
|
||||
|
||||
|
||||
def visitMethodDefn(self, md):
|
||||
if md.decl.pure:
|
||||
return
|
||||
|
||||
self.printdent()
|
||||
md.decl.accept(self)
|
||||
self.println()
|
||||
|
@ -5460,7 +5460,6 @@ def _splitMethodDefn(md, clsname):
|
||||
md.decl.static = 0
|
||||
md.decl.warn_unused = 0
|
||||
md.decl.never_inline = 0
|
||||
md.decl.pure = 0
|
||||
md.decl.only_for_definition = True
|
||||
for param in md.decl.params:
|
||||
if isinstance(param, Param):
|
||||
|
@ -26,6 +26,7 @@ simple_events = [
|
||||
'MozWifiP2pStatusChangeEvent',
|
||||
'MozWifiStatusChangeEvent',
|
||||
'MozWifiConnectionInfoEvent',
|
||||
'MozWifiStationInfoEvent',
|
||||
#endif
|
||||
#ifdef MOZ_B2G_RIL
|
||||
'MozCellBroadcastEvent',
|
||||
|
@ -62,7 +62,6 @@ using namespace mozilla;
|
||||
using namespace mozilla::css;
|
||||
using namespace mozilla::layers;
|
||||
using namespace mozilla::dom;
|
||||
using namespace mozilla::layout;
|
||||
typedef FrameMetrics::ViewID ViewID;
|
||||
|
||||
static inline nsIFrame*
|
||||
@ -1366,8 +1365,6 @@ void nsDisplayList::PaintForFrame(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
}
|
||||
|
||||
MaybeSetupTransactionIdAllocator(layerManager, view);
|
||||
|
||||
layerManager->EndTransaction(FrameLayerBuilder::DrawThebesLayer,
|
||||
aBuilder, flags);
|
||||
aBuilder->SetIsCompositingCheap(temp);
|
||||
|
@ -20,7 +20,6 @@
|
||||
#include "nsCSSAnonBoxes.h"
|
||||
#include "nsCSSColorUtils.h"
|
||||
#include "nsView.h"
|
||||
#include "nsViewManager.h"
|
||||
#include "nsPlaceholderFrame.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "nsIDOMEvent.h"
|
||||
@ -79,7 +78,6 @@
|
||||
#include "UnitTransforms.h"
|
||||
#include "TiledLayerBuffer.h" // For TILEDLAYERBUFFER_TILE_SIZE
|
||||
#include "ClientLayerManager.h"
|
||||
#include "nsRefreshDriver.h"
|
||||
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
@ -6637,19 +6635,3 @@ AutoMaybeDisableFontInflation::~AutoMaybeDisableFontInflation()
|
||||
mPresContext->mInflationDisabledForShrinkWrap = mOldValue;
|
||||
}
|
||||
}
|
||||
|
||||
namespace mozilla {
|
||||
namespace layout {
|
||||
|
||||
void
|
||||
MaybeSetupTransactionIdAllocator(layers::LayerManager* aManager, nsView* aView)
|
||||
{
|
||||
if (aManager->GetBackendType() == layers::LayersBackend::LAYERS_CLIENT) {
|
||||
layers::ClientLayerManager *manager = static_cast<layers::ClientLayerManager*>(aManager);
|
||||
nsRefreshDriver *refresh = aView->GetViewManager()->GetPresShell()->GetPresContext()->RefreshDriver();
|
||||
manager->SetTransactionIdAllocator(refresh);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -74,7 +74,6 @@ class HTMLVideoElement;
|
||||
} // namespace dom
|
||||
namespace layers {
|
||||
class Layer;
|
||||
class ClientLayerManager;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2296,8 +2295,6 @@ namespace mozilla {
|
||||
bool mOldValue;
|
||||
};
|
||||
|
||||
void MaybeSetupTransactionIdAllocator(layers::LayerManager* aManager, nsView* aView);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,7 +189,6 @@ using namespace mozilla::dom;
|
||||
using namespace mozilla::gfx;
|
||||
using namespace mozilla::layers;
|
||||
using namespace mozilla::gfx;
|
||||
using namespace mozilla::layout;
|
||||
|
||||
CapturingContentInfo nsIPresShell::gCaptureInfo =
|
||||
{ false /* mAllowed */, false /* mPointerLock */, false /* mRetargetToElement */,
|
||||
@ -4038,15 +4037,12 @@ PresShell::FlushPendingNotifications(mozilla::ChangesToFlush aFlush)
|
||||
}
|
||||
|
||||
if (aFlush.mFlushAnimations &&
|
||||
nsLayoutUtils::AreAsyncAnimationsEnabled() &&
|
||||
!mPresContext->StyleUpdateForAllAnimationsIsUpToDate()) {
|
||||
if (mPresContext->AnimationManager()) {
|
||||
mPresContext->AnimationManager()->
|
||||
FlushAnimations(CommonAnimationManager::Cannot_Throttle);
|
||||
}
|
||||
if (mPresContext->TransitionManager()) {
|
||||
mPresContext->TransitionManager()->
|
||||
FlushTransitions(CommonAnimationManager::Cannot_Throttle);
|
||||
}
|
||||
mPresContext->AnimationManager()->
|
||||
FlushAnimations(CommonAnimationManager::Cannot_Throttle);
|
||||
mPresContext->TransitionManager()->
|
||||
FlushTransitions(CommonAnimationManager::Cannot_Throttle);
|
||||
mPresContext->TickLastStyleUpdateForAllAnimations();
|
||||
}
|
||||
|
||||
@ -5875,8 +5871,6 @@ PresShell::Paint(nsView* aViewToPaint,
|
||||
LayerProperties::CloneFrom(layerManager->GetRoot()) :
|
||||
nullptr);
|
||||
|
||||
MaybeSetupTransactionIdAllocator(layerManager, aViewToPaint);
|
||||
|
||||
if (layerManager->EndEmptyTransaction((aFlags & PAINT_COMPOSITE) ?
|
||||
LayerManager::END_DEFAULT : LayerManager::END_NO_COMPOSITE)) {
|
||||
nsIntRegion invalid;
|
||||
@ -5937,7 +5931,6 @@ PresShell::Paint(nsView* aViewToPaint,
|
||||
root->SetVisibleRegion(bounds);
|
||||
layerManager->SetRoot(root);
|
||||
}
|
||||
MaybeSetupTransactionIdAllocator(layerManager, aViewToPaint);
|
||||
layerManager->EndTransaction(nullptr, nullptr, (aFlags & PAINT_COMPOSITE) ?
|
||||
LayerManager::END_DEFAULT : LayerManager::END_NO_COMPOSITE);
|
||||
}
|
||||
|
@ -686,17 +686,12 @@ nsRefreshDriver::nsRefreshDriver(nsPresContext* aPresContext)
|
||||
mReflowCause(nullptr),
|
||||
mStyleCause(nullptr),
|
||||
mPresContext(aPresContext),
|
||||
mRootRefresh(nullptr),
|
||||
mPendingTransaction(0),
|
||||
mCompletedTransaction(0),
|
||||
mFreezeCount(0),
|
||||
mThrottled(false),
|
||||
mTestControllingRefreshes(false),
|
||||
mViewManagerFlushIsPending(false),
|
||||
mRequestedHighPrecision(false),
|
||||
mInRefresh(false),
|
||||
mWaitingForTransaction(false),
|
||||
mSkippedPaints(0)
|
||||
mInRefresh(false)
|
||||
{
|
||||
mMostRecentRefreshEpochTime = JS_Now();
|
||||
mMostRecentRefresh = TimeStamp::Now();
|
||||
@ -708,10 +703,6 @@ nsRefreshDriver::~nsRefreshDriver()
|
||||
"observers should have unregistered");
|
||||
NS_ABORT_IF_FALSE(!mActiveTimer, "timer should be gone");
|
||||
|
||||
if (mRootRefresh) {
|
||||
mRootRefresh->RemoveRefreshObserver(this, Flush_Style);
|
||||
mRootRefresh = nullptr;
|
||||
}
|
||||
for (uint32_t i = 0; i < mPresShellsToInvalidateIfHidden.Length(); i++) {
|
||||
mPresShellsToInvalidateIfHidden[i]->InvalidatePresShellIfHidden();
|
||||
}
|
||||
@ -734,11 +725,6 @@ nsRefreshDriver::AdvanceTimeAndRefresh(int64_t aMilliseconds)
|
||||
mMostRecentRefresh = TimeStamp::Now();
|
||||
|
||||
mTestControllingRefreshes = true;
|
||||
if (mWaitingForTransaction) {
|
||||
// Disable any refresh driver throttling when entering test mode
|
||||
mWaitingForTransaction = false;
|
||||
mSkippedPaints = 0;
|
||||
}
|
||||
}
|
||||
|
||||
mMostRecentRefreshEpochTime += aMilliseconds * 1000;
|
||||
@ -753,7 +739,6 @@ nsRefreshDriver::RestoreNormalRefresh()
|
||||
{
|
||||
mTestControllingRefreshes = false;
|
||||
EnsureTimerStarted(false);
|
||||
mCompletedTransaction = mPendingTransaction;
|
||||
}
|
||||
|
||||
TimeStamp
|
||||
@ -1016,6 +1001,12 @@ nsRefreshDriver::ArrayFor(mozFlushType aFlushType)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* nsISupports implementation
|
||||
*/
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsRefreshDriver, nsISupports)
|
||||
|
||||
/*
|
||||
* nsITimerCallback implementation
|
||||
*/
|
||||
@ -1070,18 +1061,6 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime)
|
||||
mMostRecentRefresh = aNowTime;
|
||||
mMostRecentRefreshEpochTime = aNowEpoch;
|
||||
|
||||
if (IsWaitingForPaint()) {
|
||||
// We're currently suspended waiting for earlier Tick's to
|
||||
// be completed (on the Compositor). Mark that we missed the paint
|
||||
// and keep waiting.
|
||||
return;
|
||||
}
|
||||
if (mRootRefresh) {
|
||||
mRootRefresh->RemoveRefreshObserver(this, Flush_Style);
|
||||
mRootRefresh = nullptr;
|
||||
}
|
||||
mSkippedPaints = 0;
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell = mPresContext->GetPresShell();
|
||||
if (!presShell || (ObserverCount() == 0 && ImageRequestCount() == 0)) {
|
||||
// Things are being destroyed, or we no longer have any observers.
|
||||
@ -1117,8 +1096,6 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime)
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
// This is the Flush_Style case.
|
||||
|
||||
// Grab all of our frame request callbacks up front.
|
||||
nsTArray<DocumentFrameCallbacks>
|
||||
frameRequestCallbacks(mFrameRequestCallbackDocs.Length());
|
||||
@ -1160,6 +1137,7 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime)
|
||||
}
|
||||
profiler_tracing("Paint", "Scripts", TRACING_INTERVAL_END);
|
||||
|
||||
// This is the Flush_Style case.
|
||||
if (mPresContext && mPresContext->GetPresShell()) {
|
||||
bool tracingStyleFlush = false;
|
||||
nsAutoTArray<nsIPresShell*, 16> observers;
|
||||
@ -1189,10 +1167,6 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime)
|
||||
profiler_tracing("Paint", "Styles", TRACING_INTERVAL_END);
|
||||
}
|
||||
}
|
||||
|
||||
if (!nsLayoutUtils::AreAsyncAnimationsEnabled()) {
|
||||
mPresContext->TickLastStyleUpdateForAllAnimations();
|
||||
}
|
||||
} else if (i == 1) {
|
||||
// This is the Flush_Layout case.
|
||||
if (mPresContext && mPresContext->GetPresShell()) {
|
||||
@ -1381,114 +1355,6 @@ nsRefreshDriver::Thaw()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsRefreshDriver::FinishedWaitingForTransaction()
|
||||
{
|
||||
mWaitingForTransaction = false;
|
||||
if (mSkippedPaints &&
|
||||
!IsInRefresh() &&
|
||||
(ObserverCount() || ImageRequestCount())) {
|
||||
DoRefresh();
|
||||
}
|
||||
mSkippedPaints = 0;
|
||||
}
|
||||
|
||||
uint64_t
|
||||
nsRefreshDriver::GetTransactionId()
|
||||
{
|
||||
++mPendingTransaction;
|
||||
|
||||
if (mPendingTransaction == mCompletedTransaction + 2 &&
|
||||
!mWaitingForTransaction &&
|
||||
!mTestControllingRefreshes) {
|
||||
mWaitingForTransaction = true;
|
||||
mSkippedPaints = 0;
|
||||
}
|
||||
|
||||
return mPendingTransaction;
|
||||
}
|
||||
|
||||
void
|
||||
nsRefreshDriver::RevokeTransactionId(uint64_t aTransactionId)
|
||||
{
|
||||
MOZ_ASSERT(aTransactionId == mPendingTransaction);
|
||||
if (mPendingTransaction == mCompletedTransaction + 2 &&
|
||||
mWaitingForTransaction) {
|
||||
MOZ_ASSERT(!mSkippedPaints, "How did we skip a paint when we're in the middle of one?");
|
||||
FinishedWaitingForTransaction();
|
||||
}
|
||||
mPendingTransaction--;
|
||||
}
|
||||
|
||||
void
|
||||
nsRefreshDriver::NotifyTransactionCompleted(uint64_t aTransactionId)
|
||||
{
|
||||
if (aTransactionId > mCompletedTransaction) {
|
||||
if (mPendingTransaction > mCompletedTransaction + 1 &&
|
||||
mWaitingForTransaction) {
|
||||
mCompletedTransaction = aTransactionId;
|
||||
FinishedWaitingForTransaction();
|
||||
} else {
|
||||
mCompletedTransaction = aTransactionId;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsRefreshDriver::WillRefresh(mozilla::TimeStamp aTime)
|
||||
{
|
||||
mRootRefresh->RemoveRefreshObserver(this, Flush_Style);
|
||||
mRootRefresh = nullptr;
|
||||
if (mSkippedPaints) {
|
||||
DoRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
nsRefreshDriver::IsWaitingForPaint()
|
||||
{
|
||||
if (mTestControllingRefreshes) {
|
||||
return false;
|
||||
}
|
||||
// If we've skipped too many ticks then it's possible
|
||||
// that something went wrong and we're waiting on
|
||||
// a notification that will never arrive.
|
||||
static const uint32_t kMaxSkippedPaints = 10;
|
||||
if (mSkippedPaints > kMaxSkippedPaints) {
|
||||
mSkippedPaints = 0;
|
||||
mWaitingForTransaction = false;
|
||||
if (mRootRefresh) {
|
||||
mRootRefresh->RemoveRefreshObserver(this, Flush_Style);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (mWaitingForTransaction) {
|
||||
mSkippedPaints++;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Try find the 'root' refresh driver for the current window and check
|
||||
// if that is waiting for a paint.
|
||||
nsPresContext *displayRoot = PresContext()->GetDisplayRootPresContext();
|
||||
if (displayRoot) {
|
||||
nsRefreshDriver *rootRefresh = displayRoot->GetRootPresContext()->RefreshDriver();
|
||||
if (rootRefresh && rootRefresh != this) {
|
||||
if (rootRefresh->IsWaitingForPaint()) {
|
||||
if (mRootRefresh != rootRefresh) {
|
||||
if (mRootRefresh) {
|
||||
mRootRefresh->RemoveRefreshObserver(this, Flush_Style);
|
||||
}
|
||||
rootRefresh->AddRefreshObserver(this, Flush_Style);
|
||||
mRootRefresh = rootRefresh;
|
||||
}
|
||||
mSkippedPaints++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
nsRefreshDriver::SetThrottled(bool aThrottled)
|
||||
{
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "GeckoProfiler.h"
|
||||
#include "mozilla/layers/TransactionIdAllocator.h"
|
||||
|
||||
class nsPresContext;
|
||||
class nsIPresShell;
|
||||
@ -63,8 +62,7 @@ public:
|
||||
virtual void DidRefresh() = 0;
|
||||
};
|
||||
|
||||
class nsRefreshDriver MOZ_FINAL : public mozilla::layers::TransactionIdAllocator,
|
||||
public nsARefreshObserver {
|
||||
class nsRefreshDriver MOZ_FINAL : public nsISupports {
|
||||
public:
|
||||
nsRefreshDriver(nsPresContext *aPresContext);
|
||||
~nsRefreshDriver();
|
||||
@ -72,6 +70,9 @@ public:
|
||||
static void InitializeStatics();
|
||||
static void Shutdown();
|
||||
|
||||
// nsISupports implementation
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
/**
|
||||
* Methods for testing, exposed via nsIDOMWindowUtils. See
|
||||
* nsIDOMWindowUtils.advanceTimeAndRefresh for description.
|
||||
@ -271,17 +272,6 @@ public:
|
||||
|
||||
bool IsInRefresh() { return mInRefresh; }
|
||||
|
||||
// mozilla::layers::TransactionIdAllocator
|
||||
virtual uint64_t GetTransactionId() MOZ_OVERRIDE;
|
||||
void NotifyTransactionCompleted(uint64_t aTransactionId) MOZ_OVERRIDE;
|
||||
void RevokeTransactionId(uint64_t aTransactionId) MOZ_OVERRIDE;
|
||||
|
||||
bool IsWaitingForPaint();
|
||||
|
||||
// nsARefreshObserver
|
||||
NS_IMETHOD_(MozExternalRefCountType) AddRef(void) { return TransactionIdAllocator::AddRef(); }
|
||||
NS_IMETHOD_(MozExternalRefCountType) Release(void) { return TransactionIdAllocator::Release(); }
|
||||
virtual void WillRefresh(mozilla::TimeStamp aTime);
|
||||
private:
|
||||
typedef nsTObserverArray<nsARefreshObserver*> ObserverArray;
|
||||
typedef nsTHashtable<nsISupportsHashKey> RequestTable;
|
||||
@ -324,8 +314,6 @@ private:
|
||||
return mFrameRequestCallbackDocs.Length() != 0;
|
||||
}
|
||||
|
||||
void FinishedWaitingForTransaction();
|
||||
|
||||
mozilla::RefreshDriverTimer* ChooseTimer() const;
|
||||
mozilla::RefreshDriverTimer *mActiveTimer;
|
||||
|
||||
@ -335,13 +323,6 @@ private:
|
||||
nsPresContext *mPresContext; // weak; pres context passed in constructor
|
||||
// and unset in Disconnect
|
||||
|
||||
nsRefPtr<nsRefreshDriver> mRootRefresh;
|
||||
|
||||
// The most recently allocated transaction id.
|
||||
uint64_t mPendingTransaction;
|
||||
// The most recently completed transaction id.
|
||||
uint64_t mCompletedTransaction;
|
||||
|
||||
uint32_t mFreezeCount;
|
||||
bool mThrottled;
|
||||
bool mTestControllingRefreshes;
|
||||
@ -349,14 +330,6 @@ private:
|
||||
bool mRequestedHighPrecision;
|
||||
bool mInRefresh;
|
||||
|
||||
// True if the refresh driver is suspended waiting for transaction
|
||||
// id's to be returned and shouldn't do any work during Tick().
|
||||
bool mWaitingForTransaction;
|
||||
// True if Tick() was skipped because of mWaitingForTransaction and
|
||||
// we should schedule a new Tick immediately when resumed instead
|
||||
// of waiting until the next interval.
|
||||
uint32_t mSkippedPaints;
|
||||
|
||||
int64_t mMostRecentRefreshEpochTime;
|
||||
mozilla::TimeStamp mMostRecentRefresh;
|
||||
|
||||
|
@ -35,8 +35,8 @@ function runTests() {
|
||||
scrollTopBefore = doc.body.scrollTop;
|
||||
// send up arrow key event
|
||||
sendKey("UP");
|
||||
|
||||
window.requestAnimationFrame(finish);
|
||||
|
||||
setTimeout("finish();", 20);
|
||||
}
|
||||
|
||||
function finish() {
|
||||
|
@ -37,11 +37,6 @@ RenderFrameChild::AllocPLayerTransactionChild()
|
||||
{
|
||||
LayerTransactionChild* c = new LayerTransactionChild();
|
||||
c->AddIPDLReference();
|
||||
// We only create PLayerTransaction objects through PRenderFrame when we don't
|
||||
// have a PCompositor. This means that the child process content will never
|
||||
// get drawn to the screen, but some tests rely on it pretending to function
|
||||
// for now.
|
||||
c->SetHasNoCompositor();
|
||||
return c;
|
||||
}
|
||||
|
||||
|
@ -809,7 +809,6 @@ RenderFrameParent::ContentViewScaleChanged(nsContentView* aView)
|
||||
|
||||
void
|
||||
RenderFrameParent::ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& aTargetConfig,
|
||||
bool aIsFirstPaint,
|
||||
bool aScheduleComposite,
|
||||
|
@ -79,7 +79,6 @@ public:
|
||||
void ContentViewScaleChanged(nsContentView* aView);
|
||||
|
||||
virtual void ShadowLayersUpdated(LayerTransactionParent* aLayerTree,
|
||||
const uint64_t& aTransactionId,
|
||||
const TargetConfig& aTargetConfig,
|
||||
bool aIsFirstPaint,
|
||||
bool aScheduleComposite,
|
||||
|
@ -1066,6 +1066,7 @@ function TreeNode(aUnsafeName, aUnits, aIsDegenerate)
|
||||
// - _amount
|
||||
// - _description
|
||||
// - _hideKids (only defined if true)
|
||||
// - _maxAbsDescendant (on-demand, only when gIsDiff is set)
|
||||
}
|
||||
|
||||
TreeNode.prototype = {
|
||||
@ -1080,6 +1081,32 @@ TreeNode.prototype = {
|
||||
return undefined;
|
||||
},
|
||||
|
||||
// When gIsDiff is false, tree operations -- sorting and determining if a
|
||||
// sub-tree is significant -- are straightforward. But when gIsDiff is true,
|
||||
// the combination of positive and negative values within a tree complicates
|
||||
// things. So for a non-leaf node, instead of just looking at _amount, we
|
||||
// instead look at the maximum absolute value of the node and all of its
|
||||
// descendants.
|
||||
maxAbsDescendant: function() {
|
||||
if (!this._kids) {
|
||||
// No kids? Just return the absolute value of the amount.
|
||||
return max = Math.abs(this._amount);
|
||||
}
|
||||
|
||||
if ('_maxAbsDescendant' in this) {
|
||||
// We've computed this before? Return the saved value.
|
||||
return this._maxAbsDescendant;
|
||||
}
|
||||
|
||||
// Compute the maximum absolute value of all descendants.
|
||||
let max = Math.abs(this._amount);
|
||||
for (let i = 0; i < this._kids.length; i++) {
|
||||
max = Math.max(max, this._kids[i].maxAbsDescendant());
|
||||
}
|
||||
this._maxAbsDescendant = max;
|
||||
return max;
|
||||
},
|
||||
|
||||
toString: function() {
|
||||
switch (this._units) {
|
||||
case UNITS_BYTES: return formatBytes(this._amount);
|
||||
@ -1092,14 +1119,14 @@ TreeNode.prototype = {
|
||||
}
|
||||
};
|
||||
|
||||
// Sort TreeNodes first by size, then by name. This is particularly important
|
||||
// for the about:memory tests, which need a predictable ordering of reporters
|
||||
// which have the same amount.
|
||||
// Sort TreeNodes first by size, then by name. The latter is important for the
|
||||
// about:memory tests, which need a predictable ordering of reporters which
|
||||
// have the same amount.
|
||||
TreeNode.compareAmounts = function(aA, aB) {
|
||||
let a, b;
|
||||
if (gIsDiff) {
|
||||
a = Math.abs(aA._amount);
|
||||
b = Math.abs(aB._amount);
|
||||
a = aA.maxAbsDescendant();
|
||||
b = aB.maxAbsDescendant();
|
||||
} else {
|
||||
a = aA._amount;
|
||||
b = aB._amount;
|
||||
@ -1234,8 +1261,13 @@ function sortTreeAndInsertAggregateNodes(aTotalBytes, aT)
|
||||
|
||||
function isInsignificant(aT)
|
||||
{
|
||||
return !gVerbose.checked &&
|
||||
(100 * aT._amount / aTotalBytes) < kSignificanceThresholdPerc;
|
||||
if (gVerbose.checked)
|
||||
return false;
|
||||
|
||||
let perc = gIsDiff
|
||||
? 100 * aT.maxAbsDescendant() / Math.abs(aTotalBytes)
|
||||
: 100 * aT._amount / aTotalBytes;
|
||||
return perc < kSignificanceThresholdPerc;
|
||||
}
|
||||
|
||||
if (!aT._kids) {
|
||||
|
@ -13,6 +13,13 @@
|
||||
{"process": "P", "path": "foobar", "kind": 2, "units": 0, "amount": 100, "description": "Desc."},
|
||||
{"process": "P", "path": "zero1", "kind": 2, "units": 0, "amount": 0, "description": "Desc."},
|
||||
|
||||
{"process": "P", "path": "a/b", "kind": 2, "units": 0, "amount": 1000000, "description": "Desc."},
|
||||
{"process": "P", "path": "a/c/d", "kind": 2, "units": 0, "amount": 2000000, "description": "Desc."},
|
||||
{"process": "P", "path": "a/c/e", "kind": 2, "units": 0, "amount": 2000000, "description": "Desc."},
|
||||
{"process": "P", "path": "a/c/f", "kind": 2, "units": 0, "amount": 3000000, "description": "Desc."},
|
||||
{"process": "P", "path": "a/c/g", "kind": 2, "units": 0, "amount": 3000000, "description": "Desc."},
|
||||
{"process": "P", "path": "a/h", "kind": 2, "units": 0, "amount": 1000, "description": "Desc."},
|
||||
|
||||
{"process": "P2 (pid 22)", "path": "z-moz-nullprincipal:{85e250f3-57ae-46c4-a11e-4176dd39d9c5} 0x1234", "kind": 2, "units": 0, "amount": 33, "description": "Desc."},
|
||||
|
||||
{"process": "P3", "path": "p3", "kind": 2, "units": 0, "amount": 55, "description": "Desc."},
|
||||
|
@ -14,6 +14,13 @@
|
||||
|
||||
{"process": "P", "path": "foobaz", "kind": 2, "units": 0, "amount": 0, "description": "Desc."},
|
||||
|
||||
{"process": "P", "path": "a/b", "kind": 2, "units": 0, "amount": 2000000, "description": "Desc."},
|
||||
{"process": "P", "path": "a/c/d", "kind": 2, "units": 0, "amount": 2998000, "description": "Desc."},
|
||||
{"process": "P", "path": "a/c/e", "kind": 2, "units": 0, "amount": 1001000, "description": "Desc."},
|
||||
{"process": "P", "path": "a/c/f", "kind": 2, "units": 0, "amount": 3001000, "description": "Desc."},
|
||||
{"process": "P", "path": "a/c/g", "kind": 2, "units": 0, "amount": 3001000, "description": "Desc."},
|
||||
{"process": "P", "path": "a/h", "kind": 2, "units": 0, "amount": 2000, "description": "Desc."},
|
||||
|
||||
{"process": "P2 (pid 33)", "path": "z-moz-nullprincipal:{161effaa-c1f7-4010-a08e-e7c9aea01aed} 0x5678", "kind": 2, "units": 0, "amount": 44, "description": "Desc."},
|
||||
|
||||
{"process": "P4", "path": "p4", "kind": 2, "units": 0, "amount": 66, "description": "Desc."},
|
||||
|
@ -64,13 +64,13 @@
|
||||
|
||||
// Load the given file into the frame, then copy+paste the entire frame and
|
||||
// check that the cut text matches what we expect.
|
||||
function test(aFilename, aFilename2, aExpected, aDumpFirst, aNext) {
|
||||
function test(aFilename, aFilename2, aExpected, aDumpFirst, aVerbose, aNext) {
|
||||
let frame = document.getElementById("amFrame");
|
||||
frame.focus();
|
||||
|
||||
let doc = frame.contentWindow.document;
|
||||
let verbosity = doc.getElementById("verbose");
|
||||
verbosity.checked = true;
|
||||
verbosity.checked = aVerbose;
|
||||
|
||||
function getFilePath(aFilename) {
|
||||
let file = Cc["@mozilla.org/file/directory_service;1"]
|
||||
@ -174,7 +174,7 @@
|
||||
function chain(aPieces) {
|
||||
let x = aPieces.shift();
|
||||
if (x) {
|
||||
return function() { test(x.filename, x.filename2, x.expected, x.dumpFirst, chain(aPieces)); }
|
||||
return function() { test(x.filename, x.filename2, x.expected, x.dumpFirst, x.verbose, chain(aPieces)); }
|
||||
} else {
|
||||
return function() { finish(); };
|
||||
}
|
||||
@ -265,8 +265,81 @@ End of Main Process (pid NNN)\n\
|
||||
Invalid memory report(s): missing 'hasMozMallocUsableSize' property\
|
||||
";
|
||||
|
||||
// This is the output for a diff.
|
||||
let expectedDiff =
|
||||
// This is the output for a non-verbose diff.
|
||||
let expectedDiffNonVerbose =
|
||||
"\
|
||||
P\n\
|
||||
\n\
|
||||
WARNING: the 'heap-allocated' memory reporter does not work for this platform and/or configuration. This means that 'heap-unclassified' is not shown and the 'explicit' tree shows less memory than it should.\n\
|
||||
Explicit Allocations\n\
|
||||
\n\
|
||||
-0.01 MB (100.0%) -- explicit\n\
|
||||
├──-0.01 MB (99.95%) ── storage/prefixset/goog-phish-shavar\n\
|
||||
└──-0.00 MB (00.05%) ++ (2 tiny)\n\
|
||||
\n\
|
||||
Other Measurements\n\
|
||||
\n\
|
||||
0.96 MB (100.0%) -- a\n\
|
||||
├──0.95 MB (99.80%) ── b\n\
|
||||
├──0.00 MB (00.10%) -- c\n\
|
||||
│ ├──-0.95 MB (-99.70%) ── e\n\
|
||||
│ ├──0.95 MB (99.60%) ── d\n\
|
||||
│ └──0.00 MB (00.20%) ++ (2 tiny)\n\
|
||||
└──0.00 MB (00.10%) ── h\n\
|
||||
\n\
|
||||
0.00 MB ── canvas-2d-pixel-bytes [2] [+]\n\
|
||||
-0.00 MB ── foobar [-]\n\
|
||||
\n\
|
||||
End of P\n\
|
||||
P2 (pid NNN)\n\
|
||||
Other Measurements\n\
|
||||
\n\
|
||||
0.00 MB ── z-moz-nullprincipal:{NNNNNNNN-NNNN-NNNN-NNNN-NNNNNNNNNNNN} 0xNNN\n\
|
||||
\n\
|
||||
End of P2 (pid NNN)\n\
|
||||
P3\n\
|
||||
Other Measurements\n\
|
||||
\n\
|
||||
-0.00 MB ── p3 [-]\n\
|
||||
\n\
|
||||
End of P3\n\
|
||||
P4\n\
|
||||
Other Measurements\n\
|
||||
\n\
|
||||
0.00 MB ── p4 [+]\n\
|
||||
\n\
|
||||
End of P4\n\
|
||||
P7\n\
|
||||
Other Measurements\n\
|
||||
\n\
|
||||
0.00 MB (100.0%) -- p7\n\
|
||||
├──0.00 MB (57.14%) ── c [+]\n\
|
||||
└──0.00 MB (42.86%) ── b [+]\n\
|
||||
\n\
|
||||
-0.00 MB ── p7 [-]\n\
|
||||
\n\
|
||||
End of P7\n\
|
||||
P8\n\
|
||||
Other Measurements\n\
|
||||
\n\
|
||||
-0.00 MB (100.0%) -- p8\n\
|
||||
└──-0.00 MB (100.0%) -- a\n\
|
||||
├──-0.00 MB (50.00%) -- b\n\
|
||||
│ ├──-0.00 MB (31.82%) -- c\n\
|
||||
│ │ ├──-0.00 MB (18.18%) ── e [-]\n\
|
||||
│ │ └──-0.00 MB (13.64%) ── d [-]\n\
|
||||
│ ├──-0.00 MB (22.73%) ── f [-]\n\
|
||||
│ └───0.00 MB (-4.55%) ── (fake child) [!]\n\
|
||||
└──-0.00 MB (50.00%) -- g\n\
|
||||
├──-0.00 MB (31.82%) ── i [-]\n\
|
||||
├──-0.00 MB (27.27%) ── h [-]\n\
|
||||
└───0.00 MB (-9.09%) ── (fake child) [!]\n\
|
||||
\n\
|
||||
End of P8\n\
|
||||
";
|
||||
|
||||
// This is the output for a verbose diff.
|
||||
let expectedDiffVerbose =
|
||||
"\
|
||||
P\n\
|
||||
\n\
|
||||
@ -280,6 +353,15 @@ Explicit Allocations\n\
|
||||
\n\
|
||||
Other Measurements\n\
|
||||
\n\
|
||||
1,002,000 B (100.0%) -- a\n\
|
||||
├──1,000,000 B (99.80%) ── b\n\
|
||||
├──────1,000 B (00.10%) -- c\n\
|
||||
│ ├──-999,000 B (-99.70%) ── e\n\
|
||||
│ ├──998,000 B (99.60%) ── d\n\
|
||||
│ ├──1,000 B (00.10%) ── f\n\
|
||||
│ └──1,000 B (00.10%) ── g\n\
|
||||
└──────1,000 B (00.10%) ── h\n\
|
||||
\n\
|
||||
3,000 B ── canvas-2d-pixel-bytes [2] [+]\n\
|
||||
-100 B ── foobar [-]\n\
|
||||
\n\
|
||||
@ -333,16 +415,19 @@ End of P8\n\
|
||||
|
||||
let frames = [
|
||||
// This loads a pre-existing file that is valid.
|
||||
{ filename: "memory-reports-good.json", expected: expectedGood, dumpFirst: false },
|
||||
{ filename: "memory-reports-good.json", expected: expectedGood, dumpFirst: false, verbose: true },
|
||||
|
||||
// This dumps to a file and then reads it back in.
|
||||
{ filename: "memory-reports-dumped.json.gz", expected: expectedGood2, dumpFirst: true },
|
||||
{ filename: "memory-reports-dumped.json.gz", expected: expectedGood2, dumpFirst: true, verbose: true },
|
||||
|
||||
// This loads a pre-existing file that is invalid.
|
||||
{ filename: "memory-reports-bad.json", expected: expectedBad, dumpFirst: false },
|
||||
{ filename: "memory-reports-bad.json", expected: expectedBad, dumpFirst: false, verbose: true },
|
||||
|
||||
// This loads a pre-existing diff file.
|
||||
{ filename: "memory-reports-diff1.json", filename2: "memory-reports-diff2.json", expected: expectedDiff, dumpFirst: false }
|
||||
{ filename: "memory-reports-diff1.json", filename2: "memory-reports-diff2.json", expected: expectedDiffNonVerbose, dumpFirst: false, verbose: false },
|
||||
|
||||
// Ditto
|
||||
{ filename: "memory-reports-diff1.json", filename2: "memory-reports-diff2.json", expected: expectedDiffVerbose, dumpFirst: false, verbose: true }
|
||||
];
|
||||
|
||||
SimpleTest.waitForFocus(chain(frames));
|
||||
|
Loading…
Reference in New Issue
Block a user