CLOSED TREE
This commit is contained in:
Ryan VanderMeulen 2015-04-07 16:23:24 -04:00
Родитель e05c60dc2e 5c8e4ce59e
Коммит 26300728c8
135 изменённых файлов: 1675 добавлений и 860 удалений

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

@ -27,3 +27,4 @@ testing, may be buggy. Firefox nightlies, for example, can be found at:
http://nightly.mozilla.org/
>>

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

@ -17,8 +17,6 @@
"bing.com": "\\(Mobile#(Android; Mobile",
// bug 827626, magazineluiza.com.br
"magazineluiza.com.br": "\\(Mobile#(Android; Mobile",
// bug 827628, groupon.com.br
"groupon.com.br": "\\(Mobile#(Android; Mobile",
// bug 827633, hao123.com
"hao123.com": "\\(Mobile#(Android; Mobile",
// bug 827573, webmotors.com.br

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

@ -25,6 +25,10 @@ XPCOMUtils.defineLazyServiceGetter(this, "appsService",
XPCOMUtils.defineLazyModuleGetter(this, "SystemAppProxy",
"resource://gre/modules/SystemAppProxy.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "notificationStorage",
"@mozilla.org/notificationStorage;1",
"nsINotificationStorage");
XPCOMUtils.defineLazyGetter(this, "ppmm", function() {
return Cc["@mozilla.org/parentprocessmessagemanager;1"]
.getService(Ci.nsIMessageListenerManager);
@ -157,10 +161,13 @@ let AlertsHelper = {
);
}
}
if (detail.type === kDesktopNotificationClose && listener.dbId) {
notificationStorage.delete(listener.manifestURL, listener.dbId);
}
}
// we"re done with this notification
if (topic === kTopicAlertFinished) {
if (detail.type === kDesktopNotificationClose) {
delete this._listeners[uid];
}
},
@ -285,6 +292,7 @@ let AlertsHelper = {
imageURL: data.imageURL,
lang: details.lang || undefined,
id: details.id || undefined,
dbId: details.dbId || undefined,
dir: details.dir || undefined,
tag: details.tag || undefined,
timestamp: details.timestamp || undefined,

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

@ -154,7 +154,6 @@ AlertsService.prototype = {
dir: listener.dir,
id: listener.id,
tag: listener.tag,
dbId: listener.dbId,
timestamp: listener.timestamp,
data: listener.dataObj || undefined,
},

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c710bac533b76635161315bf907d004e000549cb"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="84cbd4391fb7175d5380fa72c04d68873ce77e6d"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2aa4a75c63cd6e93870a8bddbba45f863cbfd9a3"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c710bac533b76635161315bf907d004e000549cb"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="84cbd4391fb7175d5380fa72c04d68873ce77e6d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2aa4a75c63cd6e93870a8bddbba45f863cbfd9a3"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>

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

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c710bac533b76635161315bf907d004e000549cb"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="84cbd4391fb7175d5380fa72c04d68873ce77e6d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2aa4a75c63cd6e93870a8bddbba45f863cbfd9a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ed2cf97a6c37a4bbd0bbbbffe06ec7136d8c79ff"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="1b1d86462d3150dceacff927536ded9fcc168419"/>
@ -135,7 +135,7 @@
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="c5f8d282efe4a4e8b1e31a37300944e338e60e4f"/>
<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="9f28c4faea3b2f01db227b2467b08aeba96d9bec"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="306b3290ea22211397d3daf49a42258f4638e4b7"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="eb5edebf1c1c17ce7f325df388fed082ca788def"/>
<project name="android-sdk" path="sdk" remote="b2g" revision="8b1365af38c9a653df97349ee53a3f5d64fd590a"/>
<project name="darwinstreamingserver" path="system/darwinstreamingserver" remote="b2g" revision="cf85968c7f85e0ec36e72c87ceb4837a943b8af6"/>
</manifest>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c710bac533b76635161315bf907d004e000549cb"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="84cbd4391fb7175d5380fa72c04d68873ce77e6d"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2aa4a75c63cd6e93870a8bddbba45f863cbfd9a3"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="52775e03a2d8532429dff579cb2cd56718e488c3">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c710bac533b76635161315bf907d004e000549cb"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="84cbd4391fb7175d5380fa72c04d68873ce77e6d"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2aa4a75c63cd6e93870a8bddbba45f863cbfd9a3"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="c710bac533b76635161315bf907d004e000549cb"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="84cbd4391fb7175d5380fa72c04d68873ce77e6d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2aa4a75c63cd6e93870a8bddbba45f863cbfd9a3"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c710bac533b76635161315bf907d004e000549cb"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="84cbd4391fb7175d5380fa72c04d68873ce77e6d"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2aa4a75c63cd6e93870a8bddbba45f863cbfd9a3"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -128,7 +128,7 @@
<project name="device-flame" path="device/t2m/flame" remote="b2g" revision="b83fc73de7b64594cd74b33e498bf08332b5d87b"/>
<project name="codeaurora_kernel_msm" path="kernel" remote="b2g" revision="0865bc4134b67220df4058625fba29305d6b10c3"/>
<project name="kernel_lk" path="bootable/bootloader/lk" remote="b2g" revision="fda40423ffa573dc6cafd3780515010cb2a086be"/>
<project name="platform_bootable_recovery" path="bootable/recovery" remote="b2g" revision="26e78a979f3090dc196219e268467620b6c40ec5"/>
<project name="platform_bootable_recovery" path="bootable/recovery" remote="b2g" revision="d5e53ed6f22fa06052351dc03510af9473af01ea"/>
<project name="platform/external/bluetooth/bluedroid" path="external/bluetooth/bluedroid" revision="d61fc97258c8b0c362430dd2eb195dcc4d266f14"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="5b71e40213f650459e95d35b6f14af7e88d8ab62"/>
<project name="platform_external_libnfc-nci" path="external/libnfc-nci" remote="t2m" revision="4186bdecb4dae911b39a8202252cc2310d91b0be"/>
@ -146,7 +146,7 @@
<project name="platform/hardware/ril" path="hardware/ril" revision="12b1977cc704b35f2e9db2bb423fa405348bc2f3"/>
<project name="platform/system/bluetooth" path="system/bluetooth" revision="985bf15264d865fe7b9c5b45f61c451cbaafa43d"/>
<project name="platform/system/core" path="system/core" revision="42839aedcf70bf6bc92a3b7ea4a5cc9bf9aef3f9"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="306b3290ea22211397d3daf49a42258f4638e4b7"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="eb5edebf1c1c17ce7f325df388fed082ca788def"/>
<project name="platform/system/qcom" path="system/qcom" revision="63e3f6f176caad587d42bba4c16b66d953fb23c2"/>
<project name="platform/vendor/qcom-opensource/wlan/prima" path="vendor/qcom/opensource/wlan/prima" revision="d8952a42771045fca73ec600e2b42a4c7129d723"/>
<project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="4c187c1f3a0dffd8e51a961735474ea703535b99"/>

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

@ -17,7 +17,7 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c710bac533b76635161315bf907d004e000549cb"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="84cbd4391fb7175d5380fa72c04d68873ce77e6d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2aa4a75c63cd6e93870a8bddbba45f863cbfd9a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ed2cf97a6c37a4bbd0bbbbffe06ec7136d8c79ff"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="1b1d86462d3150dceacff927536ded9fcc168419"/>
@ -145,7 +145,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="adc485d8755af6a61641d197de7cfef667722580"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="306b3290ea22211397d3daf49a42258f4638e4b7"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="eb5edebf1c1c17ce7f325df388fed082ca788def"/>
<project name="platform/system/qcom" path="system/qcom" revision="1cdab258b15258b7f9657da70e6f06ebd5a2fc25"/>
<project name="platform/vendor/qcom/msm8610" path="device/qcom/msm8610" revision="4ae5df252123591d5b941191790e7abed1bce5a4"/>
<project name="platform/vendor/qcom-opensource/wlan/prima" path="vendor/qcom/opensource/wlan/prima" revision="ce18b47b4a4f93a581d672bbd5cb6d12fe796ca9"/>

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

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "c710bac533b76635161315bf907d004e000549cb",
"git_revision": "84cbd4391fb7175d5380fa72c04d68873ce77e6d",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "89ec488d9617c749588db3c2e283debfa2f95596",
"revision": "a7d22a159f8c412c7d8ebb371025b17563265c06",
"repo_path": "integration/gaia-central"
}

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

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c710bac533b76635161315bf907d004e000549cb"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="84cbd4391fb7175d5380fa72c04d68873ce77e6d"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2aa4a75c63cd6e93870a8bddbba45f863cbfd9a3"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="ed2cf97a6c37a4bbd0bbbbffe06ec7136d8c79ff"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="1b1d86462d3150dceacff927536ded9fcc168419"/>
@ -130,7 +130,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="306b3290ea22211397d3daf49a42258f4638e4b7"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="eb5edebf1c1c17ce7f325df388fed082ca788def"/>
<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"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="52775e03a2d8532429dff579cb2cd56718e488c3">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="c710bac533b76635161315bf907d004e000549cb"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="84cbd4391fb7175d5380fa72c04d68873ce77e6d"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2aa4a75c63cd6e93870a8bddbba45f863cbfd9a3"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -156,5 +156,5 @@
<project name="platform/hardware/qcom/sensors" path="hardware/qcom/sensors" revision="3724fd91ef5183684d97e2bf1d7ff948faabe090"/>
<project name="platform/hardware/qcom/wlan" path="hardware/qcom/wlan" revision="2e54754cc0529d26ccac37ed291600048adbf6c0"/>
<project name="platform/hardware/ril" path="hardware/ril" revision="71dfa8228ad0d6cdf6bac0426ac59404ab74b7f3"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="306b3290ea22211397d3daf49a42258f4638e4b7"/>
<project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="eb5edebf1c1c17ce7f325df388fed082ca788def"/>
</manifest>

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

@ -87,46 +87,60 @@
<!-- Fonts and Colors -->
<groupbox id="fontsGroup" data-category="paneContent" hidden="true">
<caption><label>&fontsAndColors.label;</label></caption>
<hbox align="center">
<label control="defaultFont" accesskey="&defaultFont.accesskey;">&defaultFont.label;</label>
<menulist id="defaultFont" flex="1"/>
<label id="defaultFontSizeLabel" control="defaultFontSize" accesskey="&defaultSize.accesskey;">&defaultSize.label;</label>
<menulist id="defaultFontSize">
<menupopup>
<menuitem value="9" label="9"/>
<menuitem value="10" label="10"/>
<menuitem value="11" label="11"/>
<menuitem value="12" label="12"/>
<menuitem value="13" label="13"/>
<menuitem value="14" label="14"/>
<menuitem value="15" label="15"/>
<menuitem value="16" label="16"/>
<menuitem value="17" label="17"/>
<menuitem value="18" label="18"/>
<menuitem value="20" label="20"/>
<menuitem value="22" label="22"/>
<menuitem value="24" label="24"/>
<menuitem value="26" label="26"/>
<menuitem value="28" label="28"/>
<menuitem value="30" label="30"/>
<menuitem value="32" label="32"/>
<menuitem value="34" label="34"/>
<menuitem value="36" label="36"/>
<menuitem value="40" label="40"/>
<menuitem value="44" label="44"/>
<menuitem value="48" label="48"/>
<menuitem value="56" label="56"/>
<menuitem value="64" label="64"/>
<menuitem value="72" label="72"/>
</menupopup>
</menulist>
<button id="advancedFonts" icon="select-font"
label="&advancedFonts.label;"
accesskey="&advancedFonts.accesskey;"/>
<button id="colors" icon="select-color"
label="&colors.label;"
accesskey="&colors.accesskey;"/>
</hbox>
<grid id="fontsGrid">
<columns>
<column flex="1"/>
<column/>
</columns>
<rows id="fontsRows">
<row id="fontRow">
<hbox align="center">
<label control="defaultFont" accesskey="&defaultFont.accesskey;">&defaultFont.label;</label>
<menulist id="defaultFont" />
<label id="defaultFontSizeLabel" control="defaultFontSize" accesskey="&defaultSize.accesskey;">&defaultSize.label;</label>
<menulist id="defaultFontSize">
<menupopup>
<menuitem value="9" label="9"/>
<menuitem value="10" label="10"/>
<menuitem value="11" label="11"/>
<menuitem value="12" label="12"/>
<menuitem value="13" label="13"/>
<menuitem value="14" label="14"/>
<menuitem value="15" label="15"/>
<menuitem value="16" label="16"/>
<menuitem value="17" label="17"/>
<menuitem value="18" label="18"/>
<menuitem value="20" label="20"/>
<menuitem value="22" label="22"/>
<menuitem value="24" label="24"/>
<menuitem value="26" label="26"/>
<menuitem value="28" label="28"/>
<menuitem value="30" label="30"/>
<menuitem value="32" label="32"/>
<menuitem value="34" label="34"/>
<menuitem value="36" label="36"/>
<menuitem value="40" label="40"/>
<menuitem value="44" label="44"/>
<menuitem value="48" label="48"/>
<menuitem value="56" label="56"/>
<menuitem value="64" label="64"/>
<menuitem value="72" label="72"/>
</menupopup>
</menulist>
</hbox>
<button id="advancedFonts" icon="select-font"
label="&advancedFonts.label;"
accesskey="&advancedFonts.accesskey;"/>
</row>
<row id="colorsRow">
<hbox/>
<button id="colors" icon="select-color"
label="&colors.label;"
accesskey="&colors.accesskey;"/>
</row>
</rows>
</grid>
</groupbox>
<!-- Languages -->

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

@ -133,7 +133,7 @@
<deck id="historyPane">
<vbox id="historyRememberPane">
<hbox align="center" flex="1">
<vbox>
<vbox flex="1">
<description>&rememberDescription.label;</description>
<separator class="thin"/>
<description>&rememberActions.pre.label;<html:a
@ -146,7 +146,7 @@
</vbox>
<vbox id="historyDontRememberPane">
<hbox align="center" flex="1">
<vbox>
<vbox flex="1">
<description>&dontrememberDescription.label;</description>
<separator class="thin"/>
<description>&dontrememberActions.pre.label;<html:a

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

@ -144,8 +144,8 @@ ServerClient.prototype = {
result.body = JSON.parse(response.body);
}
} catch (e) {
log.info("Failed to parse JSON body |${body}|: ${e}",
{body: response.body, e});
log.debug("Response is not JSON. First 1024 chars: |${body}|",
{ body: response.body.substr(0, 1024) });
// We don't reject due to this (and don't even make a huge amount of
// log noise - eg, a 50X error from a load balancer etc may not write
// JSON.

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

@ -469,7 +469,10 @@ let RLSidebar = {
this.activeItem = null;
} else {
ReadingList.itemForURL(msg.url).then(item => {
this.activeItem = this.itemNodesById.get(item.id);
let node;
if (item && (node = this.itemNodesById.get(item.id))) {
this.activeItem = node;
}
});
}
}

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

@ -47,13 +47,13 @@ devtools.lazyRequireGetter(this, "JITOptimizations",
"devtools/shared/profiler/jit", true);
devtools.lazyRequireGetter(this, "OptionsView",
"devtools/shared/options-view", true);
devtools.lazyRequireGetter(this, "FlameGraphUtils",
"devtools/shared/widgets/FlameGraph", true);
devtools.lazyRequireGetter(this, "FlameGraph",
"devtools/shared/widgets/FlameGraph", true);
devtools.lazyImporter(this, "CanvasGraphUtils",
"resource:///modules/devtools/Graphs.jsm");
devtools.lazyImporter(this, "FlameGraphUtils",
"resource:///modules/devtools/FlameGraph.jsm");
devtools.lazyImporter(this, "FlameGraph",
"resource:///modules/devtools/FlameGraph.jsm");
devtools.lazyImporter(this, "SideMenuWidget",
"resource:///modules/devtools/SideMenuWidget.jsm");
devtools.lazyImporter(this, "PluralForm",

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

@ -42,6 +42,7 @@ support-files =
[browser_perf-front-01.js]
[browser_perf-front-02.js]
[browser_perf-jit-view-01.js]
[browser_perf-jit-view-02.js]
[browser_perf-jit-model-01.js]
[browser_perf-jit-model-02.js]
[browser_perf-jump-to-debugger-01.js]

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

@ -30,7 +30,7 @@ function spawnTest () {
yield injectAndRenderProfilerData();
yield checkFrame(1, [0, 1]);
yield checkFrame(2, [1]);
yield checkFrame(2, [2]);
yield checkFrame(3);
let select = once(PerformanceController, EVENTS.RECORDING_SELECTED);
@ -80,6 +80,18 @@ function spawnTest () {
ok(!isEmpty, "JIT Optimizations view has no empty message.");
}
// Get the frame info for the first opt site, since all opt sites
// share the same frame info
let frameInfo = gOpts[expectedOptsIndex[0]]._testFrameInfo;
let { $headerName, $headerLine, $headerFile } = JITOptimizationsView;
ok(!$headerName.hidden, "header function name should be shown");
ok(!$headerLine.hidden, "header line should be shown");
ok(!$headerFile.hidden, "header file should be shown");
is($headerName.textContent, frameInfo.name, "correct header function name.");
is($headerLine.textContent, frameInfo.line, "correct header line");
is($headerFile.textContent, frameInfo.file, "correct header file");
// Need the value of the optimizations in its array, as its
// an index used internally by the view to uniquely ID the opt
for (let i of expectedOptsIndex) {
@ -95,9 +107,9 @@ function spawnTest () {
"found an ion type row");
}
// The second optimization should display optimization failures.
// The second and third optimization should display optimization failures.
let warningIcon = $(`.tree-widget-container li[data-id='["${i}"]'] .opt-icon[severity=warning]`);
if (i === 1) {
if (i === 1 || i === 2) {
ok(warningIcon, "did find a warning icon for all strategies failing.");
} else {
ok(!warningIcon, "did not find a warning icon for no successful strategies");
@ -111,7 +123,7 @@ let gSamples = [{
frames: [
{ location: "(root)" },
{ location: "A (http://foo/bar/baz:12)", optsIndex: 0 },
{ location: "B (http://foo/bar/baz:34)", optsIndex: 1 },
{ location: "B (http://foo/bar/boo:34)", optsIndex: 2 },
{ location: "C (http://foo/bar/baz:56)" }
]
}, {
@ -119,14 +131,14 @@ let gSamples = [{
frames: [
{ location: "(root)" },
{ location: "A (http://foo/bar/baz:12)" },
{ location: "B (http://foo/bar/baz:34)" },
{ location: "B (http://foo/bar/boo:34)" },
]
}, {
time: 5 + 1 + 2,
frames: [
{ location: "(root)" },
{ location: "A (http://foo/bar/baz:12)", optsIndex: 1 },
{ location: "B (http://foo/bar/baz:34)" },
{ location: "B (http://foo/bar/boo:34)" },
]
}, {
time: 5 + 1 + 2 + 7,
@ -140,6 +152,7 @@ let gSamples = [{
// Array of OptimizationSites
let gOpts = [{
_testFrameInfo: { name: "A", line: "12", file: "@baz" },
line: 12,
column: 2,
types: [{ mirType: "Object", site: "A (http://foo/bar/bar:12)", types: [
@ -152,6 +165,16 @@ let gOpts = [{
{ outcome: "Inlined", strategy: "SomeGetter3" },
]
}, {
_testFrameInfo: { name: "A", line: "12", file: "@baz" },
line: 12,
types: [{ mirType: "Int32", site: "Receiver" }], // use no types
attempts: [
{ outcome: "Failure1", strategy: "SomeGetter1" },
{ outcome: "Failure2", strategy: "SomeGetter2" },
{ outcome: "Failure3", strategy: "SomeGetter3" },
]
}, {
_testFrameInfo: { name: "B", line: "34", file: "@boo" },
line: 34,
types: [{ mirType: "Int32", site: "Receiver" }], // use no types
attempts: [

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

@ -0,0 +1,109 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that the JIT Optimizations view does not display information
* for meta nodes when viewing "content only".
*/
let { CATEGORY_MASK } = devtools.require("devtools/shared/profiler/global");
Services.prefs.setBoolPref(INVERT_PREF, false);
Services.prefs.setBoolPref(PLATFORM_DATA_PREF, false);
function spawnTest () {
let { panel } = yield initPerformance(SIMPLE_URL);
let { EVENTS, $, $$, window, PerformanceController } = panel.panelWin;
let { OverviewView, DetailsView, JITOptimizationsView, JsCallTreeView, RecordingsView } = panel.panelWin;
let profilerData = { threads: [{samples: gSamples, optimizations: gOpts}] };
is(Services.prefs.getBoolPref(JIT_PREF), false, "show JIT Optimizations pref off by default");
// Make two recordings, so we have one to switch to later, as the
// second one will have fake sample data
yield startRecording(panel);
yield stopRecording(panel);
yield startRecording(panel);
yield stopRecording(panel);
yield DetailsView.selectView("js-calltree");
yield injectAndRenderProfilerData();
Services.prefs.setBoolPref(JIT_PREF, true);
// Click the frame
let rendered = once(JITOptimizationsView, EVENTS.OPTIMIZATIONS_RENDERED);
mousedown(window, $$(".call-tree-item")[2]);
yield rendered;
ok($("#jit-optimizations-view").classList.contains("empty"),
"platform meta frame shows as empty");
let { $headerName, $headerLine, $headerFile } = JITOptimizationsView;
ok(!$headerName.hidden, "header function name should be shown");
ok($headerLine.hidden, "header line should be hidden");
ok($headerFile.hidden, "header file should be hidden");
is($headerName.textContent, "JIT", "correct header function name.");
is($headerLine.textContent, "", "correct header line (empty string).");
is($headerFile.textContent, "", "correct header file (empty string).");
yield teardown(panel);
finish();
function *injectAndRenderProfilerData() {
// Get current recording and inject our mock data
info("Injecting mock profile data");
let recording = PerformanceController.getCurrentRecording();
recording._profile = profilerData;
// Force a rerender
let rendered = once(JsCallTreeView, EVENTS.JS_CALL_TREE_RENDERED);
JsCallTreeView.render();
yield rendered;
Services.prefs.setBoolPref(JIT_PREF, true);
ok($("#jit-optimizations-view").classList.contains("empty"),
"JIT Optimizations view has empty message when no frames selected.");
Services.prefs.setBoolPref(JIT_PREF, false);
}
}
let gSamples = [{
time: 5,
frames: [
{ location: "(root)" },
{ location: "A (http://foo/bar/baz:12)", optsIndex: 0 }
]
}, {
time: 5 + 1,
frames: [
{ location: "(root)" },
{ location: "A (http://foo/bar/baz:12)", optsIndex: 0 },
{ location: "JS", optsIndex: 1, category: CATEGORY_MASK("js") },
]
}];
// Array of OptimizationSites
let gOpts = [{
line: 12,
column: 2,
types: [{ mirType: "Object", site: "A (http://foo/bar/bar:12)", types: [
{ keyedBy: "constructor", name: "Foo", location: "A (http://foo/bar/baz:12)" },
{ keyedBy: "primitive", location: "self-hosted" }
]}],
attempts: [
{ outcome: "Failure1", strategy: "SomeGetter1" },
{ outcome: "Failure2", strategy: "SomeGetter2" },
{ outcome: "Inlined", strategy: "SomeGetter3" },
]
}, {
line: 22,
types: [{ mirType: "Int32", site: "Receiver" }], // use no types
attempts: [
{ outcome: "Failure1", strategy: "SomeGetter1" },
{ outcome: "Failure2", strategy: "SomeGetter2" },
{ outcome: "Failure3", strategy: "SomeGetter3" },
]
}];

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

@ -24,10 +24,13 @@ let JsFlameGraphView = Heritage.extend(DetailsSubview, {
this.graph = new FlameGraph($("#js-flamegraph-view"));
this.graph.timelineTickUnits = L10N.getStr("graphs.ms");
this.graph.setTheme(PerformanceController.getTheme());
yield this.graph.ready();
this._onRangeChangeInGraph = this._onRangeChangeInGraph.bind(this);
this._onThemeChanged = this._onThemeChanged.bind(this);
PerformanceController.on(EVENTS.THEME_CHANGED, this._onThemeChanged);
this.graph.on("selecting", this._onRangeChangeInGraph);
}),
@ -37,6 +40,7 @@ let JsFlameGraphView = Heritage.extend(DetailsSubview, {
destroy: Task.async(function* () {
DetailsSubview.destroy.call(this);
PerformanceController.off(EVENTS.THEME_CHANGED, this._onThemeChanged);
this.graph.off("selecting", this._onRangeChangeInGraph);
yield this.graph.destroy();
@ -93,5 +97,13 @@ let JsFlameGraphView = Heritage.extend(DetailsSubview, {
FlameGraphUtils.removeFromCache(samples);
},
/**
* Called when `devtools.theme` changes.
*/
_onThemeChanged: function (_, theme) {
this.graph.setTheme(theme);
this.graph.refresh({ force: true });
},
toString: () => "[object JsFlameGraphView]"
});

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

@ -23,10 +23,13 @@ let MemoryFlameGraphView = Heritage.extend(DetailsSubview, {
this.graph = new FlameGraph($("#memory-flamegraph-view"));
this.graph.timelineTickUnits = L10N.getStr("graphs.ms");
this.graph.setTheme(PerformanceController.getTheme());
yield this.graph.ready();
this._onRangeChangeInGraph = this._onRangeChangeInGraph.bind(this);
this._onThemeChanged = this._onThemeChanged.bind(this);
PerformanceController.on(EVENTS.THEME_CHANGED, this._onThemeChanged);
this.graph.on("selecting", this._onRangeChangeInGraph);
}),
@ -36,6 +39,7 @@ let MemoryFlameGraphView = Heritage.extend(DetailsSubview, {
destroy: Task.async(function* () {
DetailsSubview.destroy.call(this);
PerformanceController.off(EVENTS.THEME_CHANGED, this._onThemeChanged);
this.graph.off("selecting", this._onRangeChangeInGraph);
yield this.graph.destroy();
@ -91,5 +95,13 @@ let MemoryFlameGraphView = Heritage.extend(DetailsSubview, {
FlameGraphUtils.removeFromCache(samples);
},
/**
* Called when `devtools.theme` changes.
*/
_onThemeChanged: function (_, theme) {
this.graph.setTheme(theme);
this.graph.refresh({ force: true });
},
toString: () => "[object MemoryFlameGraphView]"
});

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

@ -27,6 +27,9 @@ let JITOptimizationsView = {
this._toggleVisibility = this._toggleVisibility.bind(this);
this.el = $("#jit-optimizations-view");
this.$headerName = $("#jit-optimizations-header .header-function-name");
this.$headerFile = $("#jit-optimizations-header .header-file");
this.$headerLine = $("#jit-optimizations-header .header-line");
this.tree = new TreeWidget($("#jit-optimizations-raw-view"), {
sorted: false,
@ -48,6 +51,7 @@ let JITOptimizationsView = {
*/
destroy: function () {
this.tree = null;
this.$headerName = this.$headerFile = this.$headerLine = this.el = null;
PerformanceController.off(EVENTS.RECORDING_SELECTED, this.reset);
PerformanceController.off(EVENTS.PREF_CHANGED, this._toggleVisibility);
JsCallTreeView.off("focus", this._onFocusFrame);
@ -125,7 +129,9 @@ let JITOptimizationsView = {
this._setHeaders(frameData);
this.clear();
if (!frameNode.hasOptimizations()) {
// If this frame node does not have optimizations, or if its a meta node in the
// case of only showing content, reset the view.
if (!frameNode.hasOptimizations() || frameNode.isMetaCategory) {
this.reset();
return;
}
@ -335,7 +341,8 @@ let JITOptimizationsView = {
node.setAttribute("tooltiptext", URL_LABEL_TOOLTIP + " → " + url);
node.addEventListener("click", () => viewSourceInDebugger(url, line));
}
node.textContent = `@${fileName || url}`;
fileName = fileName || url || "";
node.textContent = fileName ? `@${fileName}` : "";
return node;
},
@ -344,9 +351,17 @@ let JITOptimizationsView = {
*/
_setHeaders: function (frameData) {
$("#jit-optimizations-header .header-function-name").textContent = frameData.functionName;
this._createDebuggerLinkNode(frameData.url, frameData.line, $("#jit-optimizations-header .header-file"));
$("#jit-optimizations-header .header-line").textContent = frameData.line;
let isMeta = frameData.isMetaCategory;
let name = isMeta ? frameData.categoryData.label : frameData.functionName;
let url = isMeta ? "" : frameData.url;
let line = isMeta ? "" : frameData.line;
this.$headerName.textContent = name;
this.$headerLine.textContent = line;
this._createDebuggerLinkNode(url, line, this.$headerFile);
this.$headerLine.hidden = isMeta;
this.$headerFile.hidden = isMeta;
},
/**

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

@ -21,7 +21,6 @@ EXTRA_JS_MODULES.devtools += [
'widgets/AbstractTreeItem.jsm',
'widgets/BreadcrumbsWidget.jsm',
'widgets/Chart.jsm',
'widgets/FlameGraph.jsm',
'widgets/Graphs.jsm',
'widgets/GraphsWorker.js',
'widgets/SideMenuWidget.jsm',
@ -65,6 +64,7 @@ EXTRA_JS_MODULES.devtools.shared.widgets += [
'widgets/CubicBezierPresets.js',
'widgets/CubicBezierWidget.js',
'widgets/FastListWidget.js',
'widgets/FlameGraph.js',
'widgets/Spectrum.js',
'widgets/TableWidget.js',
'widgets/Tooltip.js',

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

@ -3,7 +3,7 @@
// Tests that flame graph widget works properly.
let {FlameGraph} = Cu.import("resource:///modules/devtools/FlameGraph.jsm", {});
let {FlameGraph} = devtools.require("devtools/shared/widgets/FlameGraph");
let {Promise} = devtools.require("resource://gre/modules/Promise.jsm");
add_task(function*() {

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

@ -3,7 +3,7 @@
// Tests that flame graph widgets may have a fixed width or height.
let {FlameGraph} = Cu.import("resource:///modules/devtools/FlameGraph.jsm", {});
let {FlameGraph} = devtools.require("devtools/shared/widgets/FlameGraph");
let {Promise} = devtools.require("resource://gre/modules/Promise.jsm");
add_task(function*() {

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

@ -8,7 +8,7 @@ let TEST_BOUNDS = { startTime: 0, endTime: 150 };
let TEST_WIDTH = 200;
let TEST_HEIGHT = 100;
let {FlameGraph} = Cu.import("resource:///modules/devtools/FlameGraph.jsm", {});
let {FlameGraph} = devtools.require("devtools/shared/widgets/FlameGraph");
let {Promise} = devtools.require("resource://gre/modules/Promise.jsm");
add_task(function*() {

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

@ -9,7 +9,7 @@ let TEST_WIDTH = 200;
let TEST_HEIGHT = 100;
let TEST_DPI_DENSITIY = 2;
let {FlameGraph} = Cu.import("resource:///modules/devtools/FlameGraph.jsm", {});
let {FlameGraph} = devtools.require("devtools/shared/widgets/FlameGraph");
let {Promise} = devtools.require("resource://gre/modules/Promise.jsm");
add_task(function*() {

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

@ -9,7 +9,7 @@ let TEST_WIDTH = 200;
let TEST_HEIGHT = 100;
let TEST_DPI_DENSITIY = 2;
let {FlameGraph} = Cu.import("resource:///modules/devtools/FlameGraph.jsm", {});
let {FlameGraph} = devtools.require("devtools/shared/widgets/FlameGraph");
let {Promise} = devtools.require("resource://gre/modules/Promise.jsm");
add_task(function*() {

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

@ -4,10 +4,10 @@
// Tests that text metrics in the flame graph widget work properly.
let HTML_NS = "http://www.w3.org/1999/xhtml";
let FLAME_GRAPH_BLOCK_TEXT_FONT_SIZE = 8; // px
let FLAME_GRAPH_BLOCK_TEXT_FONT_SIZE = 9; // px
let FLAME_GRAPH_BLOCK_TEXT_FONT_FAMILY = "sans-serif";
let {ViewHelpers} = Cu.import("resource:///modules/devtools/ViewHelpers.jsm", {});
let {FlameGraph} = Cu.import("resource:///modules/devtools/FlameGraph.jsm", {});
let {FlameGraph} = devtools.require("devtools/shared/widgets/FlameGraph");
let {Promise} = devtools.require("resource://gre/modules/Promise.jsm");
let L10N = new ViewHelpers.L10N();

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

@ -4,7 +4,7 @@
// Tests that text metrics and data conversion from profiler samples
// widget work properly in the flame graph.
let {FlameGraphUtils} = Cu.import("resource:///modules/devtools/FlameGraph.jsm", {});
let {FlameGraphUtils, FLAME_GRAPH_BLOCK_HEIGHT} = devtools.require("devtools/shared/widgets/FlameGraph");
add_task(function*() {
yield promiseTab("about:blank");
@ -111,7 +111,7 @@ let EXPECTED_OUTPUT = [{
x: 50,
y: 0,
width: 410,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "A"
}]
}, {
@ -121,9 +121,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "B"
},
x: 50,
y: 11,
y: FLAME_GRAPH_BLOCK_HEIGHT,
width: 160,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "B"
}, {
srcData: {
@ -131,9 +131,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "B"
},
x: 330,
y: 11,
y: FLAME_GRAPH_BLOCK_HEIGHT,
width: 130,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "B"
}]
}, {
@ -145,7 +145,7 @@ let EXPECTED_OUTPUT = [{
x: 0,
y: 0,
width: 50,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "M"
}, {
srcData: {
@ -153,9 +153,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "C"
},
x: 50,
y: 22,
y: FLAME_GRAPH_BLOCK_HEIGHT * 2,
width: 50,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "C"
}, {
srcData: {
@ -163,9 +163,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "C"
},
x: 330,
y: 22,
y: FLAME_GRAPH_BLOCK_HEIGHT * 2,
width: 130,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "C"
}]
}, {
@ -175,9 +175,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "N"
},
x: 0,
y: 11,
y: FLAME_GRAPH_BLOCK_HEIGHT,
width: 50,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "N"
}, {
srcData: {
@ -185,9 +185,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "D"
},
x: 100,
y: 22,
y: FLAME_GRAPH_BLOCK_HEIGHT * 2,
width: 110,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "D"
}, {
srcData: {
@ -197,7 +197,7 @@ let EXPECTED_OUTPUT = [{
x: 460,
y: 0,
width: 40,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "X"
}]
}, {
@ -207,9 +207,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "E"
},
x: 210,
y: 11,
y: FLAME_GRAPH_BLOCK_HEIGHT,
width: 120,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "E"
}, {
srcData: {
@ -217,9 +217,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "Y"
},
x: 460,
y: 11,
y: FLAME_GRAPH_BLOCK_HEIGHT,
width: 40,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "Y"
}]
}, {
@ -229,9 +229,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "P"
},
x: 0,
y: 22,
y: FLAME_GRAPH_BLOCK_HEIGHT * 2,
width: 50,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "P"
}, {
srcData: {
@ -239,9 +239,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "F"
},
x: 210,
y: 22,
y: FLAME_GRAPH_BLOCK_HEIGHT * 2,
width: 120,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "F"
}, {
srcData: {
@ -249,9 +249,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "Z"
},
x: 460,
y: 22,
y: FLAME_GRAPH_BLOCK_HEIGHT * 2,
width: 40,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "Z"
}]
}, {

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

@ -3,7 +3,7 @@
// Tests consecutive duplicate frames are removed from the flame graph data.
let {FlameGraphUtils} = Cu.import("resource:///modules/devtools/FlameGraph.jsm", {});
let {FlameGraphUtils, FLAME_GRAPH_BLOCK_HEIGHT} = devtools.require("devtools/shared/widgets/FlameGraph");
add_task(function*() {
yield promiseTab("about:blank");
@ -73,7 +73,7 @@ let EXPECTED_OUTPUT = [{
x: 0,
y: 0,
width: 50,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "A"
}]
}, {
@ -83,9 +83,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "B"
},
x: 0,
y: 11,
y: FLAME_GRAPH_BLOCK_HEIGHT,
width: 50,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "B"
}]
}, {

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

@ -3,7 +3,7 @@
// Tests if platform frames are removed from the flame graph data.
let {FlameGraphUtils} = Cu.import("resource:///modules/devtools/FlameGraph.jsm", {});
let {FlameGraphUtils, FLAME_GRAPH_BLOCK_HEIGHT} = devtools.require("devtools/shared/widgets/FlameGraph");
let {FrameNode} = devtools.require("devtools/shared/profiler/tree-model");
add_task(function*() {
@ -72,7 +72,7 @@ let EXPECTED_OUTPUT = [{
x: 0,
y: 0,
width: 50,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "http://A"
}, {
srcData: {
@ -80,9 +80,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "file://C"
},
x: 0,
y: 22,
y: FLAME_GRAPH_BLOCK_HEIGHT * 2,
width: 50,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "file://C"
}]
}, {
@ -102,9 +102,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "https://B"
},
x: 0,
y: 11,
y: FLAME_GRAPH_BLOCK_HEIGHT,
width: 50,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "https://B"
}]
}, {

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

@ -3,7 +3,7 @@
// Tests if (idle) nodes are added when necessary in the flame graph data.
let {FlameGraphUtils} = Cu.import("resource:///modules/devtools/FlameGraph.jsm", {});
let {FlameGraphUtils, FLAME_GRAPH_BLOCK_HEIGHT} = devtools.require("devtools/shared/widgets/FlameGraph");
let {FrameNode} = devtools.require("devtools/shared/profiler/tree-model");
add_task(function*() {
@ -96,7 +96,7 @@ let EXPECTED_OUTPUT = [{
x: 0,
y: 0,
width: 50,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "http://A"
}, {
srcData: {
@ -104,9 +104,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "file://C"
},
x: 0,
y: 22,
y: FLAME_GRAPH_BLOCK_HEIGHT * 2,
width: 50,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "file://C"
}, {
srcData: {
@ -116,7 +116,7 @@ let EXPECTED_OUTPUT = [{
x: 100,
y: 0,
width: 50,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "http://A"
}]
}, {
@ -128,7 +128,7 @@ let EXPECTED_OUTPUT = [{
x: 50,
y: 0,
width: 50,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "\m/"
}]
}, {
@ -146,9 +146,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "https://B"
},
x: 0,
y: 11,
y: FLAME_GRAPH_BLOCK_HEIGHT,
width: 50,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "https://B"
}, {
srcData: {
@ -156,9 +156,9 @@ let EXPECTED_OUTPUT = [{
rawLocation: "https://B"
},
x: 100,
y: 11,
y: FLAME_GRAPH_BLOCK_HEIGHT,
width: 50,
height: 11,
height: FLAME_GRAPH_BLOCK_HEIGHT,
text: "https://B"
}]
}, {

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

@ -3,7 +3,7 @@
// Tests that flame graph data is cached, and that the cache may be cleared.
let {FlameGraphUtils} = Cu.import("resource:///modules/devtools/FlameGraph.jsm", {});
let {FlameGraphUtils} = devtools.require("devtools/shared/widgets/FlameGraph");
add_task(function*() {
yield promiseTab("about:blank");

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

@ -3,7 +3,7 @@
// Tests if (idle) nodes are added when necessary in the flame graph data.
let {FlameGraphUtils} = Cu.import("resource:///modules/devtools/FlameGraph.jsm", {});
let {FlameGraphUtils} = devtools.require("devtools/shared/widgets/FlameGraph");
let test = Task.async(function*() {
let hash1 = FlameGraphUtils._getStringHash("abc");

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

@ -3,18 +3,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const Cu = Components.utils;
Cu.import("resource:///modules/devtools/ViewHelpers.jsm");
Cu.import("resource:///modules/devtools/Graphs.jsm");
const promise = Cu.import("resource://gre/modules/Promise.jsm", {}).Promise;
const {Task} = Cu.import("resource://gre/modules/Task.jsm", {});
const {EventEmitter} = Cu.import("resource://gre/modules/devtools/event-emitter.js", {});
this.EXPORTED_SYMBOLS = [
"FlameGraph",
"FlameGraphUtils"
];
const { ViewHelpers } = require("resource:///modules/devtools/ViewHelpers.jsm");
const { AbstractCanvasGraph, GraphArea, GraphAreaDragger } = require("resource:///modules/devtools/Graphs.jsm");
const { Promise } = require("resource://gre/modules/Promise.jsm");
const { Task } = require("resource://gre/modules/Task.jsm");
const { getColor } = require("devtools/shared/theme");
const EventEmitter = require("devtools/toolkit/event-emitter");
const HTML_NS = "http://www.w3.org/1999/xhtml";
const GRAPH_SRC = "chrome://browser/content/devtools/graphs-frame.xhtml";
@ -34,17 +28,14 @@ const TIMELINE_TICKS_MULTIPLE = 5; // ms
const TIMELINE_TICKS_SPACING_MIN = 75; // px
const OVERVIEW_HEADER_HEIGHT = 16; // px
const OVERVIEW_HEADER_BACKGROUND = "rgba(255,255,255,0.7)";
const OVERVIEW_HEADER_TEXT_COLOR = "#18191a";
const OVERVIEW_HEADER_TEXT_FONT_SIZE = 9; // px
const OVERVIEW_HEADER_TEXT_FONT_FAMILY = "sans-serif";
const OVERVIEW_HEADER_TEXT_PADDING_LEFT = 6; // px
const OVERVIEW_HEADER_TEXT_PADDING_TOP = 5; // px
const OVERVIEW_TIMELINE_STROKES = "#ddd";
const OVERVIEW_HEADER_TIMELINE_STROKE_COLOR = "rgba(128, 128, 128, 0.5)";
const FLAME_GRAPH_BLOCK_BORDER = 1; // px
const FLAME_GRAPH_BLOCK_TEXT_COLOR = "#000";
const FLAME_GRAPH_BLOCK_TEXT_FONT_SIZE = 8; // px
const FLAME_GRAPH_BLOCK_TEXT_FONT_SIZE = 9; // px
const FLAME_GRAPH_BLOCK_TEXT_FONT_FAMILY = "sans-serif";
const FLAME_GRAPH_BLOCK_TEXT_PADDING_TOP = 0; // px
const FLAME_GRAPH_BLOCK_TEXT_PADDING_LEFT = 3; // px
@ -101,7 +92,9 @@ function FlameGraph(parent, sharpness) {
EventEmitter.decorate(this);
this._parent = parent;
this._ready = promise.defer();
this._ready = Promise.defer();
this.setTheme();
AbstractCanvasGraph.createIframe(GRAPH_SRC, parent, iframe => {
this._iframe = iframe;
@ -215,14 +208,6 @@ FlameGraph.prototype = {
this.emit("destroyed");
}),
/**
* Rendering options. Subclasses should override these.
*/
overviewHeaderBackgroundColor: OVERVIEW_HEADER_BACKGROUND,
overviewHeaderTextColor: OVERVIEW_HEADER_TEXT_COLOR,
overviewTimelineStrokes: OVERVIEW_TIMELINE_STROKES,
blockTextColor: FLAME_GRAPH_BLOCK_TEXT_COLOR,
/**
* Makes sure the canvas graph is of the specified width or height, and
* doesn't flex to fit all the available space.
@ -330,14 +315,19 @@ FlameGraph.prototype = {
/**
* Updates this graph to reflect the new dimensions of the parent node.
*
* @param boolean options.force
* Force redraw everything.
*/
refresh: function() {
refresh: function(options={}) {
let bounds = this._parent.getBoundingClientRect();
let newWidth = this.fixedWidth || bounds.width;
let newHeight = this.fixedHeight || bounds.height;
// Prevent redrawing everything if the graph's width & height won't change.
if (this._width == newWidth * this._pixelRatio &&
// Prevent redrawing everything if the graph's width & height won't change,
// except if force=true.
if (!options.force &&
this._width == newWidth * this._pixelRatio &&
this._height == newHeight * this._pixelRatio) {
this.emit("refresh-cancelled");
return;
@ -354,6 +344,19 @@ FlameGraph.prototype = {
this.emit("refresh");
},
/**
* Sets the theme via `theme` to either "light" or "dark",
* and updates the internal styling to match. Requires a redraw
* to see the effects.
*/
setTheme: function (theme) {
theme = theme || "light";
this.overviewHeaderBackgroundColor = getColor("body-background", theme);
this.overviewHeaderTextColor = getColor("body-color", theme);
// Hard to get a color that is readable across both themes for the text on the flames
this.blockTextColor = getColor(theme === "dark" ? "selection-color" : "body-color", theme);
},
/**
* The contents of this graph are redrawn only when something changed,
* like the data source, or the selection bounds etc. This flag tracks
@ -385,8 +388,8 @@ FlameGraph.prototype = {
let selection = this._selection;
let selectionWidth = selection.end - selection.start;
let selectionScale = canvasWidth / selectionWidth;
this._drawPyramid(this._data, this._verticalOffset, selection.start, selectionScale);
this._drawTicks(selection.start, selectionScale);
this._drawPyramid(this._data, this._verticalOffset, selection.start, selectionScale);
this._shouldRedraw = false;
},
@ -416,7 +419,7 @@ FlameGraph.prototype = {
ctx.textBaseline = "top";
ctx.font = fontSize + "px " + fontFamily;
ctx.fillStyle = this.overviewHeaderTextColor;
ctx.strokeStyle = this.overviewTimelineStrokes;
ctx.strokeStyle = OVERVIEW_HEADER_TIMELINE_STROKE_COLOR;
ctx.beginPath();
for (let x = -scaledOffset % tickInterval; x < canvasWidth; x += tickInterval) {
@ -926,14 +929,14 @@ FlameGraph.prototype = {
}
};
const FLAME_GRAPH_BLOCK_HEIGHT = 11; // px
const FLAME_GRAPH_BLOCK_HEIGHT = 12; // px
const PALLETTE_SIZE = 10;
const PALLETTE_HUE_OFFSET = Math.random() * 90;
const PALLETTE_HUE_RANGE = 270;
const PALLETTE_SATURATION = 60;
const PALLETTE_BRIGHTNESS = 75;
const PALLETTE_OPACITY = 0.7;
const PALLETTE_SATURATION = 100;
const PALLETTE_BRIGHTNESS = 65;
const PALLETTE_OPACITY = 0.55;
const COLOR_PALLETTE = Array.from(Array(PALLETTE_SIZE)).map((_, i) => "hsla" +
"(" + ((PALLETTE_HUE_OFFSET + (i / PALLETTE_SIZE * PALLETTE_HUE_RANGE))|0 % 360) +
@ -1114,3 +1117,7 @@ let FlameGraphUtils = {
return hash;
}
};
exports.FlameGraph = FlameGraph;
exports.FlameGraphUtils = FlameGraphUtils;
exports.FLAME_GRAPH_BLOCK_HEIGHT = FLAME_GRAPH_BLOCK_HEIGHT;

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

@ -237,32 +237,24 @@ StyleSheetEditor.prototype = {
/**
* Start fetching the full text source for this editor's sheet.
*
* @return {Promise}
* A promise that'll resolve with the source text once the source
* has been loaded or reject on unexpected error.
*/
fetchSource: function(callback) {
return this.styleSheet.getText().then((longStr) => {
longStr.string().then((source) => {
let ruleCount = this.styleSheet.ruleCount;
if (!this.styleSheet.isOriginalSource) {
source = CssLogic.prettifyCSS(source, ruleCount);
}
this._state.text = source;
this.sourceLoaded = true;
fetchSource: function () {
return Task.spawn(function* () {
let longStr = yield this.styleSheet.getText();
let source = yield longStr.string();
let ruleCount = this.styleSheet.ruleCount;
if (!this.styleSheet.isOriginalSource) {
source = CssLogic.prettifyCSS(source, ruleCount);
}
this._state.text = source;
this.sourceLoaded = true;
if (callback) {
callback(source);
}
return source;
}, e => {
if (this._isDestroyed) {
console.warn("Could not fetch the source for " +
this.styleSheet.href +
", the editor was destroyed");
Cu.reportError(e);
} else {
throw e;
}
});
}, e => {
return source;
}.bind(this)).then(null, e => {
if (this._isDestroyed) {
console.warn("Could not fetch the source for " +
this.styleSheet.href +

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

@ -910,6 +910,10 @@ function createMenuItem(aMenu, aAttributes)
item.setAttribute("accesskey", CssHtmlTree.l10n(aAttributes.accesskey));
item.addEventListener("command", aAttributes.command);
if (aAttributes.type) {
item.setAttribute("type", aAttributes.type);
}
aMenu.appendChild(item);
return item;

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

@ -3063,6 +3063,10 @@ function createMenuItem(aMenu, aAttributes) {
item.setAttribute("accesskey", _strings.GetStringFromName(aAttributes.accesskey));
item.addEventListener("command", aAttributes.command);
if (aAttributes.type) {
item.setAttribute("type", aAttributes.type);
}
aMenu.appendChild(item);
return item;

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

@ -81,7 +81,7 @@ browser.jar:
skin/classic/browser/Security-broken.png
skin/classic/browser/setDesktopBackground.css
skin/classic/browser/slowStartup-16.png
skin/classic/browser/theme-switcher-icon.png
skin/classic/browser/theme-switcher-icon.png (../shared/theme-switcher-icon.png)
skin/classic/browser/Toolbar.png
skin/classic/browser/Toolbar-inverted.png
skin/classic/browser/Toolbar-small.png

Двоичные данные
browser/themes/linux/theme-switcher-icon.png

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

До

Ширина:  |  Высота:  |  Размер: 666 B

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

@ -122,8 +122,8 @@ browser.jar:
skin/classic/browser/Secure-Glyph.png
skin/classic/browser/Secure-Glyph@2x.png
skin/classic/browser/slowStartup-16.png
skin/classic/browser/theme-switcher-icon.png
skin/classic/browser/theme-switcher-icon@2x.png
skin/classic/browser/theme-switcher-icon.png (../shared/theme-switcher-icon.png)
skin/classic/browser/theme-switcher-icon@2x.png (../shared/theme-switcher-icon@2x.png)
skin/classic/browser/Toolbar.png
skin/classic/browser/Toolbar@2x.png
skin/classic/browser/Toolbar-inverted.png

Двоичные данные
browser/themes/osx/theme-switcher-icon.png

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

До

Ширина:  |  Высота:  |  Размер: 1.2 KiB

Двоичные данные
browser/themes/osx/theme-switcher-icon@2x.png

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

До

Ширина:  |  Высота:  |  Размер: 3.2 KiB

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

@ -3,7 +3,6 @@
% file, You can obtain one at http://mozilla.org/MPL/2.0/.
:root, body {
height: 100%;
overflow-x: hidden;
}
@ -21,11 +20,6 @@ body {
text-align: center;
}
#list {
height: 100%;
overflow-x: auto;
}
.item {
display: flex;
flex-flow: row;

Двоичные данные
browser/themes/shared/theme-switcher-icon.png Normal file

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

После

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичные данные
browser/themes/shared/theme-switcher-icon@2x.png Normal file

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

После

Ширина:  |  Высота:  |  Размер: 5.5 KiB

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

@ -105,8 +105,7 @@ browser.jar:
skin/classic/browser/Secure24-aero.png
skin/classic/browser/setDesktopBackground.css
skin/classic/browser/slowStartup-16.png
skin/classic/browser/theme-switcher-icon.png
skin/classic/browser/theme-switcher-icon-aero.png
skin/classic/browser/theme-switcher-icon.png (../shared/theme-switcher-icon.png)
skin/classic/browser/Toolbar.png
skin/classic/browser/Toolbar-aero.png
skin/classic/browser/Toolbar-inverted.png
@ -566,8 +565,6 @@ browser.jar:
% override chrome://browser/skin/menuPanel.png chrome://browser/skin/menuPanel-aero.png os=WINNT osversion=6.1
% override chrome://browser/skin/menuPanel-small.png chrome://browser/skin/menuPanel-small-aero.png os=WINNT osversion=6
% override chrome://browser/skin/menuPanel-small.png chrome://browser/skin/menuPanel-small-aero.png os=WINNT osversion=6.1
% override chrome://browser/skin/theme-switcher-icon.png chrome://browser/skin/theme-switcher-icon-aero.png os=WINNT osversion=6
% override chrome://browser/skin/theme-switcher-icon.png chrome://browser/skin/theme-switcher-icon-aero.png os=WINNT osversion=6.1
% override chrome://browser/skin/loop/menuPanel.png chrome://browser/skin/loop/menuPanel-aero.png os=WINNT osversion=6
% override chrome://browser/skin/loop/menuPanel.png chrome://browser/skin/loop/menuPanel-aero.png os=WINNT osversion=6.1

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

До

Ширина:  |  Высота:  |  Размер: 1.8 KiB

Двоичные данные
browser/themes/windows/theme-switcher-icon.png

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

До

Ширина:  |  Высота:  |  Размер: 651 B

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

@ -1795,6 +1795,19 @@ nsXMLHttpRequest::Open(const nsACString& inMethod, const nsACString& url,
return rv;
}
void
nsXMLHttpRequest::PopulateNetworkInterfaceId()
{
if (mNetworkInterfaceId.IsEmpty()) {
return;
}
nsCOMPtr<nsIHttpChannelInternal> channel(do_QueryInterface(mChannel));
if (!channel) {
return;
}
channel->SetNetworkInterfaceId(mNetworkInterfaceId);
}
/*
* "Copy" from a stream.
*/
@ -2612,6 +2625,8 @@ nsXMLHttpRequest::Send(nsIVariant* aVariant, const Nullable<RequestBody>& aBody)
{
NS_ENSURE_TRUE(mPrincipal, NS_ERROR_NOT_INITIALIZED);
PopulateNetworkInterfaceId();
nsresult rv = CheckInnerWindowCorrectness();
NS_ENSURE_SUCCESS(rv, rv);

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

@ -428,6 +428,11 @@ private:
bool IsDeniedCrossSiteRequest();
// Tell our channel what network interface ID we were told to use.
// If it's an HTTP channel and we were told to use a non-default
// interface ID.
void PopulateNetworkInterfaceId();
public:
void Send(JSContext* /*aCx*/, ErrorResult& aRv)
{
@ -538,6 +543,16 @@ public:
return mChannel;
}
void GetNetworkInterfaceId(nsACString& aId) const
{
aId = mNetworkInterfaceId;
}
void SetNetworkInterfaceId(const nsACString& aId)
{
mNetworkInterfaceId = aId;
}
// We need a GetInterface callable from JS for chrome JS
void GetInterface(JSContext* aCx, nsIJSID* aIID,
JS::MutableHandle<JS::Value> aRetval, ErrorResult& aRv);
@ -762,6 +777,10 @@ protected:
bool mIsSystem;
bool mIsAnon;
// A platform-specific identifer to represent the network interface
// that this request is associated with.
nsCString mNetworkInterfaceId;
/**
* Close the XMLHttpRequest's channels and dispatch appropriate progress
* events.

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

@ -122,7 +122,8 @@ const NfcNotificationType = {
INITIALIZED: "initialized",
TECH_DISCOVERED: "techDiscovered",
TECH_LOST: "techLost",
HCI_EVENT_TRANSACTION: "hciEventTransaction"
HCI_EVENT_TRANSACTION: "hciEventTransaction",
NDEF_RECEIVED: "ndefReceived"
};
XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
@ -640,14 +641,7 @@ Nfc.prototype = {
delete message.sessionId;
if (SessionHelper.isP2PSession(sessionId)) {
if (message.records) {
// TODO: Bug 1082493.
// This event should be sent to the focus app, but before Bug 1082493
// is landed we forward this to System app.
gMessageManager.callDefaultFoundHandler(message);
} else {
gMessageManager.onPeerEvent(NFC.PEER_EVENT_FOUND, message.sessionToken);
}
gMessageManager.onPeerEvent(NFC.PEER_EVENT_FOUND, message.sessionToken);
} else {
gMessageManager.onTagFound(message);
}
@ -666,6 +660,15 @@ Nfc.prototype = {
case NfcNotificationType.HCI_EVENT_TRANSACTION:
this.notifyHCIEventTransaction(message);
break;
case NfcNotificationType.NDEF_RECEIVED:
message.sessionToken = SessionHelper.getToken(message.sessionId);
delete message.sessionId;
message.isP2P = true;
// TODO: Bug 1082493.
// This event should be sent to the focus app, but before Bug 1082493
// is landed we forward this to System app.
gMessageManager.callDefaultFoundHandler(message);
break;
case NfcResponseType.CHANGE_RF_STATE_RSP:
this.sendNfcResponse(message);

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

@ -8,7 +8,7 @@
namespace mozilla {
#define NFCD_MAJOR_VERSION 1
#define NFCD_MINOR_VERSION 21
#define NFCD_MINOR_VERSION 22
enum NfcTechlogy {
NDEF = 0,
@ -39,13 +39,6 @@ enum NfcErrorCode {
FailDisableLowPowerMode = 18,
};
enum SecureElementOrigin {
SIM = 0,
ESE = 1,
ASSD = 2,
OriginEndGuard = 3
};
} // namespace mozilla
#endif // NfcGonkMessage_h

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

@ -105,6 +105,9 @@ NfcMessageHandler::ProcessNotification(int32_t aType, const Parcel& aParcel, Eve
case NfcNotificationType::HciEventTransaction:
result = HCIEventTransactionNotification(aParcel, aOptions);
break;
case NfcNotificationType::NdefReceived:
result = NDEFReceivedNotification(aParcel, aOptions);
break;
default:
result = false;
break;
@ -305,6 +308,18 @@ NfcMessageHandler::HCIEventTransactionNotification(const Parcel& aParcel, EventO
return true;
}
bool
NfcMessageHandler::NDEFReceivedNotification(const Parcel& aParcel, EventOptions& aOptions)
{
aOptions.mSessionId = aParcel.readInt32();
int32_t ndefMsgCount = aParcel.readInt32();
if (ndefMsgCount != 0) {
ReadNDEFMessage(aParcel, aOptions);
}
return true;
}
bool
NfcMessageHandler::ReadNDEFMessage(const Parcel& aParcel, EventOptions& aOptions)
{

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

@ -41,6 +41,7 @@ private:
bool TechDiscoveredNotification(const android::Parcel& aParcel, EventOptions& aOptions);
bool TechLostNotification(const android::Parcel& aParcel, EventOptions& aOptions);
bool HCIEventTransactionNotification(const android::Parcel& aParcel, EventOptions& aOptions);
bool NDEFReceivedNotification(const android::Parcel& aParcel, EventOptions& aOptions);
bool ReadNDEFMessage(const android::Parcel& aParcel, EventOptions& aOptions);
bool WriteNDEFMessage(android::Parcel& aParcel, const CommandOptions& aOptions);

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

@ -25,12 +25,6 @@ using namespace android;
using namespace mozilla::dom;
using namespace mozilla::ipc;
static const nsLiteralString SEOriginString[] = {
NS_LITERAL_STRING("SIM"),
NS_LITERAL_STRING("eSE"),
NS_LITERAL_STRING("ASSD")
};
namespace mozilla {
static NfcService* gNfcService;
@ -191,10 +185,10 @@ public:
// HCI Event Transaction parameters.
if (mEvent.mOriginType != -1) {
MOZ_ASSERT(mEvent.mOriginType < SecureElementOrigin::OriginEndGuard);
MOZ_ASSERT(static_cast<HCIEventOrigin>(mEvent.mOriginType) < HCIEventOrigin::EndGuard_);
event.mOrigin.Construct();
event.mOrigin.Value().Assign(SEOriginString[mEvent.mOriginType]);
event.mOrigin.Value().AssignASCII(HCIEventOriginValues::strings[mEvent.mOriginType].value);
event.mOrigin.Value().AppendInt(mEvent.mOriginIndex, 16 /* radix */);
}

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

@ -98,6 +98,7 @@ if CONFIG['MOZ_B2G_RIL']:
'ril_consts.js',
'ril_worker.js',
'ril_worker_buf_object.js',
'ril_worker_telephony_request_queue.js',
'RILSystemMessenger.jsm',
]
if not CONFIG['DISABLE_MOZ_RIL_GEOLOC']:

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

@ -37,12 +37,14 @@
*/
/* global BufObject */
/* global TelephonyRequestQueue */
"use strict";
importScripts("ril_consts.js");
importScripts("resource://gre/modules/workers/require.js");
importScripts("ril_worker_buf_object.js");
importScripts("ril_worker_telephony_request_queue.js");
// set to true in ril_consts.js to see debug messages
let DEBUG = DEBUG_WORKER;
@ -84,134 +86,6 @@ let RILQUIRKS_SUBSCRIPTION_CONTROL;
let RILQUIRKS_SIGNAL_EXTRA_INT32;
const TELEPHONY_REQUESTS = [
REQUEST_GET_CURRENT_CALLS,
REQUEST_ANSWER,
REQUEST_CONFERENCE,
REQUEST_DIAL,
REQUEST_DIAL_EMERGENCY_CALL,
REQUEST_HANGUP,
REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND,
REQUEST_HANGUP_WAITING_OR_BACKGROUND,
REQUEST_SEPARATE_CONNECTION,
REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE,
REQUEST_UDUB
];
function TelephonyRequestEntry(request, callback) {
this.request = request;
this.callback = callback;
}
function TelephonyRequestQueue(ril) {
this.ril = ril;
this.currentQueue = null; // Point to the current running queue.
this.queryQueue = [];
this.controlQueue = [];
}
TelephonyRequestQueue.prototype = {
ril: null,
_getQueue: function(request) {
return (request === REQUEST_GET_CURRENT_CALLS) ? this.queryQueue
: this.controlQueue;
},
_getAnotherQueue: function(queue) {
return (this.queryQueue === queue) ? this.controlQueue : this.queryQueue;
},
_find: function(queue, request) {
for (let i = 0; i < queue.length; ++i) {
if (queue[i].request === request) {
return i;
}
}
return -1;
},
_startQueue: function(queue) {
if (queue.length === 0) {
return;
}
// We only need to keep one entry for queryQueue.
if (queue === this.queryQueue) {
queue.splice(1, queue.length - 1);
}
this.currentQueue = queue;
for (let entry of queue) {
this._executeEntry(entry);
}
},
_executeEntry: function(entry) {
if (DEBUG) this.debug("execute " + this._getRequestName(entry.request));
entry.callback();
},
_getRequestName: function(request) {
let method = this.ril[request];
return (typeof method === 'function') ? method.name : "";
},
debug: function(msg) {
this.ril.context.debug("[TeleQ] " + msg);
},
isValidRequest: function(request) {
return TELEPHONY_REQUESTS.indexOf(request) !== -1;
},
push: function(request, callback) {
if (!this.isValidRequest(request)) {
if (DEBUG) {
this.debug("Error: " + this._getRequestName(request) +
" is not a telephony request");
}
return;
}
if (DEBUG) this.debug("push " + this._getRequestName(request));
let entry = new TelephonyRequestEntry(request, callback);
let queue = this._getQueue(request);
queue.push(entry);
// Try to run the request.
if (this.currentQueue === queue) {
this._executeEntry(entry);
} else if (!this.currentQueue) {
this._startQueue(queue);
}
},
pop: function(request) {
if (!this.isValidRequest(request)) {
if (DEBUG) {
this.debug("Error: " + this._getRequestName(request) +
" is not a telephony request");
}
return;
}
if (DEBUG) this.debug("pop " + this._getRequestName(request));
let queue = this._getQueue(request);
let index = this._find(queue, request);
if (index === -1) {
throw new Error("Cannot find the request in telephonyRequestQueue.");
} else {
queue.splice(index, 1);
}
if (queue.length === 0) {
this.currentQueue = null;
this._startQueue(this._getAnotherQueue(queue));
}
}
};
/**
* The RIL state machine.
*

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

@ -0,0 +1,157 @@
/* global DEBUG, DEBUG_WORKER */
/* global REQUEST_GET_CURRENT_CALLS */
/* global REQUEST_ANSWER, REQUEST_CONFERENCE, REQUEST_DIAL */
/* global REQUEST_DIAL_EMERGENCY_CALL, REQUEST_HANGUP */
/* global REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND */
/* global REQUEST_HANGUP_WAITING_OR_BACKGROUND */
/* global REQUEST_SEPARATE_CONNECTION */
/* global REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE, REQUEST_UDUB */
"use strict";
(function(exports) {
const TELEPHONY_REQUESTS = [
REQUEST_GET_CURRENT_CALLS,
REQUEST_ANSWER,
REQUEST_CONFERENCE,
REQUEST_DIAL,
REQUEST_DIAL_EMERGENCY_CALL,
REQUEST_HANGUP,
REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND,
REQUEST_HANGUP_WAITING_OR_BACKGROUND,
REQUEST_SEPARATE_CONNECTION,
REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE,
REQUEST_UDUB
];
// Set to true in ril_consts.js to see debug messages
let DEBUG = DEBUG_WORKER;
/**
* Queue entry; only used in the queue.
*/
let TelephonyRequestEntry = function(request, callback) {
this.request = request;
this.callback = callback;
};
let TelephonyRequestQueue = function(ril) {
this.ril = ril;
this.currentQueue = null; // Point to the current running queue.
this.queryQueue = [];
this.controlQueue = [];
};
TelephonyRequestQueue.prototype._getQueue = function(request) {
return (request === REQUEST_GET_CURRENT_CALLS) ? this.queryQueue
: this.controlQueue;
};
TelephonyRequestQueue.prototype._getAnotherQueue = function(queue) {
return (this.queryQueue === queue) ? this.controlQueue : this.queryQueue;
};
TelephonyRequestQueue.prototype._find = function(queue, request) {
for (let i = 0; i < queue.length; ++i) {
if (queue[i].request === request) {
return i;
}
}
return -1;
};
TelephonyRequestQueue.prototype._startQueue = function(queue) {
if (queue.length === 0) {
return;
}
// We only need to keep one entry for queryQueue.
if (queue === this.queryQueue) {
queue.splice(1, queue.length - 1);
}
this.currentQueue = queue;
for (let entry of queue) {
this._executeEntry(entry);
}
};
TelephonyRequestQueue.prototype._executeEntry = function(entry) {
if (DEBUG) {
this.debug("execute " + this._getRequestName(entry.request));
}
entry.callback();
};
TelephonyRequestQueue.prototype._getRequestName = function(request) {
let method = this.ril[request];
return (typeof method === 'function') ? method.name : "";
};
TelephonyRequestQueue.prototype.debug = function(msg) {
this.ril.context.debug("[TeleQ] " + msg);
};
TelephonyRequestQueue.prototype.isValidRequest = function(request) {
return TELEPHONY_REQUESTS.indexOf(request) !== -1;
};
TelephonyRequestQueue.prototype.push = function(request, callback) {
if (!this.isValidRequest(request)) {
if (DEBUG) {
this.debug("Error: " + this._getRequestName(request) +
" is not a telephony request");
}
return;
}
if (DEBUG) {
this.debug("push " + this._getRequestName(request));
}
let entry = new TelephonyRequestEntry(request, callback);
let queue = this._getQueue(request);
queue.push(entry);
// Try to run the request.
if (this.currentQueue === queue) {
this._executeEntry(entry);
} else if (!this.currentQueue) {
this._startQueue(queue);
}
};
TelephonyRequestQueue.prototype.pop = function(request) {
if (!this.isValidRequest(request)) {
if (DEBUG) {
this.debug("Error: " + this._getRequestName(request) +
" is not a telephony request");
}
return;
}
if (DEBUG) {
this.debug("pop " + this._getRequestName(request));
}
let queue = this._getQueue(request);
let index = this._find(queue, request);
if (index === -1) {
throw new Error("Cannot find the request in telephonyRequestQueue.");
} else {
queue.splice(index, 1);
}
if (queue.length === 0) {
this.currentQueue = null;
this._startQueue(this._getAnotherQueue(queue));
}
};
// Before we make sure to form it as a module would not add extra
// overhead of module loading, we need to define it in this way
// rather than 'module.exports' it as a module component.
exports.TelephonyRequestQueue = TelephonyRequestQueue;
})(self); // in worker self is the global

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

@ -1121,6 +1121,7 @@ TelephonyService.prototype = {
if (callNum !== 1) {
this._hangUpBackground(aClientId, aCallback);
} else {
call.hangUpLocal = true;
this._sendToRilWorker(aClientId, "udub", null,
this._defaultCallbackHandler.bind(this, aCallback));
}

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

@ -39,7 +39,17 @@ enum NfcNotificationType {
"initialized",
"techDiscovered",
"techLost",
"hciEventTransaction"
"hciEventTransaction",
"ndefReceived",
};
/**
* The source of HCI Transaction Event.
*/
enum HCIEventOrigin {
"SIM",
"eSE",
"ASSD"
};
dictionary NfcCommandOptions

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

@ -140,6 +140,11 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget {
[ChromeOnly, Exposed=Window]
readonly attribute MozChannel? channel;
// A platform-specific identifer to represent the network interface
// which the HTTP request would occur on.
[ChromeOnly, Exposed=Window]
attribute ByteString? networkInterfaceId;
[Throws, ChromeOnly, Exposed=Window]
any getInterface(IID iid);

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

@ -258,8 +258,6 @@
<activity android:name="org.mozilla.gecko.tabqueue.TabQueueDispatcher"
android:label="@MOZ_APP_DISPLAYNAME@"
android:noHistory="true"
android:excludeFromRecents="true"
android:launchMode="singleTask"
android:theme="@style/TabQueueActivity">
<intent-filter>

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

@ -28,8 +28,8 @@ native NetAddr(mozilla::net::NetAddr);
* NOTE: This is a free-threaded interface, meaning that the methods on
* this interface may be called from any thread.
*/
[scriptable, uuid(a0b3b547-d6f0-4b65-a3de-a99ffa368840)]
interface nsISocketTransport : nsITransport
[scriptable, uuid(79221831-85e2-43a8-8152-05d77d6fde31)]
interface nsISocketTransport : nsITransport
{
/**
* Get the peer's host for the underlying socket connection.
@ -44,6 +44,13 @@ interface nsISocketTransport : nsITransport
*/
readonly attribute long port;
/**
* The platform-specific network interface id that this socket
* associated with. Note that this attribute can be only accessed
* in the socket thread.
*/
attribute ACString networkInterfaceId;
/**
* Returns the IP address of the socket connection peer. This
* attribute is defined only once a connection has been established.
@ -207,6 +214,8 @@ interface nsISocketTransport : nsITransport
/**
* TCP keepalive configuration (support varies by platform).
* Note that the attribute as well as the setter can only accessed
* in the socket thread.
*/
attribute boolean keepaliveEnabled;
void setKeepaliveVals(in long keepaliveIdleTime,

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

@ -1046,8 +1046,8 @@ nsSocketTransport::ResolveHost()
"Setting both RESOLVE_DISABLE_IPV6 and RESOLVE_DISABLE_IPV4");
SendStatus(NS_NET_STATUS_RESOLVING_HOST);
rv = dns->AsyncResolve(SocketHost(), dnsFlags, this, nullptr,
getter_AddRefs(mDNSRequest));
rv = dns->AsyncResolveExtended(SocketHost(), dnsFlags, mNetworkInterfaceId, this,
nullptr, getter_AddRefs(mDNSRequest));
if (NS_SUCCEEDED(rv)) {
SOCKET_LOG((" advancing to STATE_RESOLVING\n"));
mState = STATE_RESOLVING;
@ -2195,6 +2195,22 @@ nsSocketTransport::GetPort(int32_t *port)
return NS_OK;
}
NS_IMETHODIMP
nsSocketTransport::GetNetworkInterfaceId(nsACString_internal &aNetworkInterfaceId)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread, "wrong thread");
aNetworkInterfaceId = mNetworkInterfaceId;
return NS_OK;
}
NS_IMETHODIMP
nsSocketTransport::SetNetworkInterfaceId(const nsACString_internal &aNetworkInterfaceId)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread, "wrong thread");
mNetworkInterfaceId = aNetworkInterfaceId;
return NS_OK;
}
NS_IMETHODIMP
nsSocketTransport::GetPeerAddr(NetAddr *addr)
{

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

@ -296,6 +296,10 @@ private:
bool mInputClosed;
bool mOutputClosed;
// The platform-specific network interface id that this socket
// associated with.
nsCString mNetworkInterfaceId;
// this flag is used to determine if the results of a host lookup arrive
// recursively or not. this flag is not protected by any lock.
bool mResolving;

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

@ -898,6 +898,21 @@ HttpBaseChannel::SetRequestMethod(const nsACString& aMethod)
return NS_OK;
}
NS_IMETHODIMP
HttpBaseChannel::GetNetworkInterfaceId(nsACString& aNetworkInterfaceId)
{
aNetworkInterfaceId = mNetworkInterfaceId;
return NS_OK;
}
NS_IMETHODIMP
HttpBaseChannel::SetNetworkInterfaceId(const nsACString& aNetworkInterfaceId)
{
ENSURE_CALLED_BEFORE_CONNECT();
mNetworkInterfaceId = aNetworkInterfaceId;
return NS_OK;
}
NS_IMETHODIMP
HttpBaseChannel::GetReferrer(nsIURI **referrer)
{

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

@ -184,6 +184,8 @@ public:
NS_IMETHOD TakeAllSecurityMessages(nsCOMArray<nsISecurityConsoleMessage> &aMessages) override;
NS_IMETHOD GetResponseTimeoutEnabled(bool *aEnable) override;
NS_IMETHOD SetResponseTimeoutEnabled(bool aEnable) override;
NS_IMETHOD GetNetworkInterfaceId(nsACString& aNetworkInterfaceId);
NS_IMETHOD SetNetworkInterfaceId(const nsACString& aNetworkInterfaceId);
NS_IMETHOD AddRedirect(nsIPrincipal *aRedirect) override;
NS_IMETHOD ForcePending(bool aForcePending) override;
NS_IMETHOD GetLastModifiedTime(PRTime* lastModifiedTime) override;
@ -428,6 +430,9 @@ protected:
// This parameter is used to ensure that we do not call OnStartRequest more
// than once.
bool mOnStartRequestCalled;
// The network interface id that's associated with this channel.
nsCString mNetworkInterfaceId;
};
// Share some code while working around C++'s absurd inability to handle casting

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

@ -1606,6 +1606,18 @@ SocketTransportShim::GetTimeout(uint32_t aType, uint32_t *_retval)
return mWrapped->GetTimeout(aType, _retval);
}
NS_IMETHODIMP
SocketTransportShim::GetNetworkInterfaceId(nsACString_internal &aNetworkInterfaceId)
{
return mWrapped->GetNetworkInterfaceId(aNetworkInterfaceId);
}
NS_IMETHODIMP
SocketTransportShim::SetNetworkInterfaceId(const nsACString_internal &aNetworkInterfaceId)
{
return mWrapped->SetNetworkInterfaceId(aNetworkInterfaceId);
}
NS_IMETHODIMP
SocketTransportShim::SetTimeout(uint32_t aType, uint32_t aValue)
{

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

@ -4872,6 +4872,12 @@ nsHttpChannel::BeginConnect()
Telemetry::Accumulate(Telemetry::HTTP_TRANSACTION_USE_ALTSVC, false);
}
// Set network interface id only when it's not empty to avoid
// rebuilding hash key.
if (!mNetworkInterfaceId.IsEmpty()) {
mConnectionInfo->SetNetworkInterfaceId(mNetworkInterfaceId);
}
mAuthProvider =
do_CreateInstance("@mozilla.org/network/http-channel-auth-provider;1",
&rv);

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

@ -80,11 +80,14 @@ nsHttpConnectionInfo::Init(const nsACString &host, int32_t port,
}
void
nsHttpConnectionInfo::SetOriginServer(const nsACString &host, int32_t port)
nsHttpConnectionInfo::SetNetworkInterfaceId(const nsACString& aNetworkInterfaceId)
{
mHost = host;
mPort = port == -1 ? DefaultPort() : port;
mNetworkInterfaceId = aNetworkInterfaceId;
BuildHashKey();
}
void nsHttpConnectionInfo::BuildHashKey()
{
//
// build hash key:
//
@ -116,6 +119,11 @@ nsHttpConnectionInfo::SetOriginServer(const nsACString &host, int32_t port)
mHashKey.AssignLiteral("......");
mHashKey.Append(keyHost);
if (!mNetworkInterfaceId.IsEmpty()) {
mHashKey.Append('(');
mHashKey.Append(mNetworkInterfaceId);
mHashKey.Append(')');
}
mHashKey.Append(':');
mHashKey.AppendInt(keyPort);
if (!mUsername.IsEmpty()) {
@ -169,6 +177,14 @@ nsHttpConnectionInfo::SetOriginServer(const nsACString &host, int32_t port)
}
}
void
nsHttpConnectionInfo::SetOriginServer(const nsACString &host, int32_t port)
{
mHost = host;
mPort = port == -1 ? DefaultPort() : port;
BuildHashKey();
}
nsHttpConnectionInfo*
nsHttpConnectionInfo::Clone() const
{
@ -182,6 +198,10 @@ nsHttpConnectionInfo::Clone() const
mAuthenticationPort);
}
if (!mNetworkInterfaceId.IsEmpty()) {
clone->SetNetworkInterfaceId(mNetworkInterfaceId);
}
// Make sure the anonymous, relaxed, and private flags are transferred
clone->SetAnonymous(GetAnonymous());
clone->SetPrivate(GetPrivate());
@ -208,6 +228,9 @@ nsHttpConnectionInfo::CloneAsDirectRoute(nsHttpConnectionInfo **outCI)
clone->SetPrivate(GetPrivate());
clone->SetRelaxed(GetRelaxed());
clone->SetNoSpdy(GetNoSpdy());
if (!mNetworkInterfaceId.IsEmpty()) {
clone->SetNetworkInterfaceId(mNetworkInterfaceId);
}
clone.forget(outCI);
}

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

@ -55,12 +55,19 @@ private:
PR_LOG(gHttpLog, 4, ("Destroying nsHttpConnectionInfo @%x\n", this));
}
void BuildHashKey();
public:
const nsAFlatCString &HashKey() const { return mHashKey; }
const nsCString &GetAuthenticationHost() const { return mAuthenticationHost; }
int32_t GetAuthenticationPort() const { return mAuthenticationPort; }
// With overhead rebuilding the hash key. The initial
// network interface is empty. So you can reduce one call
// if there's no explicit route after ctor.
void SetNetworkInterfaceId(const nsACString& aNetworkInterfaceId);
// OK to treat these as an infalible allocation
nsHttpConnectionInfo* Clone() const;
void CloneAsDirectRoute(nsHttpConnectionInfo **outParam);
@ -100,6 +107,8 @@ public:
{ mHashKey.SetCharAt(aNoSpdy ? 'X' : '.', 5); }
bool GetNoSpdy() const { return mHashKey.CharAt(5) == 'X'; }
const nsCString &GetNetworkInterfaceId() const { return mNetworkInterfaceId; }
const nsCString &GetHost() { return mHost; }
const nsCString &GetNPNToken() { return mNPNToken; }
const nsCString &GetUsername() { return mUsername; }
@ -136,6 +145,7 @@ private:
nsCString mHashKey;
nsCString mHost;
nsCString mNetworkInterfaceId;
int32_t mPort;
nsCString mUsername;
nsCString mAuthenticationHost;

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

@ -3166,6 +3166,10 @@ nsHalfOpenSocket::SetupStreams(nsISocketTransport **transport,
socketTransport->SetQoSBits(gHttpHandler->GetQoSBits());
if (!mEnt->mConnInfo->GetNetworkInterfaceId().IsEmpty()) {
socketTransport->SetNetworkInterfaceId(mEnt->mConnInfo->GetNetworkInterfaceId());
}
rv = socketTransport->SetEventSink(this, nullptr);
NS_ENSURE_SUCCESS(rv, rv);

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

@ -38,7 +38,7 @@ interface nsIHttpUpgradeListener : nsISupports
* using any feature exposed by this interface, be aware that this interface
* will change and you will be broken. You have been warned.
*/
[scriptable, uuid(80ee20a9-757b-4c4e-8a4a-84cbb5981879)]
[scriptable, uuid(ad8192a1-668e-4a47-bd77-081eb23e50fa)]
interface nsIHttpChannelInternal : nsISupports
{
/**
@ -241,6 +241,11 @@ interface nsIHttpChannelInternal : nsISupports
*/
readonly attribute nsIURI topWindowURI;
/**
* The network interface id that's associated with this channel.
*/
attribute ACString networkInterfaceId;
/**
* Used only by nsChannelClassifier to resume connecting or abort the
* channel after a remote classification verdict.

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

@ -17,7 +17,6 @@ Cu.import("resource://gre/modules/osfile.jsm");
const ROOT_BRANCH = "datareporting.";
const POLICY_BRANCH = ROOT_BRANCH + "policy.";
const SESSIONS_BRANCH = ROOT_BRANCH + "sessions.";
const HEALTHREPORT_BRANCH = ROOT_BRANCH + "healthreport.";
const HEALTHREPORT_LOGGING_BRANCH = HEALTHREPORT_BRANCH + "logging.";
const DEFAULT_LOAD_DELAY_MSEC = 10 * 1000;
@ -65,10 +64,6 @@ this.DataReportingService = function () {
this._os = Cc["@mozilla.org/observer-service;1"]
.getService(Ci.nsIObserverService);
// Used for testing only, when true results in getSessionRecorder() returning
// undefined. Controlled via simulate* methods.
this._simulateNoSessionRecorder = false;
}
DataReportingService.prototype = Object.freeze({
@ -120,16 +115,6 @@ DataReportingService.prototype = Object.freeze({
try {
this._prefs = new Preferences(HEALTHREPORT_BRANCH);
// We don't initialize the sessions recorder unless Health Report is
// around to provide pruning of data.
//
// FUTURE consider having the SessionsRecorder always enabled and/or
// living in its own XPCOM service.
if (this._prefs.get("service.enabled", true)) {
this.sessionRecorder = new SessionRecorder(SESSIONS_BRANCH);
this.sessionRecorder.onStartup();
}
// We can't interact with prefs until after the profile is present.
let policyPrefs = new Preferences(POLICY_BRANCH);
this.policy = new DataReportingPolicy(policyPrefs, this._prefs, this);
@ -282,9 +267,7 @@ DataReportingService.prototype = Object.freeze({
}
}
this._healthReporter = new ns.HealthReporter(HEALTHREPORT_BRANCH,
this.policy,
this.sessionRecorder);
this._healthReporter = new ns.HealthReporter(HEALTHREPORT_BRANCH, this.policy);
// Wait for initialization to finish so if a shutdown occurs before init
// has finished we don't adversely affect app startup on next run.
@ -312,25 +295,6 @@ DataReportingService.prototype = Object.freeze({
resetClientID: Task.async(function* () {
return ClientID.resetClientID();
}),
/**
* Returns the SessionRecorder instance associated with the data reporting service.
* Returns an actual object only if FHR is enabled and after initialization,
* else returns undefined.
*/
getSessionRecorder: function() {
return this._simulateNoSessionRecorder ? undefined : this.sessionRecorder;
},
// These two simulate* methods below are only used for testings and control
// whether getSessionRecorder() behaves normally or forced to return undefined
simulateNoSessionRecorder() {
this._simulateNoSessionRecorder = true;
},
simulateRestoreSessionRecorder() {
this._simulateNoSessionRecorder = false;
},
});
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DataReportingService]);
@ -341,6 +305,4 @@ this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DataReportingService]);
;
#include policy.jsm
;
#include sessions.jsm
;

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

@ -16,7 +16,6 @@ EXTRA_PP_COMPONENTS += [
EXTRA_PP_JS_MODULES.services.datareporting += [
'policy.jsm',
'sessions.jsm',
]
TESTING_JS_MODULES.services.datareporting += [

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

@ -4,4 +4,3 @@ tail =
skip-if = toolkit == 'android' || toolkit == 'gonk'
[test_policy.js]
[test_session_recorder.js]

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

@ -28,6 +28,8 @@ Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/TelemetryStopwatch.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "TelemetryPing",
"resource://gre/modules/TelemetryPing.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "UpdateChannel",
"resource://gre/modules/UpdateChannel.jsm");
@ -1187,11 +1189,11 @@ AbstractHealthReporter.prototype = Object.freeze({
* @param policy
* (HealthReportPolicy) Policy driving execution of HealthReporter.
*/
this.HealthReporter = function (branch, policy, sessionRecorder, stateLeaf=null) {
this.HealthReporter = function (branch, policy, stateLeaf=null) {
this._stateLeaf = stateLeaf;
this._uploadInProgress = false;
AbstractHealthReporter.call(this, branch, policy, sessionRecorder);
AbstractHealthReporter.call(this, branch, policy, TelemetryPing.getSessionRecorder());
if (!this.serverURI) {
throw new Error("No server URI defined. Did you forget to define the pref?");

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

@ -130,8 +130,8 @@ this.createFakeCrash = function (submitted=false, date=new Date()) {
*
* The purpose of this type is to aid testing of startup and shutdown.
*/
this.InspectedHealthReporter = function (branch, policy, recorder, stateLeaf) {
HealthReporter.call(this, branch, policy, recorder, stateLeaf);
this.InspectedHealthReporter = function (branch, policy, stateLeaf) {
HealthReporter.call(this, branch, policy, stateLeaf);
this.onStorageCreated = null;
this.onProviderManagerInitialized = null;
@ -212,7 +212,7 @@ this.getHealthReporter = function (name, uri=DUMMY_URI, inspected=false) {
}
let policy = new DataReportingPolicy(policyPrefs, prefs, listener);
let type = inspected ? InspectedHealthReporter : HealthReporter;
reporter = new type(branch + "healthreport.", policy, null,
reporter = new type(branch + "healthreport.", policy,
"state-" + name + ".json");
return reporter;

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

@ -10,7 +10,7 @@ Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Metrics.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/services-common/utils.js");
Cu.import("resource://gre/modules/services/datareporting/sessions.jsm");
Cu.import("resource://gre/modules/SessionRecorder.jsm");
Cu.import("resource://gre/modules/services/healthreport/providers.jsm");

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

@ -11,6 +11,7 @@ RUN yum install -y epel-release && \
GConf2-devel \
alsa-lib-devel \
autoconf213 \
bc \
bison \
bzip2 \
ccache \

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

@ -1 +1 @@
0.2.6
0.2.7

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

@ -1,4 +1,4 @@
FROM quay.io/mozilla/b2g-build:0.2.6
FROM quay.io/mozilla/b2g-build:0.2.7
MAINTAINER Dustin J. Mitchell <dustin@mozilla.com>
ENV PYTHONPATH /tools/tools/lib/python:$PYTHONPATH

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

@ -1 +1 @@
0.5.3
0.5.4

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

@ -1,4 +1,4 @@
FROM quay.io/mozilla/builder:0.5.3
FROM quay.io/mozilla/builder:0.5.4
MAINTAINER Wander Lairson Costa <wcosta@mozilla.com>
# Add utilities and configuration

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

@ -1 +1 @@
0.0.11
0.0.12

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

@ -0,0 +1,66 @@
#! /bin/bash -vex
# Ensure all the scripts in this dir are on the path....
DIRNAME=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
PATH=$DIRNAME:$PATH
WORKSPACE=$1
### Check that require variables are defined
test -d $WORKSPACE
test $GECKO_HEAD_REPOSITORY # Should be an hg repository url to pull from
test $GECKO_BASE_REPOSITORY # Should be an hg repository url to clone from
test $GECKO_HEAD_REV # Should be an hg revision to pull down
test $MOZHARNESS_REPOSITORY # mozharness repository
test $MOZHARNESS_REV # mozharness revision
test $TARGET
test $VARIANT
. ../builder/setup-ccache.sh
# First check if the mozharness directory is available. This is intended to be
# used locally in development to test mozharness changes:
#
# $ docker -v your_mozharness:/home/worker/mozharness ...
#
if [ ! -d mozharness ]; then
tc-vcs checkout mozharness $MOZHARNESS_REPOSITORY $MOZHARNESS_REPOSITORY $MOZHARNESS_REV
fi
# Figure out where the remote manifest is so we can use caches for it.
MANIFEST=$(repository-url.py $GECKO_HEAD_REPOSITORY $GECKO_HEAD_REV b2g/config/$TARGET/sources.xml)
tc-vcs repo-checkout $WORKSPACE/B2G https://git.mozilla.org/b2g/B2G.git $MANIFEST
# Ensure symlink has been created to gecko...
rm -f $WORKSPACE/B2G/gecko
ln -s $WORKSPACE/gecko $WORKSPACE/B2G/gecko
debug_flag=""
if [ 0$B2G_DEBUG -ne 0 ]; then
debug_flag='--debug'
fi
./mozharness/scripts/b2g_build.py \
--config b2g/taskcluster-phone.py \
"$debug_flag" \
--disable-mock \
--variant=$VARIANT \
--work-dir=$WORKSPACE/B2G \
--gaia-languages-file $WORKSPACE/B2G/device/sprd/scx15/languages.json \
--log-level=debug \
--target=$TARGET \
--b2g-config-dir=$TARGET \
--checkout-revision=$GECKO_HEAD_REV \
--base-repo=$GECKO_BASE_REPOSITORY \
--repo=$GECKO_HEAD_REPOSITORY
# Move files into artifact locations!
mkdir -p $HOME/artifacts
mv $WORKSPACE/B2G/upload/sources.xml $HOME/artifacts/sources.xml
mv $WORKSPACE/B2G/upload/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
mv $WORKSPACE/B2G/upload/b2g-*.android-arm.tar.gz $HOME/artifacts/b2g-android-arm.tar.gz
mv $WORKSPACE/B2G/upload/${TARGET}.zip $HOME/artifacts/${TARGET}.zip
mv $WORKSPACE/B2G/upload/gaia.zip $HOME/artifacts/gaia.zip
ccache -s

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

@ -18,6 +18,10 @@ flags:
- win32_gecko # b2g desktop win 32 bit
- flame-kk # b2g flame kitkat
- flame-kk-eng # b2g flame eng build
- dolphin
- dolphin-eng
- dolphin-512
- dolphin-512-eng
tests:
- cppunit

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

@ -76,6 +76,30 @@ builds:
types:
opt:
task: tasks/builds/b2g_flame_kk_eng.yml
dolphin:
platforms:
- b2g
types:
opt:
task: tasks/builds/b2g_dolphin_opt.yml
dolphin-eng:
platforms:
- b2g
types:
opt:
task: tasks/builds/b2g_dolphin_eng.yml
dolphin-512:
platforms:
- b2g
types:
opt:
task: tasks/builds/b2g_dolphin_512_opt.yml
dolphin-512-eng:
platforms:
- b2g
types:
opt:
task: tasks/builds/b2g_dolphin_512_eng.yml
tests:
cppunit:

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

@ -0,0 +1,23 @@
$inherits:
from: 'tasks/builds/b2g_dolphin_base.yml'
task:
scopes:
- 'docker-worker:cache:build-dolphin-512-eng'
metadata:
name: '[TC] B2G Dolphin 512 Eng'
extra:
treeherder:
symbol: Be
groupSymbol: Dolphin-512
groupName: Dolphin 512 Device Image
machine:
platform: b2g-device-image
payload:
cache:
build-dolphin-512-eng: /home/worker/object-folder
env:
TARGET: 'dolphin-512'
VARIANT: eng

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

@ -0,0 +1,20 @@
$inherits:
from: 'tasks/builds/b2g_dolphin_base.yml'
task:
scopes:
- 'docker-worker:cache:build-dolphin-512-opt'
metadata:
name: '[TC] B2G Dolphin 512 Opt'
extra:
treeherder:
groupSymbol: Dolphin-512
groupName: Dolphin 512 Device Image
machine:
platform: b2g-device-image
payload:
cache:
build-dolphin-512-opt: /home/worker/object-folder
env:
TARGET: 'dolphin-512'

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

@ -0,0 +1,31 @@
$inherits:
from: 'tasks/phone_build.yml'
task:
workerType: dolphin
metadata:
description: |
Dolphin phones + b2g environment used in full stack testing.
payload:
env:
REPO_TRACE: 1
VARIANT: user
DEBUG: 0
# Dolphin could take more than one hours to build!
maxRunTime: 7200
command:
- >
checkout-gecko workspace &&
cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder &&
buildbot_step 'Build' ./build-dolphin.sh $HOME/workspace
extra:
# Rather then enforcing particular conventions we require that all build
# tasks provide the "build" extra field to specify where the build and tests
# files are located.
locations:
build: 'private/build/b2g-android-arm.tar.gz'
tests: 'private/build/gaia.zip'
symbols: 'private/build/b2g-crashreporter-symbols.zip'
sources: 'private/build/sources.xml'

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

@ -1,17 +1,22 @@
$inherits:
from: 'tasks/builds/b2g_phone_base.yml'
from: 'tasks/builds/b2g_dolphin_base.yml'
task:
scopes:
- 'docker-worker:cache:build-dolphin-eng'
metadata:
name: B2G Dolphin Eng
name: '[TC] B2G Dolphin Eng'
extra:
treeherder:
symbol: Be
groupSymbol: Dolphin
groupName: Dolphin Device Image
machine:
platform: b2g-device-image
payload:
cache:
build-hamachi-eng: /home/worker/object-folder
build-dolphin-eng: /home/worker/object-folder
env:
TARGET: 'dolphin'
DEBUG: 0
VARIANT: eng
extra:
locations:
img: 'private/build/dolphin.zip'

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

@ -0,0 +1,21 @@
$inherits:
from: 'tasks/builds/b2g_dolphin_base.yml'
task:
scopes:
- 'docker-worker:cache:build-dolphin-opt'
metadata:
name: '[TC] B2G Dolphin Opt'
extra:
treeherder:
groupSymbol: Dolphin
groupName: Dolphin Device Image
machine:
platform: b2g-device-image
payload:
cache:
build-dolphin-opt: /home/worker/object-folder
env:
TARGET: 'dolphin'

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

@ -1,17 +0,0 @@
$inherits:
from: 'tasks/builds/b2g_phone_base.yml'
task:
scopes:
- 'docker-worker:cache:build-dolphin-user'
metadata:
name: B2G Dolphin User
payload:
cache:
build-hamachi-user: /home/worker/object-folder
env:
TARGET: 'dolphin'
DEBUG: 0
extra:
locations:
img: 'private/build/dolphin.zip'

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