merge b2g-inbound to mozilla-central a=merge

This commit is contained in:
Carsten "Tomcat" Book 2014-12-04 17:03:38 +01:00
commit 6b113363d2
42 changed files with 408 additions and 229 deletions

View File

@ -15,6 +15,7 @@ pref("browser.chromeURL", "chrome://b2g/content/");
// so that it can't be set a just a string. // so that it can't be set a just a string.
// data: url is a workaround this. // data: url is a workaround this.
pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=chrome://b2g/content/shell.html"); pref("browser.startup.homepage", "data:text/plain,browser.startup.homepage=chrome://b2g/content/shell.html");
pref("b2g.is_mulet", true);
// Prevent having the firstrun page // Prevent having the firstrun page
pref("startup.homepage_welcome_url", ""); pref("startup.homepage_welcome_url", "");
pref("browser.shell.checkDefaultBrowser", false); pref("browser.shell.checkDefaultBrowser", false);

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3ab0d9c70f0b2e1ededc679112c392303f037361"> <project name="platform_build" path="build" remote="b2g" revision="3ab0d9c70f0b2e1ededc679112c392303f037361">
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="984e6d79aa799d2695f9ca132dfdc1665a56c019"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="0462090a99093049add9268d14cbc7e44c1d1ccb"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/> <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/> <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8695c248b5347120bf56c3d1a3a8493d791ea712"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="3734105921db5e802c9257c81ca707cae1500742"/>
<!-- Stock Android things --> <!-- 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="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/> <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="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<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="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/> <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="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>

View File

@ -19,13 +19,13 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="984e6d79aa799d2695f9ca132dfdc1665a56c019"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="0462090a99093049add9268d14cbc7e44c1d1ccb"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d5d3f93914558b6f168447b805cd799c8233e300"/> <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d5d3f93914558b6f168447b805cd799c8233e300"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="8b13bfc1d7d25cee4de55f332654fdba25b8460b"/> <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="8b13bfc1d7d25cee4de55f332654fdba25b8460b"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/> <project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8695c248b5347120bf56c3d1a3a8493d791ea712"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="3734105921db5e802c9257c81ca707cae1500742"/>
<!-- Stock Android things --> <!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/> <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/> <project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>

View File

@ -17,10 +17,10 @@
</project> </project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="984e6d79aa799d2695f9ca132dfdc1665a56c019"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="0462090a99093049add9268d14cbc7e44c1d1ccb"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/> <project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8695c248b5347120bf56c3d1a3a8493d791ea712"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="3734105921db5e802c9257c81ca707cae1500742"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/> <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/> <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things --> <!-- Stock Android things -->

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3ab0d9c70f0b2e1ededc679112c392303f037361"> <project name="platform_build" path="build" remote="b2g" revision="3ab0d9c70f0b2e1ededc679112c392303f037361">
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="984e6d79aa799d2695f9ca132dfdc1665a56c019"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="0462090a99093049add9268d14cbc7e44c1d1ccb"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/> <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/> <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8695c248b5347120bf56c3d1a3a8493d791ea712"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="3734105921db5e802c9257c81ca707cae1500742"/>
<!-- Stock Android things --> <!-- 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/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"/> <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"/>

View File

@ -19,13 +19,13 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="984e6d79aa799d2695f9ca132dfdc1665a56c019"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="0462090a99093049add9268d14cbc7e44c1d1ccb"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d5d3f93914558b6f168447b805cd799c8233e300"/> <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="d5d3f93914558b6f168447b805cd799c8233e300"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="8b13bfc1d7d25cee4de55f332654fdba25b8460b"/> <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="8b13bfc1d7d25cee4de55f332654fdba25b8460b"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/> <project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8695c248b5347120bf56c3d1a3a8493d791ea712"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="3734105921db5e802c9257c81ca707cae1500742"/>
<!-- Stock Android things --> <!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/> <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
<project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/> <project name="platform/bionic" path="bionic" revision="c72b8f6359de7ed17c11ddc9dfdde3f615d188a9"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="3ab0d9c70f0b2e1ededc679112c392303f037361"> <project name="platform_build" path="build" remote="b2g" revision="3ab0d9c70f0b2e1ededc679112c392303f037361">
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="984e6d79aa799d2695f9ca132dfdc1665a56c019"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="0462090a99093049add9268d14cbc7e44c1d1ccb"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/> <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/> <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8695c248b5347120bf56c3d1a3a8493d791ea712"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="3734105921db5e802c9257c81ca707cae1500742"/>
<!-- Stock Android things --> <!-- 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="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/> <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="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<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="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/> <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="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>

View File

@ -17,10 +17,10 @@
</project> </project>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="984e6d79aa799d2695f9ca132dfdc1665a56c019"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="0462090a99093049add9268d14cbc7e44c1d1ccb"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/> <project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8695c248b5347120bf56c3d1a3a8493d791ea712"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="3734105921db5e802c9257c81ca707cae1500742"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/> <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/> <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things --> <!-- Stock Android things -->

View File

@ -4,6 +4,6 @@
"remote": "", "remote": "",
"branch": "" "branch": ""
}, },
"revision": "d7e815eb184c843a9d7e5784e99d5e39a31c59da", "revision": "9a69c3f26819cc3ee8060307289ca8712d0c5e22",
"repo_path": "integration/gaia-central" "repo_path": "integration/gaia-central"
} }

View File

@ -17,11 +17,11 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="984e6d79aa799d2695f9ca132dfdc1665a56c019"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="0462090a99093049add9268d14cbc7e44c1d1ccb"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/> <project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8695c248b5347120bf56c3d1a3a8493d791ea712"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="3734105921db5e802c9257c81ca707cae1500742"/>
<!-- Stock Android things --> <!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/> <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
<project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/> <project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>

View File

@ -15,7 +15,7 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="984e6d79aa799d2695f9ca132dfdc1665a56c019"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="0462090a99093049add9268d14cbc7e44c1d1ccb"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>

View File

@ -17,10 +17,10 @@
</project> </project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/> <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="984e6d79aa799d2695f9ca132dfdc1665a56c019"/> <project name="gaia" path="gaia" remote="mozillaorg" revision="0462090a99093049add9268d14cbc7e44c1d1ccb"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/> <project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8695c248b5347120bf56c3d1a3a8493d791ea712"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="3734105921db5e802c9257c81ca707cae1500742"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/> <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/> <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things --> <!-- Stock Android things -->

View File

@ -17,12 +17,12 @@
<copyfile dest="Makefile" src="core/root.mk"/> <copyfile dest="Makefile" src="core/root.mk"/>
</project> </project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/> <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="984e6d79aa799d2695f9ca132dfdc1665a56c019"/> <project name="gaia.git" path="gaia" remote="mozillaorg" revision="0462090a99093049add9268d14cbc7e44c1d1ccb"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/> <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="50ad16a280fe9cfa0716f8c6ba16afdf7f266b49"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/> <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/> <project name="librecovery" path="librecovery" remote="b2g" revision="891e5069c0ad330d8191bf8c7b879c814258c89f"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/> <project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="8695c248b5347120bf56c3d1a3a8493d791ea712"/> <project name="apitrace" path="external/apitrace" remote="apitrace" revision="3734105921db5e802c9257c81ca707cae1500742"/>
<project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/> <project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
<!-- Stock Android things --> <!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/> <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>

View File

@ -411,8 +411,13 @@ this.PermissionsTable = { geolocation: {
app: DENY_ACTION, app: DENY_ACTION,
trusted: DENY_ACTION, trusted: DENY_ACTION,
privileged: DENY_ACTION, privileged: DENY_ACTION,
certified: ALLOW_ACTION, certified: ALLOW_ACTION
access: ["read", "write"] },
"nfc-share": {
app: DENY_ACTION,
trusted: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
}, },
"nfc-manager": { "nfc-manager": {
app: DENY_ACTION, app: DENY_ACTION,

View File

@ -1414,6 +1414,19 @@ Navigator::GetFeature(const nsAString& aName, ErrorResult& aRv)
} // hardware.memory } // hardware.memory
#endif #endif
p->MaybeResolve(JS::UndefinedHandleValue);
return p.forget();
}
already_AddRefed<Promise>
Navigator::HasFeature(const nsAString& aName, ErrorResult& aRv)
{
nsCOMPtr<nsIGlobalObject> go = do_QueryInterface(mWindow);
nsRefPtr<Promise> p = Promise::Create(go, aRv);
if (aRv.Failed()) {
return nullptr;
}
// Hardcoded manifest features. Some are still b2g specific. // Hardcoded manifest features. Some are still b2g specific.
const char manifestFeatures[][64] = { const char manifestFeatures[][64] = {
"manifest.origin" "manifest.origin"
@ -1432,19 +1445,6 @@ Navigator::GetFeature(const nsAString& aName, ErrorResult& aRv)
} }
} }
p->MaybeResolve(JS::UndefinedHandleValue);
return p.forget();
}
already_AddRefed<Promise>
Navigator::HasFeature(const nsAString& aName, ErrorResult& aRv)
{
nsCOMPtr<nsIGlobalObject> go = do_QueryInterface(mWindow);
nsRefPtr<Promise> p = Promise::Create(go, aRv);
if (aRv.Failed()) {
return nullptr;
}
NS_NAMED_LITERAL_STRING(apiWindowPrefix, "api.window."); NS_NAMED_LITERAL_STRING(apiWindowPrefix, "api.window.");
if (StringBeginsWith(aName, apiWindowPrefix)) { if (StringBeginsWith(aName, apiWindowPrefix)) {
const nsAString& featureName = Substring(aName, apiWindowPrefix.Length()); const nsAString& featureName = Substring(aName, apiWindowPrefix.Length());

View File

@ -52,6 +52,7 @@
#include "nsIPermissionManager.h" #include "nsIPermissionManager.h"
#include "nsISHistory.h" #include "nsISHistory.h"
#include "nsNullPrincipal.h" #include "nsNullPrincipal.h"
#include "nsIScriptError.h"
#include "nsLayoutUtils.h" #include "nsLayoutUtils.h"
#include "nsView.h" #include "nsView.h"
@ -1762,6 +1763,30 @@ nsFrameLoader::MaybeCreateDocShell()
NS_LITERAL_STRING("chrome://global/content/BrowserElementChild.js"), NS_LITERAL_STRING("chrome://global/content/BrowserElementChild.js"),
/* allowDelayedLoad = */ true, /* allowDelayedLoad = */ true,
/* aRunInGlobalScope */ true); /* aRunInGlobalScope */ true);
// For inproc frames, set the docshell properties.
nsCOMPtr<nsIDocShellTreeItem> item = do_GetInterface(docShell);
nsAutoString name;
if (mOwnerContent->GetAttr(kNameSpaceID_None, nsGkAtoms::name, name)) {
item->SetName(name);
}
mDocShell->SetFullscreenAllowed(
mOwnerContent->HasAttr(kNameSpaceID_None, nsGkAtoms::allowfullscreen) ||
mOwnerContent->HasAttr(kNameSpaceID_None, nsGkAtoms::mozallowfullscreen));
bool isPrivate = mOwnerContent->HasAttr(kNameSpaceID_None, nsGkAtoms::mozprivatebrowsing);
if (isPrivate) {
bool nonBlank;
mDocShell->GetHasLoadedNonBlankURI(&nonBlank);
if (nonBlank) {
nsContentUtils::ReportToConsoleNonLocalized(
NS_LITERAL_STRING("We should not switch to Private Browsing after loading a document."),
nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("mozprivatebrowsing"),
nullptr);
} else {
nsCOMPtr<nsILoadContext> context = do_GetInterface(mDocShell);
context->SetUsePrivateBrowsing(true);
}
}
} }
return NS_OK; return NS_OK;

View File

@ -51,18 +51,27 @@ function testNotSupported() {
ok(typeof tv === 'undefined', "Resolve the Promise with undefined value (hardware.tv)"); ok(typeof tv === 'undefined', "Resolve the Promise with undefined value (hardware.tv)");
runNextTest(); runNextTest();
},function(tv) { },function(tv) {
ok(false, "The Promise should not be rejected") ok(false, "The Promise should not be rejected");
});
}
function testNotSupportedManifest() {
navigator.getFeature("manifest.origin").then(function(feature) {
ok(typeof feature == 'undefined', "manifest.* resolves with undefined on getFeature");
runNextTest();
}, function() {
ok(false, "The Promise should not be rejected");
}); });
} }
function createManifestTest(aFeature) { function createManifestTest(aFeature) {
return function() { return function() {
var res; var res;
navigator.getFeature(aFeature).then(function(res) { navigator.hasFeature(aFeature).then(function(res) {
ok(res === true, "Resolve the Promise with 'true' for " + aFeature); ok(res === true, "Resolve the Promise with 'true' for " + aFeature);
runNextTest(); runNextTest();
},function(tv) { }, function(tv) {
ok(false, "The Promise should not be rejected") ok(false, "The Promise should not be rejected");
}); });
} }
} }
@ -70,6 +79,7 @@ function createManifestTest(aFeature) {
var currentTest = -1; var currentTest = -1;
var tests = [ var tests = [
testNotSupported, testNotSupported,
testNotSupportedManifest,
testSupported, testSupported,
createManifestTest("manifest.origin"), createManifestTest("manifest.origin"),
createManifestTest("manifest.redirects") createManifestTest("manifest.redirects")
@ -90,6 +100,7 @@ SpecialPowers.pushPermissions([
{type: "feature-detection", allow: 1, context: document} {type: "feature-detection", allow: 1, context: document}
], function() { ], function() {
ok('getFeature' in navigator, "navigator.getFeature should exist"); ok('getFeature' in navigator, "navigator.getFeature should exist");
ok('hasFeature' in navigator, "navigator.hasFeature should exist");
// B2G specific manifest features. // B2G specific manifest features.
// Touching navigator before pushPermissions makes it fail. // Touching navigator before pushPermissions makes it fail.
if (!navigator.userAgent.contains("Android") && if (!navigator.userAgent.contains("Android") &&

View File

@ -52,14 +52,5 @@ if (!('BrowserElementIsPreloaded' in this)) {
var BrowserElementIsReady = true; var BrowserElementIsReady = true;
let infos = sendSyncMessage('browser-element-api:call',
{ 'msg_name': 'hello' })[0]; sendAsyncMessage('browser-element-api:call', { 'msg_name': 'hello' });
docShell.QueryInterface(Ci.nsIDocShellTreeItem).name = infos.name;
docShell.setFullscreenAllowed(infos.fullscreenAllowed);
if (infos.isPrivate) {
if (docShell.hasLoadedNonBlankURI) {
Cu.reportError("We should not switch to Private Browsing after loading a document.");
} else {
docShell.QueryInterface(Ci.nsILoadContext).usePrivateBrowsing = true;
}
}

View File

@ -325,14 +325,6 @@ BrowserElementParent.prototype = {
this._domRequestReady = true; this._domRequestReady = true;
this._runPendingAPICall(); this._runPendingAPICall();
} }
return {
name: this._frameElement.getAttribute('name'),
fullscreenAllowed:
this._frameElement.hasAttribute('allowfullscreen') ||
this._frameElement.hasAttribute('mozallowfullscreen'),
isPrivate: this._frameElement.hasAttribute('mozprivatebrowsing')
};
}, },
_fireCtxMenuEvent: function(data) { _fireCtxMenuEvent: function(data) {

View File

@ -15,10 +15,6 @@ iframe.addEventListener('mozbrowsershowmodalprompt', function(e) {
}, 0); }, 0);
}, 0); }, 0);
} }
else {
// Pass the message up to our parent.
alert(e.detail.message);
}
}); });
document.body.appendChild(iframe); document.body.appendChild(iframe);

View File

@ -69,6 +69,13 @@ union MaybeNativeKeyBinding
void_t; void_t;
}; };
struct ShowInfo
{
nsString name;
bool fullscreenAllowed;
bool isPrivate;
};
prio(normal upto urgent) intr protocol PBrowser prio(normal upto urgent) intr protocol PBrowser
{ {
manager PContent or PContentBridge; manager PContent or PContentBridge;
@ -411,6 +418,7 @@ child:
* point. * point.
*/ */
Show(nsIntSize size, Show(nsIntSize size,
ShowInfo info,
ScrollingBehavior scrolling, ScrollingBehavior scrolling,
TextureFactoryIdentifier textureFactoryIdentifier, TextureFactoryIdentifier textureFactoryIdentifier,
uint64_t layersId, uint64_t layersId,

View File

@ -90,6 +90,7 @@
#include "nsIAppsService.h" #include "nsIAppsService.h"
#include "nsNetUtil.h" #include "nsNetUtil.h"
#include "nsIPermissionManager.h" #include "nsIPermissionManager.h"
#include "nsIScriptError.h"
#define BROWSER_ELEMENT_CHILD_SCRIPT \ #define BROWSER_ELEMENT_CHILD_SCRIPT \
NS_LITERAL_STRING("chrome://global/content/BrowserElementChild.js") NS_LITERAL_STRING("chrome://global/content/BrowserElementChild.js")
@ -1881,10 +1882,36 @@ TabChild::DoFakeShow(const ScrollingBehavior& aScrolling,
const uint64_t& aLayersId, const uint64_t& aLayersId,
PRenderFrameChild* aRenderFrame) PRenderFrameChild* aRenderFrame)
{ {
RecvShow(nsIntSize(0, 0), aScrolling, aTextureFactoryIdentifier, aLayersId, aRenderFrame); ShowInfo info(EmptyString(), false, false);
RecvShow(nsIntSize(0, 0), info, aScrolling, aTextureFactoryIdentifier, aLayersId, aRenderFrame);
mDidFakeShow = true; mDidFakeShow = true;
} }
void
TabChild::ApplyShowInfo(const ShowInfo& aInfo)
{
nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
if (docShell) {
nsCOMPtr<nsIDocShellTreeItem> item = do_GetInterface(docShell);
item->SetName(aInfo.name());
docShell->SetFullscreenAllowed(aInfo.fullscreenAllowed());
if (aInfo.isPrivate()) {
bool nonBlank;
docShell->GetHasLoadedNonBlankURI(&nonBlank);
if (nonBlank) {
nsContentUtils::ReportToConsoleNonLocalized(
NS_LITERAL_STRING("We should not switch to Private Browsing after loading a document."),
nsIScriptError::warningFlag,
NS_LITERAL_CSTRING("mozprivatebrowsing"),
nullptr);
} else {
nsCOMPtr<nsILoadContext> context = do_GetInterface(docShell);
context->SetUsePrivateBrowsing(true);
}
}
}
}
#ifdef MOZ_WIDGET_GONK #ifdef MOZ_WIDGET_GONK
void void
TabChild::MaybeRequestPreinitCamera() TabChild::MaybeRequestPreinitCamera()
@ -1945,6 +1972,7 @@ TabChild::MaybeRequestPreinitCamera()
bool bool
TabChild::RecvShow(const nsIntSize& aSize, TabChild::RecvShow(const nsIntSize& aSize,
const ShowInfo& aInfo,
const ScrollingBehavior& aScrolling, const ScrollingBehavior& aScrolling,
const TextureFactoryIdentifier& aTextureFactoryIdentifier, const TextureFactoryIdentifier& aTextureFactoryIdentifier,
const uint64_t& aLayersId, const uint64_t& aLayersId,
@ -1953,6 +1981,7 @@ TabChild::RecvShow(const nsIntSize& aSize,
MOZ_ASSERT((!mDidFakeShow && aRenderFrame) || (mDidFakeShow && !aRenderFrame)); MOZ_ASSERT((!mDidFakeShow && aRenderFrame) || (mDidFakeShow && !aRenderFrame));
if (mDidFakeShow) { if (mDidFakeShow) {
ApplyShowInfo(aInfo);
return true; return true;
} }
@ -1976,7 +2005,9 @@ TabChild::RecvShow(const nsIntSize& aSize,
MaybeRequestPreinitCamera(); MaybeRequestPreinitCamera();
#endif #endif
return InitTabChildGlobal(); bool res = InitTabChildGlobal();
ApplyShowInfo(aInfo);
return res;
} }
bool bool

View File

@ -317,6 +317,7 @@ public:
const FileDescriptor& aFileDescriptor) const FileDescriptor& aFileDescriptor)
MOZ_OVERRIDE; MOZ_OVERRIDE;
virtual bool RecvShow(const nsIntSize& aSize, virtual bool RecvShow(const nsIntSize& aSize,
const ShowInfo& aInfo,
const ScrollingBehavior& aScrolling, const ScrollingBehavior& aScrolling,
const TextureFactoryIdentifier& aTextureFactoryIdentifier, const TextureFactoryIdentifier& aTextureFactoryIdentifier,
const uint64_t& aLayersId, const uint64_t& aLayersId,
@ -552,6 +553,8 @@ private:
const uint64_t& aLayersId, const uint64_t& aLayersId,
PRenderFrameChild* aRenderFrame); PRenderFrameChild* aRenderFrame);
void ApplyShowInfo(const ShowInfo& aInfo);
// These methods are used for tracking synthetic mouse events // These methods are used for tracking synthetic mouse events
// dispatched for compatibility. On each touch event, we // dispatched for compatibility. On each touch event, we
// UpdateTapState(). If we've detected that the current gesture // UpdateTapState(). If we've detected that the current gesture

View File

@ -600,7 +600,19 @@ TabParent::Show(const nsIntSize& size)
unused << SendPRenderFrameConstructor(renderFrame); unused << SendPRenderFrameConstructor(renderFrame);
} }
} }
unused << SendShow(size, scrolling, textureFactoryIdentifier, layersId, renderFrame);
ShowInfo info(EmptyString(), false, false);
if (mFrameElement) {
nsAutoString name;
mFrameElement->GetAttr(kNameSpaceID_None, nsGkAtoms::name, name);
bool allowFullscreen =
mFrameElement->HasAttr(kNameSpaceID_None, nsGkAtoms::allowfullscreen) ||
mFrameElement->HasAttr(kNameSpaceID_None, nsGkAtoms::mozallowfullscreen);
bool isPrivate = mFrameElement->HasAttr(kNameSpaceID_None, nsGkAtoms::mozprivatebrowsing);
info = ShowInfo(name, allowFullscreen, isPrivate);
}
unused << SendShow(size, info, scrolling, textureFactoryIdentifier, layersId, renderFrame);
} }
void void

View File

@ -131,21 +131,6 @@ NfcContentHelper.prototype = {
return encodedRecords; return encodedRecords;
}, },
// NFC interface:
checkSessionToken: function checkSessionToken(sessionToken, isP2P) {
if (sessionToken == null) {
throw Components.Exception("No session token!",
Cr.NS_ERROR_UNEXPECTED);
return false;
}
// Report session to Nfc.js only.
let val = cpmm.sendSyncMessage("NFC:CheckSessionToken", {
sessionToken: sessionToken,
isP2P: isP2P
});
return (val[0] === NFC.NFC_GECKO_SUCCESS);
},
// NFCTag interface // NFCTag interface
readNDEF: function readNDEF(sessionToken, callback) { readNDEF: function readNDEF(sessionToken, callback) {
let requestId = callback.getCallbackId(); let requestId = callback.getCallbackId();

View File

@ -54,25 +54,21 @@ const NFC_CONTRACTID = "@mozilla.org/nfc;1";
const NFC_CID = const NFC_CID =
Components.ID("{2ff24790-5e74-11e1-b86c-0800200c9a66}"); Components.ID("{2ff24790-5e74-11e1-b86c-0800200c9a66}");
const NFC_IPC_ADD_EVENT_TARGET_MSG_NAMES = [
"NFC:AddEventListener"
];
const NFC_IPC_MSG_NAMES = [ const NFC_IPC_MSG_NAMES = [
"NFC:CheckSessionToken", "NFC:AddEventListener",
"NFC:QueryInfo" "NFC:QueryInfo"
]; ];
const NFC_IPC_READ_PERM_MSG_NAMES = [ const NFC_IPC_NFC_PERM_MSG_NAMES = [
"NFC:ReadNDEF", "NFC:ReadNDEF",
"NFC:Connect", "NFC:Connect",
"NFC:Close", "NFC:Close",
];
const NFC_IPC_WRITE_PERM_MSG_NAMES = [
"NFC:WriteNDEF", "NFC:WriteNDEF",
"NFC:MakeReadOnly", "NFC:MakeReadOnly",
"NFC:Format", "NFC:Format",
];
const NFC_IPC_NFC_SHARE_PERM_MSG_NAMES = [
"NFC:SendFile", "NFC:SendFile",
"NFC:RegisterPeerReadyTarget", "NFC:RegisterPeerReadyTarget",
"NFC:UnregisterPeerReadyTarget" "NFC:UnregisterPeerReadyTarget"
@ -131,19 +127,15 @@ XPCOMUtils.defineLazyGetter(this, "gMessageManager", function () {
_registerMessageListeners: function _registerMessageListeners() { _registerMessageListeners: function _registerMessageListeners() {
ppmm.addMessageListener("child-process-shutdown", this); ppmm.addMessageListener("child-process-shutdown", this);
for (let message of NFC_IPC_ADD_EVENT_TARGET_MSG_NAMES) {
ppmm.addMessageListener(message, this);
}
for (let message of NFC_IPC_MSG_NAMES) { for (let message of NFC_IPC_MSG_NAMES) {
ppmm.addMessageListener(message, this); ppmm.addMessageListener(message, this);
} }
for (let message of NFC_IPC_READ_PERM_MSG_NAMES) { for (let message of NFC_IPC_NFC_PERM_MSG_NAMES) {
ppmm.addMessageListener(message, this); ppmm.addMessageListener(message, this);
} }
for (let message of NFC_IPC_WRITE_PERM_MSG_NAMES) { for (let message of NFC_IPC_NFC_SHARE_PERM_MSG_NAMES) {
ppmm.addMessageListener(message, this); ppmm.addMessageListener(message, this);
} }
@ -155,19 +147,15 @@ XPCOMUtils.defineLazyGetter(this, "gMessageManager", function () {
_unregisterMessageListeners: function _unregisterMessageListeners() { _unregisterMessageListeners: function _unregisterMessageListeners() {
ppmm.removeMessageListener("child-process-shutdown", this); ppmm.removeMessageListener("child-process-shutdown", this);
for (let message of NFC_IPC_ADD_EVENT_TARGET_MSG_NAMES) {
ppmm.removeMessageListener(message, this);
}
for (let message of NFC_IPC_MSG_NAMES) { for (let message of NFC_IPC_MSG_NAMES) {
ppmm.removeMessageListener(message, this); ppmm.removeMessageListener(message, this);
} }
for (let message of NFC_IPC_READ_PERM_MSG_NAMES) { for (let message of NFC_IPC_NFC_PERM_MSG_NAMES) {
ppmm.removeMessageListener(message, this); ppmm.removeMessageListener(message, this);
} }
for (let message of NFC_IPC_WRITE_PERM_MSG_NAMES) { for (let message of NFC_IPC_NFC_SHARE_PERM_MSG_NAMES) {
ppmm.removeMessageListener(message, this); ppmm.removeMessageListener(message, this);
} }
@ -290,19 +278,18 @@ XPCOMUtils.defineLazyGetter(this, "gMessageManager", function () {
return null; return null;
} }
if (NFC_IPC_MSG_NAMES.indexOf(message.name) != -1 || if (NFC_IPC_MSG_NAMES.indexOf(message.name) != -1) {
NFC_IPC_ADD_EVENT_TARGET_MSG_NAMES.indexOf(message.name) != -1 ) {
// Do nothing. // Do nothing.
} else if (NFC_IPC_READ_PERM_MSG_NAMES.indexOf(message.name) != -1) { } else if (NFC_IPC_NFC_PERM_MSG_NAMES.indexOf(message.name) != -1) {
if (!message.target.assertPermission("nfc-read")) { if (!message.target.assertPermission("nfc")) {
debug("Nfc message " + message.name + debug("Nfc Peer message " + message.name +
" from a content process with no 'nfc-read' privileges."); " from a content process with no 'nfc' privileges.");
return null; return null;
} }
} else if (NFC_IPC_WRITE_PERM_MSG_NAMES.indexOf(message.name) != -1) { } else if (NFC_IPC_NFC_SHARE_PERM_MSG_NAMES.indexOf(message.name) != -1) {
if (!message.target.assertPermission("nfc-write")) { if (!message.target.assertPermission("nfc-share")) {
debug("Nfc Peer message " + message.name + debug("Nfc Peer message " + message.name +
" from a content process with no 'nfc-write' privileges."); " from a content process with no 'nfc-share' privileges.");
return null; return null;
} }
} else if (NFC_IPC_MANAGER_PERM_MSG_NAMES.indexOf(message.name) != -1) { } else if (NFC_IPC_MANAGER_PERM_MSG_NAMES.indexOf(message.name) != -1) {
@ -320,11 +307,6 @@ XPCOMUtils.defineLazyGetter(this, "gMessageManager", function () {
case "NFC:AddEventListener": case "NFC:AddEventListener":
this.addEventListener(message.target); this.addEventListener(message.target);
return null; return null;
case "NFC:CheckSessionToken":
let sessionToken = message.data.sessionToken;
return SessionHelper.isValidToken(sessionToken, message.data.isP2P) ?
NFC.NFC_GECKO_SUCCESS :
NFC.NFC_GECKO_ERROR_BAD_SESSION_TOKEN;
case "NFC:RegisterPeerReadyTarget": case "NFC:RegisterPeerReadyTarget":
this.registerPeerReadyTarget(message.target, message.data.appId); this.registerPeerReadyTarget(message.target, message.data.appId);
return null; return null;
@ -341,7 +323,7 @@ XPCOMUtils.defineLazyGetter(this, "gMessageManager", function () {
// Upon receiving the status of sendFile operation, send the response // Upon receiving the status of sendFile operation, send the response
// to appropriate content process. // to appropriate content process.
message.data.type = "NotifySendFileStatusResponse"; message.data.type = "NotifySendFileStatusResponse";
if (message.data.status !== NFC.NFC_SUCCESS) { if (message.data.status) {
message.data.errorMsg = message.data.errorMsg =
this.nfc.getErrorMessage(NFC.NFC_GECKO_ERROR_SEND_FILE_FAILED); this.nfc.getErrorMessage(NFC.NFC_GECKO_ERROR_SEND_FILE_FAILED);
} }
@ -421,17 +403,6 @@ let SessionHelper = {
isP2PSession: function isP2PSession(id) { isP2PSession: function isP2PSession(id) {
return (this.tokenMap[id] != null) && this.tokenMap[id].isP2P; return (this.tokenMap[id] != null) && this.tokenMap[id].isP2P;
},
isValidToken: function isValidToken(token, isP2P) {
for (let id in this.tokenMap) {
if ((this.tokenMap[id].token == token) &&
(this.tokenMap[id].isP2P == isP2P)) {
return true;
}
}
return false;
} }
}; };
@ -511,8 +482,7 @@ Nfc.prototype = {
}, },
getErrorMessage: function getErrorMessage(errorCode) { getErrorMessage: function getErrorMessage(errorCode) {
return NFC.NFC_ERROR_MSG[errorCode] || return NFC.NFC_ERROR_MSG[errorCode];
NFC.NFC_ERROR_MSG[NFC.NFC_GECKO_ERROR_GENERIC_FAILURE];
}, },
/** /**

View File

@ -23,17 +23,12 @@ this.DEBUG_CONTENT_HELPER = DEBUG_ALL || false;
this.DEBUG_NFC = DEBUG_ALL || false; this.DEBUG_NFC = DEBUG_ALL || false;
// Gecko specific error codes // Gecko specific error codes
this.NFC_GECKO_SUCCESS = 0; this.NFC_GECKO_ERROR_P2P_REG_INVALID = 1;
this.NFC_GECKO_ERROR_GENERIC_FAILURE = 1; this.NFC_GECKO_ERROR_SEND_FILE_FAILED = 2;
this.NFC_GECKO_ERROR_P2P_REG_INVALID = 2;
this.NFC_GECKO_ERROR_SEND_FILE_FAILED = 3;
this.NFC_GECKO_ERROR_BAD_SESSION_TOKEN = 4;
this.NFC_ERROR_MSG = {}; this.NFC_ERROR_MSG = {};
this.NFC_ERROR_MSG[this.NFC_GECKO_ERROR_GENERIC_FAILURE] = "NfcGenericFailureError";
this.NFC_ERROR_MSG[this.NFC_GECKO_ERROR_P2P_REG_INVALID] = "NfcP2PRegistrationInvalid"; this.NFC_ERROR_MSG[this.NFC_GECKO_ERROR_P2P_REG_INVALID] = "NfcP2PRegistrationInvalid";
this.NFC_ERROR_MSG[this.NFC_GECKO_ERROR_SEND_FILE_FAILED] = "NfcSendFileFailed"; this.NFC_ERROR_MSG[this.NFC_GECKO_ERROR_SEND_FILE_FAILED] = "NfcSendFileFailed";
this.NFC_ERROR_MSG[this.NFC_GECKO_ERROR_BAD_SESSION_TOKEN] = "NfcBadSessionToken";
this.NFC_RF_STATE_IDLE = "idle"; this.NFC_RF_STATE_IDLE = "idle";
this.NFC_RF_STATE_LISTEN = "listen"; this.NFC_RF_STATE_LISTEN = "listen";

View File

@ -87,13 +87,11 @@ interface nsINfcRequestCallback : nsISupports
void notifyError(in DOMString errorMsg); void notifyError(in DOMString errorMsg);
}; };
[scriptable, uuid(bcf214de-885b-43e6-9e53-9b7d880e1633)] [scriptable, uuid(c5fdf956-735e-45d3-aa25-3a871bd3e2f8)]
interface nsINfcContentHelper : nsISupports interface nsINfcContentHelper : nsISupports
{ {
void init(in nsIDOMWindow window); void init(in nsIDOMWindow window);
boolean checkSessionToken(in DOMString sessionToken, in boolean isP2P);
/** /**
* Read current NDEF data on the tag. * Read current NDEF data on the tag.
* *

View File

@ -332,23 +332,6 @@ MozNFCImpl.prototype = {
return callback.promise; return callback.promise;
}, },
_createNFCPeer: function _createNFCPeer(sessionToken) {
let peer = new MozNFCPeerImpl(this._window, sessionToken);
return this._window.MozNFCPeer._create(this._window, peer);
},
getNFCPeer: function getNFCPeer(sessionToken) {
if (!sessionToken || !this._nfcContentHelper.checkSessionToken(sessionToken, true)) {
return null;
}
if (!this.nfcPeer || this.nfcPeer.session != sessionToken) {
this.nfcPeer = this._createNFCPeer(sessionToken);
}
return this.nfcPeer;
},
defineEventHandlerGetterSetter: function defineEventHandlerGetterSetter(name) { defineEventHandlerGetterSetter: function defineEventHandlerGetterSetter(name) {
Object.defineProperty(this, name, { Object.defineProperty(this, name, {
get: function get() { get: function get() {
@ -389,7 +372,7 @@ MozNFCImpl.prototype = {
return; return;
} }
if (!this.checkPermissions(["nfc-read", "nfc-write"])) { if (!this.checkPermissions(["nfc"])) {
return; return;
} }
@ -426,7 +409,7 @@ MozNFCImpl.prototype = {
return; return;
} }
if (!this.checkPermissions(["nfc-read", "nfc-write"])) { if (!this.checkPermissions(["nfc"])) {
return; return;
} }
@ -461,14 +444,16 @@ MozNFCImpl.prototype = {
return; return;
} }
if (!this.checkPermissions(["nfc-write"])) { let perm = isPeerReady ? ["nfc-share"] : ["nfc"];
if (!this.checkPermissions(perm)) {
return; return;
} }
this.eventService.addSystemEventListener(this._window, "visibilitychange", this.eventService.addSystemEventListener(this._window, "visibilitychange",
this, /* useCapture */false); this, /* useCapture */false);
this.nfcPeer = this._createNFCPeer(sessionToken); let peerImpl = new MozNFCPeerImpl(this._window, sessionToken);
this.nfcPeer = this._window.MozNFCPeer._create(this._window, peerImpl)
let eventData = { "peer": this.nfcPeer }; let eventData = { "peer": this.nfcPeer };
let type = (isPeerReady) ? "peerready" : "peerfound"; let type = (isPeerReady) ? "peerready" : "peerfound";
@ -483,7 +468,7 @@ MozNFCImpl.prototype = {
return; return;
} }
if (!this.checkPermissions(["nfc-write"])) { if (!this.checkPermissions(["nfc", "nfc-share"])) {
return; return;
} }

View File

@ -146,11 +146,11 @@ let tests = [
/** /**
* nfc-manager for mozNfc.checkP2PRegistration(manifestUrl) * nfc-manager for mozNfc.checkP2PRegistration(manifestUrl)
* -> "NFC:CheckP2PRegistration" IPC * -> "NFC:CheckP2PRegistration" IPC
* nfc-write to set/unset onpeerready * nfc-share to set/unset onpeerready
* -> "NFC:RegisterPeerTarget", "NFC:UnregisterPeerTarget" IPC * -> "NFC:RegisterPeerTarget", "NFC:UnregisterPeerTarget" IPC
*/ */
SpecialPowers.pushPermissions( SpecialPowers.pushPermissions(
[ [
{'type': 'nfc-manager', 'allow': true, context: document}, {'type': 'nfc-manager', 'allow': true, context: document},
{'type': 'nfc-write', 'allow': true, context: document} {'type': 'nfc-share', 'allow': true, context: document}
], runTests); ], runTests);

View File

@ -146,11 +146,11 @@ let tests = [
/** /**
* nfc-manager for mozNfc.checkP2PRegistration(manifestUrl) * nfc-manager for mozNfc.checkP2PRegistration(manifestUrl)
* -> "NFC:CheckP2PRegistration" IPC * -> "NFC:CheckP2PRegistration" IPC
* nfc-write to set/unset onpeerready * nfc-share to set/unset onpeerready
* -> "NFC:RegisterPeerTarget", "NFC:UnregisterPeerTarget" IPC * -> "NFC:RegisterPeerTarget", "NFC:UnregisterPeerTarget" IPC
*/ */
SpecialPowers.pushPermissions( SpecialPowers.pushPermissions(
[ [
{'type': 'nfc-manager', 'allow': true, context: document}, {'type': 'nfc-manager', 'allow': true, context: document},
{'type': 'nfc-write', 'allow': true, context: document} {'type': 'nfc-share', 'allow': true, context: document}
], runTests); ], runTests);

View File

@ -66,10 +66,7 @@ function testPeerReady() {
function testGetNFCPeer() { function testGetNFCPeer() {
sysMsgHelper.waitForTechDiscovered(function (msg) { sysMsgHelper.waitForTechDiscovered(function (msg) {
let peer = nfc.getNFCPeer(msg.sessionToken); ok(msg.peer instanceof MozNFCPeer, "Should get a NFCPeer object.");
ok(peer instanceof MozNFCPeer, "Should get a NFCPeer object.");
let peer1 = nfc.getNFCPeer(msg.sessionToken);
ok(peer == peer1, "Should get the same MozNFCPeer object");
NCI.deactivate().then(() => toggleNFC(false)).then(runNextTest); NCI.deactivate().then(() => toggleNFC(false)).then(runNextTest);
}); });
@ -181,24 +178,17 @@ function testPeerShouldThrow() {
.then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0)); .then(() => NCI.activateRE(emulator.P2P_RE_INDEX_0));
} }
function testPeerInvalidToken() {
log("testPeerInvalidToken");
let peer = nfc.getNFCPeer("fakeSessionToken");
is(peer, null, "NFCPeer should be null on wrong session token");
runNextTest();
}
let tests = [ let tests = [
testPeerReady, testPeerReady,
testGetNFCPeer, testGetNFCPeer,
testCheckP2PRegFailure, testCheckP2PRegFailure,
testPeerLostShouldBeCalled, testPeerLostShouldBeCalled,
testPeerLostShouldNotBeCalled, testPeerLostShouldNotBeCalled,
testPeerShouldThrow, testPeerShouldThrow
testPeerInvalidToken
]; ];
SpecialPowers.pushPermissions( SpecialPowers.pushPermissions(
[{"type": "nfc-manager", "allow": true, context: document}, [{"type": "nfc-manager", "allow": true, context: document},
{"type": "nfc-write", "allow": true, context: document}], runTests); {"type": "nfc", "allow": true, context: document},
{"type": "nfc-share", "allow": true, context: document}], runTests);

View File

@ -8,8 +8,7 @@ let MANIFEST_URL = "app://system.gaiamobile.org/manifest.webapp";
function sendFile(msg) { function sendFile(msg) {
log("sendFile msg="+JSON.stringify(msg)); log("sendFile msg="+JSON.stringify(msg));
let peer = nfc.getNFCPeer(msg.sessionToken); ok(msg.peer instanceof MozNFCPeer, "should get a MozNFCPeer");
ok(peer instanceof MozNFCPeer, "should get a MozNFCPeer");
ok(msg.blob instanceof Blob, "should get a Blob"); ok(msg.blob instanceof Blob, "should get a Blob");
nfc.peerready = null; nfc.peerready = null;

View File

@ -6,13 +6,12 @@ MARIONETTE_HEAD_JS = "head.js";
let url = "https://www.example.com"; let url = "https://www.example.com";
function sendNDEF(techType, sessionToken) { function sendNDEF(techType, peer) {
let tnf = NDEF.TNF_WELL_KNOWN; let tnf = NDEF.TNF_WELL_KNOWN;
let type = new Uint8Array(NfcUtils.fromUTF8("U")); let type = new Uint8Array(NfcUtils.fromUTF8("U"));
let payload = new Uint8Array(NfcUtils.fromUTF8(url)); let payload = new Uint8Array(NfcUtils.fromUTF8(url));
let ndef = [new MozNDEFRecord({tnf: tnf, type: type, payload: payload})]; let ndef = [new MozNDEFRecord({tnf: tnf, type: type, payload: payload})];
let peer = window.navigator.mozNfc.getNFCPeer(sessionToken);
let promise = peer.sendNDEF(ndef); let promise = peer.sendNDEF(ndef);
promise.then(() => { promise.then(() => {
log("Successfully sent NDEF message"); log("Successfully sent NDEF message");
@ -35,7 +34,7 @@ function handleTechnologyDiscoveredRE0(msg) {
is(msg.type, "techDiscovered", "check for correct message type"); is(msg.type, "techDiscovered", "check for correct message type");
let index = msg.techList.indexOf("P2P"); let index = msg.techList.indexOf("P2P");
isnot(index, -1, "check for \'P2P\' in tech list"); isnot(index, -1, "check for \'P2P\' in tech list");
sendNDEF(msg.techList[index], msg.sessionToken); sendNDEF(msg.techList[index], msg.peer);
} }
function testOnPeerReadyRE0() { function testOnPeerReadyRE0() {

View File

@ -130,7 +130,7 @@ SystemWorkerManager::Shutdown()
mWifiWorker = nullptr; mWifiWorker = nullptr;
if (mKeyStore) { if (mKeyStore) {
mKeyStore->CloseSocket(); mKeyStore->Shutdown();
mKeyStore = nullptr; mKeyStore = nullptr;
} }

View File

@ -28,12 +28,6 @@ enum NfcErrorMessage {
[NoInterfaceObject] [NoInterfaceObject]
interface MozNFCManager { interface MozNFCManager {
/**
* Returns MozNFCPeer object or null in case of invalid sessionToken
*/
[CheckPermissions="nfc-manager"]
MozNFCPeer? getNFCPeer(DOMString sessionToken);
/** /**
* API to check if the given application's manifest * API to check if the given application's manifest
* URL is registered with the Chrome Process or not. * URL is registered with the Chrome Process or not.
@ -78,7 +72,7 @@ interface MozNFCManager {
[JSImplementation="@mozilla.org/navigatorNfc;1", [JSImplementation="@mozilla.org/navigatorNfc;1",
NavigatorProperty="mozNfc", NavigatorProperty="mozNfc",
Func="Navigator::HasNFCSupport", Func="Navigator::HasNFCSupport",
CheckPermissions="nfc-read nfc-write", CheckPermissions="nfc nfc-share",
AvailableIn="CertifiedApps"] AvailableIn="CertifiedApps"]
interface MozNFC : EventTarget { interface MozNFC : EventTarget {
/** /**
@ -86,32 +80,28 @@ interface MozNFC : EventTarget {
* to share data to the NFCPeer object by calling mozNFC.notifyUserAcceptedP2P. * to share data to the NFCPeer object by calling mozNFC.notifyUserAcceptedP2P.
* The event will be type of NFCPeerEvent. * The event will be type of NFCPeerEvent.
*/ */
[CheckPermissions="nfc-write"] [CheckPermissions="nfc-share"]
attribute EventHandler onpeerready; attribute EventHandler onpeerready;
/** /**
* This event will be fired when a NFCPeer is detected. * This event will be fired when a NFCPeer is detected.
*/ */
[CheckPermissions="nfc-write"]
attribute EventHandler onpeerfound; attribute EventHandler onpeerfound;
/** /**
* This event will be fired when NFCPeer, earlier detected in onpeerready * This event will be fired when NFCPeer, earlier detected in onpeerready
* or onpeerfound, moves out of range. * or onpeerfound, moves out of range.
*/ */
[CheckPermissions="nfc-write"]
attribute EventHandler onpeerlost; attribute EventHandler onpeerlost;
/** /**
* Ths event will be fired when a NFCTag is detected. * Ths event will be fired when a NFCTag is detected.
*/ */
[CheckPermissions="nfc-read nfc-write"]
attribute EventHandler ontagfound; attribute EventHandler ontagfound;
/** /**
* This event will be fired if the tag detected in ontagfound has been removed. * This event will be fired if the tag detected in ontagfound has been removed.
*/ */
[CheckPermissions="nfc-read nfc-write"]
attribute EventHandler ontaglost; attribute EventHandler ontaglost;
}; };

View File

@ -19,7 +19,7 @@ interface MozNFCPeer {
/** /**
* Send file to peer device. * Send file to peer device.
*/ */
[Throws] [Throws, CheckPermissions="nfc-share"]
Promise<void> sendFile(Blob blob); Promise<void> sendFile(Blob blob);
}; };

View File

@ -5,7 +5,7 @@
*/ */
[Constructor(DOMString type, optional MozNFCPeerEventInit eventInitDict), [Constructor(DOMString type, optional MozNFCPeerEventInit eventInitDict),
Func="Navigator::HasNFCSupport", CheckPermissions="nfc-write", Func="Navigator::HasNFCSupport", CheckPermissions="nfc nfc-share",
AvailableIn="CertifiedApps"] AvailableIn="CertifiedApps"]
interface MozNFCPeerEvent : Event interface MozNFCPeerEvent : Event
{ {

View File

@ -5,7 +5,7 @@
*/ */
[Constructor(DOMString type, optional MozNFCTagEventInit eventInitDict), [Constructor(DOMString type, optional MozNFCTagEventInit eventInitDict),
Func="Navigator::HasNFCSupport", CheckPermissions="nfc-read nfc-write", Func="Navigator::HasNFCSupport", CheckPermissions="nfc",
AvailableIn="CertifiedApps"] AvailableIn="CertifiedApps"]
interface MozNFCTagEvent : Event interface MozNFCTagEvent : Event
{ {

View File

@ -1,5 +1,5 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=4 ts=8 et ft=cpp: */ /* vim: set sw=2 ts=2 et ft=cpp: tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public /* 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 * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -369,7 +369,92 @@ KeyStoreConnector::GetSocketAddr(const sockaddr_any& aAddr,
MOZ_CRASH("This should never be called!"); MOZ_CRASH("This should never be called!");
} }
//
// KeyStore::ListenSocket
//
KeyStore::ListenSocket::ListenSocket(KeyStore* aKeyStore)
: mKeyStore(aKeyStore)
{
MOZ_ASSERT(mKeyStore);
MOZ_COUNT_CTOR(KeyStore::ListenSocket);
}
void
KeyStore::ListenSocket::OnConnectSuccess()
{
mKeyStore->OnConnectSuccess(LISTEN_SOCKET);
MOZ_COUNT_DTOR(KeyStore::ListenSocket);
}
void
KeyStore::ListenSocket::OnConnectError()
{
mKeyStore->OnConnectError(LISTEN_SOCKET);
}
void
KeyStore::ListenSocket::OnDisconnect()
{
mKeyStore->OnDisconnect(LISTEN_SOCKET);
}
//
// KeyStore::StreamSocket
//
KeyStore::StreamSocket::StreamSocket(KeyStore* aKeyStore)
: mKeyStore(aKeyStore)
{
MOZ_ASSERT(mKeyStore);
MOZ_COUNT_CTOR(KeyStore::StreamSocket);
}
KeyStore::StreamSocket::~StreamSocket()
{
MOZ_COUNT_DTOR(KeyStore::StreamSocket);
}
void
KeyStore::StreamSocket::OnConnectSuccess()
{
mKeyStore->OnConnectSuccess(STREAM_SOCKET);
}
void
KeyStore::StreamSocket::OnConnectError()
{
mKeyStore->OnConnectError(STREAM_SOCKET);
}
void
KeyStore::StreamSocket::OnDisconnect()
{
mKeyStore->OnDisconnect(STREAM_SOCKET);
}
void
KeyStore::StreamSocket::ReceiveSocketData(
nsAutoPtr<UnixSocketRawData>& aMessage)
{
mKeyStore->ReceiveSocketData(aMessage);
}
ConnectionOrientedSocketIO*
KeyStore::StreamSocket::GetIO()
{
return PrepareAccept(new KeyStoreConnector());
}
//
// KeyStore
//
KeyStore::KeyStore() KeyStore::KeyStore()
: mShutdown(false)
{ {
MOZ_COUNT_CTOR(KeyStore); MOZ_COUNT_CTOR(KeyStore);
::startKeyStoreService(); ::startKeyStoreService();
@ -379,19 +464,45 @@ KeyStore::KeyStore()
KeyStore::~KeyStore() KeyStore::~KeyStore()
{ {
MOZ_COUNT_DTOR(KeyStore); MOZ_COUNT_DTOR(KeyStore);
MOZ_ASSERT(!mListenSocket);
MOZ_ASSERT(!mStreamSocket);
} }
void void
KeyStore::Shutdown() KeyStore::Shutdown()
{ {
// We set mShutdown first, so that |OnDisconnect| won't try to reconnect.
mShutdown = true; mShutdown = true;
CloseSocket();
if (mStreamSocket) {
mStreamSocket->Close();
mStreamSocket = nullptr;
}
if (mListenSocket) {
mListenSocket->Close();
mListenSocket = nullptr;
}
} }
void void
KeyStore::Listen() KeyStore::Listen()
{ {
ListenSocket(new KeyStoreConnector()); // We only allocate one |StreamSocket|, but re-use it for every connection.
if (mStreamSocket) {
mStreamSocket->Close();
} else {
mStreamSocket = new StreamSocket(this);
}
if (!mListenSocket) {
// We only ever allocate one |ListenSocket|...
mListenSocket = new ListenSocket(this);
mListenSocket->Listen(new KeyStoreConnector(), mStreamSocket);
} else {
// ... but keep it open.
mListenSocket->Listen(mStreamSocket);
}
ResetHandlerInfo(); ResetHandlerInfo();
} }
@ -512,25 +623,29 @@ KeyStore::ReadData(UnixSocketRawData *aMessage)
void void
KeyStore::SendResponse(ResponseCode aResponse) KeyStore::SendResponse(ResponseCode aResponse)
{ {
MOZ_ASSERT(mStreamSocket);
if (aResponse == NO_RESPONSE) if (aResponse == NO_RESPONSE)
return; return;
uint8_t response = (uint8_t)aResponse; uint8_t response = (uint8_t)aResponse;
UnixSocketRawData* data = new UnixSocketRawData((const void *)&response, 1); UnixSocketRawData* data = new UnixSocketRawData((const void *)&response, 1);
SendSocketData(data); mStreamSocket->SendSocketData(data);
} }
// Data response // Data response
void void
KeyStore::SendData(const uint8_t *aData, int aLength) KeyStore::SendData(const uint8_t *aData, int aLength)
{ {
MOZ_ASSERT(mStreamSocket);
unsigned short dataLength = htons(aLength); unsigned short dataLength = htons(aLength);
UnixSocketRawData* length = new UnixSocketRawData((const void *)&dataLength, 2); UnixSocketRawData* length = new UnixSocketRawData((const void *)&dataLength, 2);
SendSocketData(length); mStreamSocket->SendSocketData(length);
UnixSocketRawData* data = new UnixSocketRawData((const void *)aData, aLength); UnixSocketRawData* data = new UnixSocketRawData((const void *)aData, aLength);
SendSocketData(data); mStreamSocket->SendSocketData(data);
} }
void void
@ -583,24 +698,43 @@ KeyStore::ReceiveSocketData(nsAutoPtr<UnixSocketRawData>& aMessage)
} }
void void
KeyStore::OnConnectSuccess() KeyStore::OnConnectSuccess(SocketType aSocketType)
{ {
mShutdown = false; if (aSocketType == STREAM_SOCKET) {
mShutdown = false;
}
} }
void void
KeyStore::OnConnectError() KeyStore::OnConnectError(SocketType aSocketType)
{ {
if (!mShutdown) { if (mShutdown) {
return;
}
if (aSocketType == STREAM_SOCKET) {
// Stream socket error; start listening again
Listen(); Listen();
} }
} }
void void
KeyStore::OnDisconnect() KeyStore::OnDisconnect(SocketType aSocketType)
{ {
if (!mShutdown) { if (mShutdown) {
Listen(); return;
}
switch (aSocketType) {
case LISTEN_SOCKET:
// Listen socket disconnected; start anew.
mListenSocket = nullptr;
Listen();
break;
case STREAM_SOCKET:
// Stream socket disconnected; start listening again.
Listen();
break;
} }
} }

View File

@ -1,5 +1,5 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et ft=cpp: */ /* vim: set sw=2 ts=2 et ft=cpp: tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public /* 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 * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -7,11 +7,12 @@
#ifndef mozilla_ipc_KeyStore_h #ifndef mozilla_ipc_KeyStore_h
#define mozilla_ipc_KeyStore_h 1 #define mozilla_ipc_KeyStore_h 1
#include "mozilla/ipc/UnixSocket.h"
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/un.h> #include <sys/un.h>
#include "cert.h" #include "cert.h"
#include "mozilla/ipc/ListenSocket.h"
#include "mozilla/ipc/StreamSocket.h"
#include "mozilla/ipc/UnixSocketConnector.h"
namespace mozilla { namespace mozilla {
namespace ipc { namespace ipc {
@ -94,21 +95,69 @@ public:
nsAString& aAddrStr); nsAString& aAddrStr);
}; };
class KeyStore : public mozilla::ipc::UnixSocketConsumer class KeyStore MOZ_FINAL
{ {
public: public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(KeyStore)
KeyStore(); KeyStore();
void Shutdown(); void Shutdown();
private: private:
virtual ~KeyStore(); enum SocketType {
LISTEN_SOCKET,
STREAM_SOCKET
};
virtual void ReceiveSocketData(nsAutoPtr<UnixSocketRawData>& aMessage); class ListenSocket MOZ_FINAL : public mozilla::ipc::ListenSocket
{
public:
ListenSocket(KeyStore* aKeyStore);
ListenSocket();
virtual void OnConnectSuccess(); // SocketBase
virtual void OnConnectError(); //
virtual void OnDisconnect();
void OnConnectSuccess() MOZ_OVERRIDE;
void OnConnectError() MOZ_OVERRIDE;
void OnDisconnect() MOZ_OVERRIDE;
private:
KeyStore* mKeyStore;
};
class StreamSocket MOZ_FINAL : public mozilla::ipc::StreamSocket
{
public:
StreamSocket(KeyStore* aKeyStore);
~StreamSocket();
// SocketConsumerBase
//
void OnConnectSuccess() MOZ_OVERRIDE;
void OnConnectError() MOZ_OVERRIDE;
void OnDisconnect() MOZ_OVERRIDE;
void ReceiveSocketData(nsAutoPtr<UnixSocketRawData>& aMessage) MOZ_OVERRIDE;
// ConnectionOrientedSocket
//
ConnectionOrientedSocketIO* GetIO() MOZ_OVERRIDE;
private:
KeyStore* mKeyStore;
};
~KeyStore();
void ReceiveSocketData(nsAutoPtr<UnixSocketRawData>& aMessage);
void OnConnectSuccess(enum SocketType aSocketType);
void OnConnectError(enum SocketType aSocketType);
void OnDisconnect(enum SocketType aSocketType);
struct { struct {
ProtocolHandlerState state; ProtocolHandlerState state;
@ -128,6 +177,9 @@ private:
void SendData(const uint8_t *data, int length); void SendData(const uint8_t *data, int length);
bool mShutdown; bool mShutdown;
nsRefPtr<ListenSocket> mListenSocket;
nsRefPtr<StreamSocket> mStreamSocket;
}; };
} // namespace ipc } // namespace ipc

View File

@ -37,8 +37,16 @@ specialpowers.specialPowersObserver.init();
Cu.import("resource://gre/modules/FileUtils.jsm"); Cu.import("resource://gre/modules/FileUtils.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm"); Cu.import("resource://gre/modules/NetUtil.jsm");
function isMulet() {
let isMulet = false;
try {
isMulet = Services.prefs.getBoolPref("b2g.is_mulet");
} catch (ex) { }
return isMulet;
}
Services.prefs.setBoolPref("marionette.contentListener", false); Services.prefs.setBoolPref("marionette.contentListener", false);
let appName = Services.appinfo.name; let appName = isMulet() ? "B2G" : Services.appinfo.name;
let { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {}); let { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
let DevToolsUtils = devtools.require("devtools/toolkit/DevToolsUtils.js"); let DevToolsUtils = devtools.require("devtools/toolkit/DevToolsUtils.js");
@ -2943,10 +2951,9 @@ BrowserObj.prototype = {
setBrowser: function BO_setBrowser(win) { setBrowser: function BO_setBrowser(win) {
switch (appName) { switch (appName) {
case "Firefox": case "Firefox":
if (this.window.location.href.indexOf("chrome://b2g") == -1) { if (!isMulet()) {
this.browser = win.gBrowser; this.browser = win.gBrowser;
} } else {
else {
// this is Mulet // this is Mulet
appName = "B2G"; appName = "B2G";
} }