Merge m-c to inbound. a=merge

This commit is contained in:
Ryan VanderMeulen 2015-08-07 16:13:43 -04:00
commit 60100a0722
65 changed files with 806 additions and 546 deletions

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="59ce66c60e71b434061aeaf11e945814b234c355"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="59ce66c60e71b434061aeaf11e945814b234c355"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -128,7 +128,7 @@
<!-- Stock Android things -->
<project name="platform/external/icu4c" path="external/icu4c" revision="2bb01561780583cc37bc667f0ea79f48a122d8a2"/>
<!-- dolphin specific things -->
<project name="device/sprd" path="device/sprd" revision="09b87b777f1e03c81459d8cba55ba7fb95da3bab"/>
<project name="device/sprd" path="device/sprd" revision="f4aae37239c177f90044d28444a2cb518e34b11a"/>
<project name="platform/external/wpa_supplicant_8" path="external/wpa_supplicant_8" revision="39a5b5bcadad745df3e6882316fce426f98b1669"/>
<project name="platform/frameworks/av" path="frameworks/av" revision="8bb69db127112fc66da75f8ca7a1158614b919f6"/>
<project name="platform/hardware/akm" path="hardware/akm" revision="6d3be412647b0eab0adff8a2768736cf4eb68039"/>

View File

@ -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="59ce66c60e71b434061aeaf11e945814b234c355"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2d58f4b9206b50b8fda0d5036da6f0c62608db7c"/>

View File

@ -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="59ce66c60e71b434061aeaf11e945814b234c355"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="735805df70bc64af1e5b709133afb76499a92ee1"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="59ce66c60e71b434061aeaf11e945814b234c355"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="05a36844c1046a1eb07d5b1325f85ed741f961ea">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="59ce66c60e71b434061aeaf11e945814b234c355"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

View File

@ -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="59ce66c60e71b434061aeaf11e945814b234c355"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="2d58f4b9206b50b8fda0d5036da6f0c62608db7c"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e862ab9177af664f00b4522e2350f4cb13866d73">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="59ce66c60e71b434061aeaf11e945814b234c355"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

View File

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "59ce66c60e71b434061aeaf11e945814b234c355",
"git_revision": "68d369c2a2b0cd16db028f0c2e660107c52ce113",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "8ab354e8ef85b6ee872eb7eb1710a8e094c93b18",
"revision": "041d99d0bd97e84219626c711c4c709e9558dfaa",
"repo_path": "integration/gaia-central"
}

View File

@ -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="59ce66c60e71b434061aeaf11e945814b234c355"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="657894b4a1dc0a926117f4812e0940229f9f676f"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="735805df70bc64af1e5b709133afb76499a92ee1"/>

View File

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="05a36844c1046a1eb07d5b1325f85ed741f961ea">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="59ce66c60e71b434061aeaf11e945814b234c355"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="68d369c2a2b0cd16db028f0c2e660107c52ce113"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4d9fbc08e87731447c19e96e13d8c7444baafcca"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

View File

@ -6678,12 +6678,10 @@ var gIdentityHandler = {
IDENTITY_MODE_MIXED_ACTIVE_BLOCKED : "verifiedDomain mixedContent mixedActiveBlocked", // SSL with unauthenticated active content blocked; no unauthenticated display content
IDENTITY_MODE_MIXED_ACTIVE_BLOCKED_IDENTIFIED : "verifiedIdentity mixedContent mixedActiveBlocked", // SSL with unauthenticated active content blocked; no unauthenticated display content
IDENTITY_MODE_CHROMEUI : "chromeUI", // Part of the product's UI
IDENTITY_MODE_FILE_URI : "fileURI", // File path
// Cache the most recent SSLStatus and Location seen in checkIdentity
_lastStatus : null,
_lastUri : null,
_mode : "unknownIdentity",
_isChromeUI: false,
_sslStatus: null,
_uri: null,
// smart getters
get _identityPopup () {
@ -6714,20 +6712,10 @@ var gIdentityHandler = {
return this._identityPopupContentVerif =
document.getElementById("identity-popup-content-verifier");
},
get _identityPopupSecurityContent () {
delete this._identityPopupSecurityContent;
return this._identityPopupSecurityContent =
document.getElementById("identity-popup-security-content");
},
get _identityPopupSecurityView () {
delete this._identityPopupSecurityView;
return this._identityPopupSecurityView =
document.getElementById("identity-popup-securityView");
},
get _identityPopupMainView () {
delete this._identityPopupMainView;
return this._identityPopupMainView =
document.getElementById("identity-popup-mainView");
get _identityPopupMixedContentLearnMore () {
delete this._identityPopupMixedContentLearnMore;
return this._identityPopupMixedContentLearnMore =
document.getElementById("identity-popup-mcb-learn-more");
},
get _identityIconLabel () {
delete this._identityIconLabel;
@ -6806,13 +6794,33 @@ var gIdentityHandler = {
}
},
disableMixedContentProtection() {
// Use telemetry to measure how often unblocking happens
const kMIXED_CONTENT_UNBLOCK_EVENT = 2;
let histogram =
Services.telemetry.getHistogramById(
"MIXED_CONTENT_UNBLOCK_COUNTER");
histogram.add(kMIXED_CONTENT_UNBLOCK_EVENT);
// Reload the page with the content unblocked
BrowserReloadWithFlags(
Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_MIXED_CONTENT);
this._identityPopup.hidePopup();
},
enableMixedContentProtection() {
gBrowser.selectedBrowser.messageManager.sendAsyncMessage(
"MixedContent:ReenableProtection", {});
BrowserReload();
this._identityPopup.hidePopup();
},
/**
* Helper to parse out the important parts of _lastStatus (of the SSL cert in
* Helper to parse out the important parts of _sslStatus (of the SSL cert in
* particular) for use in constructing identity UI strings
*/
getIdentityData : function() {
var result = {};
var status = this._lastStatus.QueryInterface(Components.interfaces.nsISSLStatus);
var status = this._sslStatus.QueryInterface(Ci.nsISSLStatus);
var cert = status.serverCert;
// Human readable name of Subject
@ -6848,16 +6856,11 @@ var gIdentityHandler = {
* @param nsIURI uri The address for which the UI should be updated.
*/
checkIdentity : function(state, uri) {
var currentStatus = gBrowser.securityUI
.QueryInterface(Components.interfaces.nsISSLStatusProvider)
.SSLStatus;
this._lastStatus = currentStatus;
this._lastUri = uri;
let nsIWebProgressListener = Ci.nsIWebProgressListener;
// For some URIs like data: we can't get a host and so can't do
// anything useful here.
// For some URIs like data: we can't get a host. URIs without a host will
// usually be treated as a non-secure connection if they're not on the
// whitelist below and don't resolve to file:// URIs internally.
let unknown = false;
try {
uri.host;
@ -6867,49 +6870,54 @@ var gIdentityHandler = {
// whitelisted to provide a positive security signal to the user.
let whitelist = /^about:(accounts|addons|app-manager|config|crashes|customizing|downloads|healthreport|home|license|newaddon|permissions|preferences|privatebrowsing|rights|sessionrestore|support|welcomeback)/i;
let isChromeUI = uri.schemeIs("about") && whitelist.test(uri.spec);
let mode = this.IDENTITY_MODE_UNKNOWN;
if (isChromeUI) {
this.setMode(this.IDENTITY_MODE_CHROMEUI);
mode = this.IDENTITY_MODE_CHROMEUI;
} else if (unknown) {
this.setMode(this.IDENTITY_MODE_UNKNOWN);
// Use default mode.
} else if (state & nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL) {
if (state & nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT) {
this.setMode(this.IDENTITY_MODE_MIXED_ACTIVE_BLOCKED_IDENTIFIED);
mode = this.IDENTITY_MODE_MIXED_ACTIVE_BLOCKED_IDENTIFIED;
} else {
this.setMode(this.IDENTITY_MODE_IDENTIFIED);
mode = this.IDENTITY_MODE_IDENTIFIED;
}
} else if (state & nsIWebProgressListener.STATE_IS_SECURE) {
if (state & nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT) {
this.setMode(this.IDENTITY_MODE_MIXED_ACTIVE_BLOCKED);
mode = this.IDENTITY_MODE_MIXED_ACTIVE_BLOCKED;
} else {
this.setMode(this.IDENTITY_MODE_DOMAIN_VERIFIED);
mode = this.IDENTITY_MODE_DOMAIN_VERIFIED;
}
} else if (state & nsIWebProgressListener.STATE_IS_BROKEN) {
if (state & nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT) {
this.setMode(this.IDENTITY_MODE_MIXED_ACTIVE_LOADED);
mode = this.IDENTITY_MODE_MIXED_ACTIVE_LOADED;
} else if (state & nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT) {
this.setMode(this.IDENTITY_MODE_MIXED_DISPLAY_LOADED_ACTIVE_BLOCKED);
mode = this.IDENTITY_MODE_MIXED_DISPLAY_LOADED_ACTIVE_BLOCKED;
} else if (state & nsIWebProgressListener.STATE_LOADED_MIXED_DISPLAY_CONTENT) {
this.setMode(this.IDENTITY_MODE_MIXED_DISPLAY_LOADED);
mode = this.IDENTITY_MODE_MIXED_DISPLAY_LOADED;
} else {
this.setMode(this.IDENTITY_MODE_USES_WEAK_CIPHER);
}
} else {
// Create a channel for the sole purpose of getting the resolved URI
// of the request to determine if it's loaded from the file system.
let resolvedURI = NetUtil.newChannel({uri,loadUsingSystemPrincipal:true}).URI;
if (resolvedURI.schemeIs("jar")) {
// Given a URI "jar:<jar-file-uri>!/<jar-entry>"
// create a new URI using <jar-file-uri>!/<jar-entry>
resolvedURI = NetUtil.newURI(resolvedURI.path);
}
if (resolvedURI.schemeIs("file")) {
this.setMode(this.IDENTITY_MODE_FILE_URI);
} else {
this.setMode(this.IDENTITY_MODE_UNKNOWN);
mode = this.IDENTITY_MODE_USES_WEAK_CIPHER;
}
}
// We need those values later when populating the control center.
this._uri = uri;
this._state = state;
this._isChromeUI = isChromeUI;
this._sslStatus =
gBrowser.securityUI.QueryInterface(Ci.nsISSLStatusProvider).SSLStatus;
// Update the identity block.
if (this._identityBox) {
this._identityBox.className = mode;
this.refreshIdentityBlock(mode);
}
// NOTE: We do NOT update the identity popup (the control center) when
// we receive a new security state. If the user opened the popup and looks
// at the provided information we don't want to suddenly change the panel
// contents.
// Show the doorhanger when:
// - mixed active content is blocked
// - mixed active content is loaded (detected but not blocked)
@ -6961,46 +6969,22 @@ var gIdentityHandler = {
.getService(Ci.nsIIDNService);
try {
let baseDomain =
Services.eTLD.getBaseDomainFromHost(this._lastUri.host);
Services.eTLD.getBaseDomainFromHost(this._uri.host);
return this._IDNService.convertToDisplayIDN(baseDomain, {});
} catch (e) {
// If something goes wrong (e.g. host is an IP address) just fail back
// to the full domain.
return this._lastUri.host;
return this._uri.host;
}
},
/**
* Update the UI to reflect the specified mode, which should be one of the
* IDENTITY_MODE_* constants.
*/
setMode : function(newMode) {
if (!this._identityBox) {
// No identity box means the identity box is not visible, in which
// case there's nothing to do.
return;
}
this._identityPopup.className = newMode;
this._identityBox.className = newMode;
this.setIdentityMessages(newMode);
// Update the popup too, if it's open
if (this._identityPopup.state == "open") {
this.setPopupMessages(newMode);
this.updateSitePermissions();
}
this._mode = newMode;
},
/**
* Set up the messages for the primary identity UI based on the specified mode,
* and the details of the SSL cert, where applicable
*
* @param newMode The newly set identity mode. Should be one of the IDENTITY_MODE_* constants.
*/
setIdentityMessages : function(newMode) {
refreshIdentityBlock(newMode) {
let icon_label = "";
let tooltip = "";
let icon_country_label = "";
@ -7017,11 +7001,11 @@ var gIdentityHandler = {
[iData.caOrg]);
// This can't throw, because URI's with a host that throw don't end up in this case.
let host = this._lastUri.host;
let host = this._uri.host;
let port = 443;
try {
if (this._lastUri.port > 0)
port = this._lastUri.port;
if (this._uri.port > 0)
port = this._uri.port;
} catch (e) {}
if (this._overrideService.hasMatchingOverride(host, port, iData.cert, {}, {}))
@ -7070,15 +7054,78 @@ var gIdentityHandler = {
* Set up the title and content messages for the identity message popup,
* based on the specified mode, and the details of the SSL cert, where
* applicable
*
* @param newMode The newly set identity mode. Should be one of the IDENTITY_MODE_* constants.
*/
setPopupMessages : function(newMode) {
refreshIdentityPopup() {
// Update the "Learn More" hrefs for Mixed Content Blocking.
let baseURL = Services.urlFormatter.formatURLPref("app.support.baseURL");
let learnMoreHref = `${baseURL}mixed-content`;
this._identityPopupMixedContentLearnMore.setAttribute("href", learnMoreHref);
this._identityPopup.className = newMode;
this._identityPopupMainView.className = newMode;
this._identityPopupSecurityView.className = newMode;
this._identityPopupSecurityContent.className = newMode;
// Basic connection properties.
let isBroken = this._state & Ci.nsIWebProgressListener.STATE_IS_BROKEN;
let isSecure = this._state & Ci.nsIWebProgressListener.STATE_IS_SECURE;
let isEV = this._state & Ci.nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL;
// Determine connection security information.
let connection = "not-secure";
if (this._isChromeUI) {
connection = "chrome";
} else if (this._isURILoadedFromFile(this._uri)) {
connection = "file";
} else if (isEV) {
connection = "secure-ev";
} else if (isSecure) {
connection = "secure";
}
// Mixed content flags.
let isMixedActiveContentLoaded =
this._state & Ci.nsIWebProgressListener.STATE_LOADED_MIXED_ACTIVE_CONTENT;
let isMixedActiveContentBlocked =
this._state & Ci.nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT;
let isMixedPassiveContentLoaded =
this._state & Ci.nsIWebProgressListener.STATE_LOADED_MIXED_DISPLAY_CONTENT;
// Determine the mixed content state.
let mixedcontent = [];
if (isMixedPassiveContentLoaded) {
mixedcontent.push("passive-loaded");
}
if (isMixedActiveContentLoaded) {
mixedcontent.push("active-loaded");
} else if (isMixedActiveContentBlocked) {
mixedcontent.push("active-blocked");
}
mixedcontent = mixedcontent.join(" ");
// We have no specific flags for weak ciphers (yet). If a connection is
// broken and we can't detect any mixed active content loaded then it's
// a weak cipher.
let ciphers = "";
if (isBroken && !isMixedActiveContentLoaded) {
ciphers = "weak";
}
// Update all elements.
let elementIDs = [
"identity-popup",
"identity-popup-securityView-body",
];
function updateAttribute(elem, attr, value) {
if (value) {
elem.setAttribute(attr, value);
} else {
elem.removeAttribute(attr);
}
}
for (let id of elementIDs) {
let element = document.getElementById(id);
updateAttribute(element, "connection", connection);
updateAttribute(element, "ciphers", ciphers);
updateAttribute(element, "mixedcontent", mixedcontent);
}
// Initialize the optional strings to empty values
let supplemental = "";
@ -7092,19 +7139,18 @@ var gIdentityHandler = {
// Some URIs might have no hosts.
}
// Fallback for special protocols.
if (!host) {
// Fallback for special protocols.
host = this._lastUri.specIgnoringRef;
host = this._uri.specIgnoringRef;
}
switch (newMode) {
case this.IDENTITY_MODE_DOMAIN_VERIFIED:
case this.IDENTITY_MODE_MIXED_ACTIVE_BLOCKED:
// Fill in the CA name if we have a valid TLS certificate.
if (isSecure) {
verifier = this._identityBox.tooltipText;
break;
case this.IDENTITY_MODE_IDENTIFIED:
case this.IDENTITY_MODE_MIXED_ACTIVE_BLOCKED_IDENTIFIED: {
// If it's identified, then we can populate the dialog with credentials
}
// Fill in organization information if we have a valid EV certificate.
if (isEV) {
let iData = this.getIdentityData();
host = owner = iData.subjectOrg;
verifier = this._identityBox.tooltipText;
@ -7119,21 +7165,6 @@ var gIdentityHandler = {
supplemental += iData.state;
else if (iData.country) // Country only
supplemental += iData.country;
break;
}
case this.IDENTITY_MODE_UNKNOWN:
supplemental = gNavigatorBundle.getString("identity.not_secure");
break;
case this.IDENTITY_MODE_USES_WEAK_CIPHER:
supplemental = gNavigatorBundle.getString("identity.uses_weak_cipher");
break;
case this.IDENTITY_MODE_MIXED_DISPLAY_LOADED:
case this.IDENTITY_MODE_MIXED_DISPLAY_LOADED_ACTIVE_BLOCKED:
supplemental = gNavigatorBundle.getString("identity.mixed_display_loaded");
break;
case this.IDENTITY_MODE_MIXED_ACTIVE_LOADED:
supplemental = gNavigatorBundle.getString("identity.mixed_active_loaded2");
break;
}
// Push the appropriate strings out to the UI. Need to use |value| for the
@ -7144,8 +7175,23 @@ var gIdentityHandler = {
this._identityPopupContentSupp.textContent = supplemental;
this._identityPopupContentVerif.textContent = verifier;
// Hide subviews when updating panel information.
document.getElementById("identity-popup-multiView").showMainView();
// Update per-site permissions section.
this.updateSitePermissions();
},
_isURILoadedFromFile(uri) {
// Create a channel for the sole purpose of getting the resolved URI
// of the request to determine if it's loaded from the file system.
let chanOptions = {uri, loadUsingSystemPrincipal: true};
let resolvedURI = NetUtil.newChannel(chanOptions).URI;
if (resolvedURI.schemeIs("jar")) {
// Given a URI "jar:<jar-file-uri>!/<jar-entry>"
// create a new URI using <jar-file-uri>!/<jar-entry>
resolvedURI = NetUtil.newURI(resolvedURI.path);
}
// Check the URI again after resolving.
return resolvedURI.schemeIs("file");
},
/**
@ -7170,9 +7216,7 @@ var gIdentityHandler = {
this._identityPopup.hidden = false;
// Update the popup strings
this.setPopupMessages(this._identityBox.className);
this.updateSitePermissions();
this.refreshIdentityPopup();
// Add the "open" attribute to the identity box for styling
this._identityBox.setAttribute("open", "true");

View File

@ -2,6 +2,8 @@
* Test the identity mode UI for a variety of page types
*/
"use strict";
const DUMMY = "browser/browser/base/content/test/general/dummy_page.html";
function loadNewTab(url) {
@ -12,6 +14,11 @@ function getIdentityMode() {
return document.getElementById("identity-box").className;
}
function getConnectionState() {
gIdentityHandler.refreshIdentityPopup();
return document.getElementById("identity-popup").getAttribute("connection");
}
// This test is slow on Linux debug e10s
requestLongerTimeout(2);
@ -49,13 +56,13 @@ add_task(function* test_chrome() {
let oldTab = gBrowser.selectedTab;
let newTab = yield loadNewTab("chrome://mozapps/content/extensions/extensions.xul");
is(getIdentityMode(), "fileURI", "Identity should be file");
is(getConnectionState(), "file", "Connection should be file");
gBrowser.selectedTab = oldTab;
is(getIdentityMode(), "unknownIdentity", "Identity should be unknown");
gBrowser.selectedTab = newTab;
is(getIdentityMode(), "fileURI", "Identity should be file");
is(getConnectionState(), "file", "Connection should be file");
gBrowser.removeTab(newTab);
});
@ -95,30 +102,30 @@ add_task(function* test_file() {
let fileURI = getTestFilePath("");
let newTab = yield loadNewTab(fileURI);
is(getIdentityMode(), "fileURI", "Identity should be file");
is(getConnectionState(), "file", "Connection should be file");
gBrowser.selectedTab = oldTab;
is(getIdentityMode(), "unknownIdentity", "Identity should be unknown");
gBrowser.selectedTab = newTab;
is(getIdentityMode(), "fileURI", "Identity should be file");
is(getConnectionState(), "file", "Connection should be file");
gBrowser.removeTab(newTab);
});
add_task(function test_resource_uri() {
let oldTab = gBrowser.selectedTab;
let dataURI = "resource://gre/modules/Services.jsm"
let dataURI = "resource://gre/modules/Services.jsm";
let newTab = yield loadNewTab(dataURI);
is(getIdentityMode(), "fileURI", "Identity should be unknown");
is(getConnectionState(), "file", "Connection should be file");
gBrowser.selectedTab = oldTab;
is(getIdentityMode(), "unknownIdentity", "Identity should be unknown");
gBrowser.selectedTab = newTab;
is(getIdentityMode(), "fileURI", "Identity should be unknown");
is(getConnectionState(), "file", "Connection should be file");
gBrowser.removeTab(newTab);
});
@ -138,3 +145,19 @@ add_task(function test_data_uri() {
gBrowser.removeTab(newTab);
});
add_task(function test_about_uri() {
let oldTab = gBrowser.selectedTab;
let aboutURI = "about:robots"
let newTab = yield loadNewTab(aboutURI);
is(getConnectionState(), "file", "Connection should be file");
gBrowser.selectedTab = oldTab;
is(getIdentityMode(), "unknownIdentity", "Identity should be unknown");
gBrowser.selectedTab = newTab;
is(getConnectionState(), "file", "Connection should be file");
gBrowser.removeTab(newTab);
});

View File

@ -43,7 +43,6 @@ var tests = [
{
name: "subdomain HTTPS",
location: "https://test1.example.com/",
effectiveHost: "example.com",
isHTTPS: true
},
@ -104,12 +103,14 @@ function nextTest() {
function checkResult() {
// Sanity check other values, and the value of gIdentityHandler.getEffectiveHost()
is(gIdentityHandler._lastUri.spec, gCurrentTest.location, "location matches for test " + gTestDesc);
is(gIdentityHandler._uri.spec, gCurrentTest.location, "location matches for test " + gTestDesc);
// getEffectiveHost can't be called for all modes
if (gCurrentTest.effectiveHost === null)
is(gIdentityHandler._mode == gIdentityHandler.IDENTITY_MODE_UNKNOWN || gIdentityHandler._mode == gIdentityHandler.IDENTITY_MODE_CHROMEUI, true, "mode matched");
else
if (gCurrentTest.effectiveHost === null) {
let identityBox = document.getElementById("identity-box");
is(identityBox.className == gIdentityHandler.IDENTITY_MODE_UNKNOWN || identityBox.className == gIdentityHandler.IDENTITY_MODE_CHROMEUI, true, "mode matched");
} else {
is(gIdentityHandler.getEffectiveHost(), gCurrentTest.effectiveHost, "effectiveHost matches for test " + gTestDesc);
}
executeSoon(nextTest);
}

View File

@ -10,7 +10,8 @@
orient="vertical">
<broadcasterset>
<broadcaster id="identity-popup-content-host" value=""/>
<broadcaster id="identity-popup-content-host" class="identity-popup-headline" crop="end"/>
<broadcaster id="identity-popup-mcb-learn-more" class="text-link plain" value="&identity.learnMore;"/>
</broadcasterset>
<panelmultiview id="identity-popup-multiView"
@ -18,39 +19,50 @@
<panelview id="identity-popup-mainView" flex="1">
<!-- Security Section -->
<hbox class="identity-popup-section">
<hbox id="identity-popup-security" class="identity-popup-section">
<vbox id="identity-popup-security-content" flex="1">
<label class="identity-popup-headline" crop="end">
<observes element="identity-popup-content-host" attribute="value"/>
</label>
<label class="identity-popup-connection-secure identity-popup-text"
value="&identity.connectionSecure;"/>
<label class="identity-popup-connection-not-secure identity-popup-text"
value="&identity.connectionNotSecure;"/>
<label class="identity-popup-connection-file-uri identity-popup-text"
value="&identity.connectionFile;"/>
<label class="identity-popup-connection-internal identity-popup-text"
value="&identity.connectionInternal;"/>
<label observes="identity-popup-content-host"/>
<description class="identity-popup-connection-not-secure"
value="&identity.connectionNotSecure;"
when-connection="not-secure"/>
<description class="identity-popup-connection-secure"
value="&identity.connectionSecure;"
when-connection="secure secure-ev"/>
<description value="&identity.connectionInternal;"
when-connection="chrome"/>
<description value="&identity.connectionFile;"
when-connection="file"/>
<vbox id="identity-popup-security-descriptions">
<description class="identity-popup-warning-gray"
when-mixedcontent="active-blocked">&identity.activeBlocked;</description>
<description class="identity-popup-warning-yellow"
when-mixedcontent="passive-loaded">&identity.passiveLoaded;</description>
<description when-mixedcontent="active-loaded">&identity.activeLoaded;</description>
<description class="identity-popup-warning-yellow"
when-ciphers="weak">&identity.weakEncryption;</description>
</vbox>
</vbox>
<button class="identity-popup-expander"
<button id="identity-popup-security-expander"
class="identity-popup-expander"
when-connection="not-secure secure secure-ev"
oncommand="gIdentityHandler.toggleSubView('security', this)"/>
</hbox>
<!-- Tracking Protection Section -->
<hbox id="tracking-protection-container" class="identity-popup-section">
<hbox id="tracking-protection-container"
class="identity-popup-section"
when-connection="not-secure secure secure-ev file">
<vbox id="tracking-protection-content" flex="1">
<description class="identity-popup-text identity-popup-headline"
<description class="identity-popup-headline"
crop="end"
value="&trackingProtection.title;" />
<label id="tracking-blocked"
class="identity-popup-text"
crop="end">&trackingProtection.detectedBlocked2;</label>
<label id="tracking-loaded"
class="identity-popup-text"
crop="end">&trackingProtection.detectedNotBlocked2;</label>
<label id="tracking-not-detected"
class="identity-popup-text"
crop="end">&trackingProtection.notDetected2;</label>
<button id="tracking-action-unblock"
@ -71,7 +83,7 @@
<!-- Permissions Section -->
<hbox id="identity-popup-permissions" class="identity-popup-section">
<vbox id="identity-popup-permissions-content" flex="1">
<label class="identity-popup-text identity-popup-headline"
<label class="identity-popup-headline"
value="&identity.permissions;"/>
<vbox id="identity-popup-permission-list"/>
</vbox>
@ -90,29 +102,63 @@
<!-- Security SubView -->
<panelview id="identity-popup-securityView" flex="1">
<vbox id="identity-popup-securityView-header">
<label class="identity-popup-headline" crop="end">
<observes element="identity-popup-content-host" attribute="value"/>
</label>
<label class="identity-popup-connection-secure identity-popup-text"
value="&identity.connectionSecure;"/>
<label class="identity-popup-connection-not-secure identity-popup-text"
value="&identity.connectionNotSecure;"/>
<label class="identity-popup-connection-file-uri identity-popup-text"
value="&identity.connectionFile;"/>
<label class="identity-popup-connection-internal identity-popup-text"
value="&identity.connectionInternal;"/>
<label observes="identity-popup-content-host"/>
<description class="identity-popup-connection-not-secure"
value="&identity.connectionNotSecure;"
when-connection="not-secure"/>
<description class="identity-popup-connection-secure"
value="&identity.connectionSecure;"
when-connection="secure secure-ev"/>
</vbox>
<description id="identity-popup-content-verifier"
class="identity-popup-text"/>
<vbox id="identity-popup-securityView-body">
<!-- (EV) Certificate Information -->
<description id="identity-popup-content-verified-by"
when-connection="secure-ev">&identity.connectionVerified;</description>
<description id="identity-popup-content-owner"
when-connection="secure-ev"
class="header"/>
<description id="identity-popup-content-supplemental"
when-connection="secure-ev"/>
<description id="identity-popup-content-verifier"
when-connection="secure secure-ev"/>
<description id="identity-popup-securityView-connection"
class="identity-popup-text">&identity.connectionVerified;</description>
<!-- Connection is Not Secure -->
<description when-connection="not-secure">&identity.description.insecure;</description>
<description id="identity-popup-content-owner"
class="identity-popup-text"/>
<description id="identity-popup-content-supplemental"
class="identity-popup-text"/>
<!-- Weak Cipher -->
<description when-ciphers="weak">&identity.description.weakCipher;</description>
<description class="identity-popup-warning-yellow"
when-ciphers="weak">&identity.description.weakCipher2;</description>
<!-- Active Mixed Content Blocked -->
<description class="identity-popup-warning-gray"
when-mixedcontent="active-blocked">&identity.description.activeBlocked; <label observes="identity-popup-mcb-learn-more"/></description>
<!-- Passive Mixed Content Loaded -->
<description when-mixedcontent="passive-loaded">&identity.description.passiveLoaded;</description>
<description class="identity-popup-warning-yellow"
when-mixedcontent="passive-loaded">&identity.description.passiveLoaded2; <label observes="identity-popup-mcb-learn-more"/></description>
<!-- Passive Mixed Content Loaded, Active Mixed Content Blocked -->
<description when-mixedcontent="passive-loaded active-blocked">&identity.description.passiveLoaded;</description>
<description when-mixedcontent="passive-loaded active-blocked"
class="identity-popup-warning-yellow">&identity.description.passiveLoaded3; <label observes="identity-popup-mcb-learn-more"/></description>
<!-- Active Mixed Content Blocking Disabled -->
<description when-mixedcontent="active-loaded">&identity.description.activeLoaded;</description>
<description when-mixedcontent="active-loaded">&identity.description.activeLoaded2;</description>
<!-- Buttons to enable/disable mixed content blocking. -->
<button when-mixedcontent="active-blocked"
label="&identity.disableMixedContentBlocking.label;"
accesskey="&identity.disableMixedContentBlocking.accesskey;"
oncommand="gIdentityHandler.disableMixedContentProtection()"/>
<button when-mixedcontent="active-loaded"
label="&identity.enableMixedContentBlocking.label;"
accesskey="&identity.enableMixedContentBlocking.accesskey;"
oncommand="gIdentityHandler.enableMixedContentProtection()"/>
</vbox>
</panelview>
</panelmultiview>
</panel>

View File

@ -293,7 +293,7 @@
</deck>
</groupbox>
<groupbox id="syncOptions">
<caption><label>&signedIn.engines.caption;</label></caption>
<caption><label>&signedIn.engines.label;</label></caption>
<hbox id="fxaSyncEngines">
<vbox align="start">
<checkbox label="&engine.tabs.label;"
@ -360,7 +360,7 @@
<label>&mobilePromo.end;</label>
</hbox>
<spacer flex="1"/>
<vbox id="tosPP-small">
<vbox id="tosPP-small" align="start">
<label id="tosPP-small-ToS" class="text-link">
&prefs.tosLink.label;
</label>

View File

@ -691,6 +691,29 @@ you can use these alternative items. Otherwise, their values should be empty. -
<!ENTITY identity.connectionVerified "&brandShortName; verified that you are securely connected to this site, run by:">
<!ENTITY identity.connectionInternal "This is a secure &brandShortName; page.">
<!-- Strings for connection state warnings. -->
<!ENTITY identity.activeBlocked "&brandShortName; has blocked parts of this page that are not secure.">
<!ENTITY identity.passiveLoaded "Parts of this page are not secure (such as images).">
<!ENTITY identity.activeLoaded "You have disabled protection on this page.">
<!ENTITY identity.weakEncryption "This page uses weak encryption.">
<!-- Strings for connection state warnings in the subview. -->
<!ENTITY identity.description.insecure "Your connection to this site is not private. Information you submit could be viewed by others (like passwords, messages, credit cards, etc.).">
<!ENTITY identity.description.weakCipher "Your connection to this website uses weak encryption and is not private.">
<!ENTITY identity.description.weakCipher2 "Other people can view your information or modify the website's behavior.">
<!ENTITY identity.description.activeBlocked "&brandShortName; has blocked parts of this page that are not secure.">
<!ENTITY identity.description.passiveLoaded "Your connection is not private and information you share with the site could be viewed by others.">
<!ENTITY identity.description.passiveLoaded2 "This website contains content that is not secure (such as images).">
<!ENTITY identity.description.passiveLoaded3 "Although &brandShortName; has blocked some content, there is still content on the page that is not secure (such as images).">
<!ENTITY identity.description.activeLoaded "This website contains content that is not secure (such as scripts) and your connection to it is not private.">
<!ENTITY identity.description.activeLoaded2 "Information you share with this site could be viewed by others (like passwords, messages, credit cards, etc.).">
<!ENTITY identity.enableMixedContentBlocking.label "Enable protection">
<!ENTITY identity.enableMixedContentBlocking.accesskey "E">
<!ENTITY identity.disableMixedContentBlocking.label "Disable protection for now">
<!ENTITY identity.disableMixedContentBlocking.accesskey "D">
<!ENTITY identity.learnMore "Learn More">
<!ENTITY identity.moreInfoLinkText2 "More Information">
<!ENTITY identity.permissions "Permissions">

View File

@ -329,11 +329,6 @@ identity.identified.verifier=Verified by: %S
identity.identified.verified_by_you=You have added a security exception for this site.
identity.identified.state_and_country=%S, %S
identity.not_secure=Your connection to this site is not private. Information you submit could be viewable to others (for example passwords, messages, credit cards, etc.).
identity.uses_weak_cipher=Your connection to this website uses weak encryption and is not private. Other people can view your information or modify the website's behavior.
identity.mixed_display_loaded=The connection to this website is not fully secure because it contains unencrypted elements (such as images).
identity.mixed_active_loaded2=This website contains interactive content that isn't encrypted (such as scripts). Other people can view your information or modify the website's behavior.
identity.unknown.tooltip=This website does not supply identity information.
trackingProtection.intro.title=How Tracking Protection works

View File

@ -89,7 +89,7 @@ both, to better adapt this sentence to their language.
<!ENTITY signedOut.accountBox.create "Create Account">
<!ENTITY signedOut.accountBox.signin "Sign In">
<!ENTITY signedIn.engines.caption "Sync between all devices">
<!ENTITY signedIn.engines.label "Sync across all devices">
<!ENTITY mobilePromo.start "Download Firefox for ">
<!-- LOCALIZATION NOTE (mobilePromo.androidLink): This is a link title that links to https://www.mozilla.org/firefox/android/ -->

View File

@ -21,20 +21,23 @@
#tracking-action-block,
#tracking-action-unblock,
#tracking-action-unblock-private {
#tracking-action-unblock-private,
#identity-popup-securityView-body > button {
@hudButton@
min-height: 30px;
}
#tracking-action-block:hover:active,
#tracking-action-unblock:hover:active,
#tracking-action-unblock-private:hover:active {
#tracking-action-unblock-private:hover:active,
#identity-popup-securityView-body > button:hover:active {
@hudButtonPressed@
}
#tracking-action-block:-moz-focusring,
#tracking-action-unblock:-moz-focusring,
#tracking-action-unblock-private:-moz-focusring {
#tracking-action-unblock-private:-moz-focusring,
#identity-popup-securityView-body > button:-moz-focusring {
@hudButtonFocused@
}

View File

@ -195,8 +195,10 @@ browser.jar:
skin/classic/browser/controlcenter/conn-degraded.svg (../shared/controlcenter/conn-degraded.svg)
skin/classic/browser/controlcenter/mcb-disabled.svg (../shared/controlcenter/mcb-disabled.svg)
skin/classic/browser/controlcenter/permissions.svg (../shared/controlcenter/permissions.svg)
skin/classic/browser/controlcenter/tracking-protection.svg (../shared/controlcenter/tracking-protection.svg)
skin/classic/browser/controlcenter/tracking-protection-disabled.svg (../shared/controlcenter/tracking-protection-disabled.svg)
skin/classic/browser/controlcenter/tracking-protection.svg (../shared/controlcenter/tracking-protection.svg)
skin/classic/browser/controlcenter/tracking-protection-disabled.svg (../shared/controlcenter/tracking-protection-disabled.svg)
skin/classic/browser/controlcenter/warning-gray.svg (../shared/controlcenter/warning-gray.svg)
skin/classic/browser/controlcenter/warning-yellow.svg (../shared/controlcenter/warning-yellow.svg)
skin/classic/browser/customizableui/background-noise-toolbar.png (customizableui/background-noise-toolbar.png)
skin/classic/browser/customizableui/customize-titleBar-toggle.png (customizableui/customize-titleBar-toggle.png)
skin/classic/browser/customizableui/customize-titleBar-toggle@2x.png (customizableui/customize-titleBar-toggle@2x.png)

View File

@ -1,33 +1,39 @@
/* Show the organization name only for EV certs. */
#identity-popup-securityView:not(.verifiedIdentity) > #identity-popup-content-owner,
#identity-popup-securityView:not(.verifiedIdentity) > #identity-popup-securityView-connection,
/* Show the "Verified by" label only for DV and EV certs. */
#identity-popup-securityView:not(.verifiedIdentity):not(.verifiedDomain) > #identity-popup-content-verifier,
/* Show a longer explanation for non-secure sites, mixed content, and weak
connection security. Show the organization address for EV certs. */
#identity-popup-securityView:not(.unknownIdentity):not(.verifiedIdentity):not(.mixedContent):not(.weakCipher) > #identity-popup-content-supplemental,
/* Show the "Connection is secure" labels only for EV and DV certs. */
#identity-popup-security-content:not(.verifiedIdentity):not(.verifiedDomain) > .identity-popup-connection-secure,
#identity-popup-securityView:not(.verifiedIdentity):not(.verifiedDomain) > #identity-popup-securityView-header > .identity-popup-connection-secure,
/* Show the "Connection is not secure" labels only for non-secure sites. */
#identity-popup-security-content:not(.unknownIdentity) > .identity-popup-connection-not-secure,
#identity-popup-securityView:not(.unknownIdentity) > #identity-popup-securityView-header > .identity-popup-connection-not-secure,
/* Show "This page is stored on your computer" only for file URLs. */
#identity-popup-security-content:not(.fileURI) > .identity-popup-connection-file-uri,
#identity-popup-securityView:not(.fileURI) > #identity-popup-securityView-header > .identity-popup-connection-file-uri,
/* Show "This is a secure internal page" only for whitelisted pages. */
#identity-popup-securityView:not(.chromeUI) > #identity-popup-securityView-header > .identity-popup-connection-internal,
#identity-popup-security-content:not(.chromeUI) > .identity-popup-connection-internal,
/* Hide the subsection arrow for whitelisted chromeUI pages. */
#identity-popup-security-content.chromeUI + .identity-popup-expander,
/* Hide the subsection arrow for whitelisted file URI pages. */
#identity-popup-security-content.fileURI + .identity-popup-expander,
/* Hide the tracking protection section for whitelisted chromeUI pages. */
#identity-popup-mainView.chromeUI > #tracking-protection-container {
%if 0
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
%endif
/* Hide all conditional elements by default. */
:-moz-any([when-connection],[when-mixedcontent],[when-ciphers]) {
display: none;
}
/* PANEL */
/* Show the right elements for the right connection states. */
#identity-popup[connection=not-secure] [when-connection~=not-secure],
#identity-popup[connection=secure-ev] [when-connection~=secure-ev],
#identity-popup[connection=secure] [when-connection~=secure],
#identity-popup[connection=chrome] [when-connection~=chrome],
#identity-popup[connection=file] [when-connection~=file],
/* Show weak cipher messages when needed. */
#identity-popup[ciphers=weak]:not([mixedcontent]) [when-ciphers~=weak],
/* Show mixed content warnings when needed */
#identity-popup[mixedcontent~=active-loaded] [when-mixedcontent=active-loaded],
#identity-popup[mixedcontent~=passive-loaded]:not([mixedcontent~=active-loaded]) [when-mixedcontent=passive-loaded],
#identity-popup[mixedcontent~=active-blocked]:not([mixedcontent~=passive-loaded]) [when-mixedcontent=active-blocked],
/* Show the right elements when there is mixed passive content loaded and active blocked. */
#identity-popup[mixedcontent~=active-blocked][mixedcontent~=passive-loaded] [when-mixedcontent~=active-blocked][when-mixedcontent~=passive-loaded],
/* Show 'disable MCB' button always when there is mixed active content blocked. */
#identity-popup-securityView-body[mixedcontent~=active-blocked] > button[when-mixedcontent=active-blocked] {
display: inherit;
}
/* Hide 'not secure' message in subview when weak cipher or mixed content messages are shown. */
#identity-popup-securityView-body:-moz-any([mixedcontent],[ciphers]) > description[when-connection=not-secure],
/* Hide 'passive-loaded (only)' message when there is mixed passive content loaded and active blocked. */
#identity-popup-securityView-body[mixedcontent~=passive-loaded][mixedcontent~=active-blocked] > description[when-mixedcontent=passive-loaded] {
display: none;
}
#identity-popup,
#identity-popup:not([panelopen]) .panel-viewstack[viewtype="main"]:not([transitioning]) #identity-popup-mainView {
@ -143,7 +149,11 @@
/* CONTENT */
.identity-popup-text {
#identity-popup-security-content > description,
#identity-popup-security-descriptions > description,
#identity-popup-securityView-header > description,
#identity-popup-securityView-body > description,
#tracking-protection-content > label {
white-space: pre-wrap;
font-size: 110%;
margin: 0;
@ -154,12 +164,18 @@
font-size: 150%;
}
/* SECURITY */
#identity-popup-securityView > .identity-popup-text:not(#identity-popup-content-owner) {
margin: 2px 0 4px;
.identity-popup-warning-gray {
-moz-padding-start: 24px;
background: url(chrome://browser/skin/controlcenter/warning-gray.svg) no-repeat 0 50%;
}
.identity-popup-warning-yellow {
-moz-padding-start: 24px;
background: url(chrome://browser/skin/controlcenter/warning-yellow.svg) no-repeat 0 50%;
}
/* SECURITY */
.identity-popup-connection-secure {
color: #418220;
}
@ -168,12 +184,6 @@
color: #d74345;
}
#identity-popup-security-content.chromeUI {
background-image: url(chrome://branding/content/icon48.png);
}
/* SECURITY SUBVIEW */
#identity-popup-securityView {
padding-bottom: 2em;
overflow: hidden;
@ -184,46 +194,59 @@
background-image: url(chrome://browser/skin/controlcenter/conn-not-secure.svg);
}
#identity-popup-securityView.verifiedDomain,
#identity-popup-securityView.verifiedIdentity,
#identity-popup-security-content.verifiedDomain,
#identity-popup-security-content.verifiedIdentity {
#identity-popup[connection=chrome] #identity-popup-securityView,
#identity-popup[connection=chrome] #identity-popup-security-content {
background-image: url(chrome://branding/content/icon48.png);
}
#identity-popup[connection^=secure] #identity-popup-securityView,
#identity-popup[connection^=secure] #identity-popup-security-content {
background-image: url(chrome://browser/skin/controlcenter/conn-secure.svg);
}
#identity-popup-securityView.weakCipher,
#identity-popup-securityView.mixedDisplayContent,
#identity-popup-securityView.mixedDisplayContentLoadedActiveBlocked,
#identity-popup-security-content.weakCipher,
#identity-popup-security-content.mixedDisplayContent,
#identity-popup-security-content.mixedDisplayContentLoadedActiveBlocked {
#identity-popup[ciphers=weak] #identity-popup-securityView,
#identity-popup[ciphers=weak] #identity-popup-security-content,
#identity-popup[mixedcontent~=passive-loaded] #identity-popup-securityView,
#identity-popup[mixedcontent~=passive-loaded] #identity-popup-security-content {
background-image: url(chrome://browser/skin/controlcenter/conn-degraded.svg);
}
#identity-popup-securityView.mixedActiveContent,
#identity-popup-security-content.mixedActiveContent {
#identity-popup[mixedcontent~=active-loaded] #identity-popup-securityView,
#identity-popup[mixedcontent~=active-loaded] #identity-popup-security-content {
background-image: url(chrome://browser/skin/controlcenter/mcb-disabled.svg);
}
#identity-popup-security-descriptions > description {
margin-top: 6px;
color: Graytext;
}
#identity-popup-securityView-header {
border-bottom: 1px solid var(--panel-separator-color);
padding-bottom: 1em;
margin-bottom: 1em;
}
#identity-popup-content-owner {
font-weight: 700;
#identity-popup-securityView-body {
-moz-padding-end: 1em;
}
#identity-popup-content-verifier {
#identity-popup-content-verifier ~ description {
margin-top: 1em;
color: Graytext;
}
#identity-popup-content-owner,
#identity-popup-securityView > #identity-popup-securityView-connection.identity-popup-text {
description#identity-popup-content-verified-by,
description#identity-popup-content-owner,
description#identity-popup-content-verifier,
#identity-popup-securityView-body > button {
margin-top: 1em;
}
#identity-popup-securityView-body > button {
margin-inline-start: 0;
margin-inline-end: 0;
}
/* TRACKING PROTECTION */
#tracking-protection-content {

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="16" height="16" viewBox="0 0 16 16">
<path fill="#808080" d="M14.8,12.5L9.3,1.9C9,1.3,8.5,1,8,1C7.5,1,7,1.3,6.7,1.9L1.2,12.5c-0.3,0.6-0.3,1.2,0,1.7C1.5,14.7,2,15,2.6,15h10.8 c0.6,0,1.1-0.3,1.4-0.8C15.1,13.7,15.1,13.1,14.8,12.5z"/>
<path fill="#fff" d="M8,11c-0.8,0-1.5,0.7-1.5,1.5C6.5,13.3,7.2,14,8,14 c0.8,0,1.5-0.7,1.5-1.5C9.5,11.7,8.8,11,8,11z M8,10L8,10C8.6,10,9,9.6,9,9l0.2-4.2c0-0.7-0.5-1.2-1.2-1.2S6.8,4.1,6.8,4.8L7,9 C7,9.6,7.4,10,8,10z"/>
</svg>

After

Width:  |  Height:  |  Size: 805 B

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
width="16" height="16" viewBox="0 0 16 16">
<path fill="#ffbf00" d="M14.8,12.5L9.3,1.9C9,1.3,8.5,1,8,1C7.5,1,7,1.3,6.7,1.9L1.2,12.5c-0.3,0.6-0.3,1.2,0,1.7C1.5,14.7,2,15,2.6,15h10.8 c0.6,0,1.1-0.3,1.4-0.8C15.1,13.7,15.1,13.1,14.8,12.5z"/>
<path fill="#fff" d="M8,11c-0.8,0-1.5,0.7-1.5,1.5C6.5,13.3,7.2,14,8,14 c0.8,0,1.5-0.7,1.5-1.5C9.5,11.7,8.8,11,8,11z M8,10L8,10C8.6,10,9,9.6,9,9l0.2-4.2c0-0.7-0.5-1.2-1.2-1.2S6.8,4.1,6.8,4.8L7,9 C7,9.6,7.4,10,8,10z"/>
</svg>

After

Width:  |  Height:  |  Size: 805 B

View File

@ -50,7 +50,7 @@ public class GeneratableElementIterator implements Iterator<AnnotatableEntity> {
// Check for "Wrap ALL the things" flag.
for (Annotation annotation : aClass.getDeclaredAnnotations()) {
final String annotationTypeName = annotation.annotationType().getName();
if (annotationTypeName.equals("org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI")) {
if (annotationTypeName.equals("org.mozilla.gecko.annotation.WrapForJNI")) {
mIterateEveryEntry = true;
break;
}
@ -71,7 +71,7 @@ public class GeneratableElementIterator implements Iterator<AnnotatableEntity> {
// WrappedJNIMethod has parameters. Use Reflection to obtain them.
Class<? extends Annotation> annotationType = annotation.annotationType();
final String annotationTypeName = annotationType.getName();
if (annotationTypeName.equals("org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI")) {
if (annotationTypeName.equals("org.mozilla.gecko.annotation.WrapForJNI")) {
String stubName = null;
boolean isMultithreadedStub = false;
boolean noThrow = false;
@ -104,15 +104,15 @@ public class GeneratableElementIterator implements Iterator<AnnotatableEntity> {
catchException = (Boolean) catchExceptionMethod.invoke(annotation);
} catch (NoSuchMethodException e) {
System.err.println("Unable to find expected field on WrapElementForJNI annotation. Did the signature change?");
System.err.println("Unable to find expected field on WrapForJNI annotation. Did the signature change?");
e.printStackTrace(System.err);
System.exit(3);
} catch (IllegalAccessException e) {
System.err.println("IllegalAccessException reading fields on WrapElementForJNI annotation. Seems the semantics of Reflection have changed...");
System.err.println("IllegalAccessException reading fields on WrapForJNI annotation. Seems the semantics of Reflection have changed...");
e.printStackTrace(System.err);
System.exit(4);
} catch (InvocationTargetException e) {
System.err.println("InvocationTargetException reading fields on WrapElementForJNI annotation. This really shouldn't happen.");
System.err.println("InvocationTargetException reading fields on WrapForJNI annotation. This really shouldn't happen.");
e.printStackTrace(System.err);
System.exit(5);
}

View File

@ -573,6 +573,12 @@ this.PermissionsTable = { geolocation: {
privileged: ALLOW_ACTION,
certified: ALLOW_ACTION
},
"open-hidden-window": {
app: DENY_ACTION,
trusted: DENY_ACTION,
privileged: DENY_ACTION,
certified: ALLOW_ACTION
},
};
/**

View File

@ -5,10 +5,6 @@ if (SpecialPowers.isMainProcess()) {
SpecialPowers.Cu.import("resource://gre/modules/ContactService.jsm");
}
SpecialPowers.addPermission("contacts-write", true, document);
SpecialPowers.addPermission("contacts-read", true, document);
SpecialPowers.addPermission("contacts-create", true, document);
// Some helpful global vars
var isAndroid = (navigator.userAgent.indexOf("Android") !== -1);
@ -16,7 +12,12 @@ var defaultOptions = {
sortBy: "givenName",
};
var mozContacts = navigator.mozContacts;
// Make sure we only touch |navigator.mozContacts| after we have the necessary
// permissions, or we'll race when checking the listen permission needed for the
// oncontactchange event. This is only needed for tests because at first we have
// the permission set to UNKNOWN_ACTION. That should never happen for real apps,
// see dom/apps/PermissionsTable.jsm.
var mozContacts;
// To test sorting
var c1 = {
@ -495,7 +496,14 @@ function start_tests() {
.getService(SpecialPowers.Ci.nsIPropertyBag2)
.getProperty('version');
if (!isAndroid || androidVersion >= 14) {
next();
SpecialPowers.pushPermissions([
{type: "contacts-write", allow: 1, context: document},
{type: "contacts-read", allow: 1, context: document},
{type: "contacts-create", allow: 1, context: document},
], function() {
mozContacts = navigator.mozContacts;
next();
});
} else {
ok(true, "Skip tests on Android < 4.0 (bugs 897924 & 888891");
SimpleTest.finish();

View File

@ -28,7 +28,8 @@ static const mozilla::Module::ContractIDEntry kPresentationDeviceProviderContrac
};
static const mozilla::Module::CategoryEntry kPresentationDeviceProviderCategories[] = {
#if defined(MOZ_WIDGET_ANDROID) || (defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 16)
#if (defined(MOZ_WIDGET_ANDROID) && ANDROID_VERSION >= 21) || \
(defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 16)
{ PRESENTATION_DEVICE_PROVIDER_CATEGORY, "MulticastDNSDeviceProvider", MULTICAST_DNS_PROVIDER_CONTRACT_ID },
#endif
{ nullptr }

View File

@ -27,7 +27,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
function ActiveProvider(aProvider) {
this.id = aProvider.id;
this._instance = Cc[aProvider.contractId].getService(Ci.nsISystemUpdateProvider);
this._instance = Components.classesByID[aProvider.id].getService(Ci.nsISystemUpdateProvider);
this._instance.setListener(this);
}

View File

@ -2362,6 +2362,10 @@ TelephonyService.prototype = {
_handleCallStateChanged: function(aClientId, aCalls) {
if (DEBUG) debug("handleCallStateChanged: " + JSON.stringify(aCalls));
if (aCalls.length === 0) {
return;
}
if (aCalls.some(call => call.state == nsITelephonyService.CALL_STATE_DIALING)) {
gTelephonyMessenger.notifyNewCall();
}

View File

@ -33,15 +33,18 @@ function dial() {
});
}
function waitForStateChanged() {
function waitForStateChanged(aPredicate) {
return new Promise(resolve => {
let listener = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsITelephonyListener]),
callStateChanged: function(length, allInfo) {
resolve(allInfo);
TelephonyService.unregisterListener(listener);
if (aPredicate(allInfo)) {
resolve(allInfo);
TelephonyService.unregisterListener(listener);
}
},
conferenceCallStateChanged: function() {},
supplementaryServiceNotification: function() {},
notifyError: function() {},
@ -68,13 +71,17 @@ function test_oneCall() {
is(TelephonyUtils.hasAnyCalls(), true, "hasAnyCalls");
is(TelephonyUtils.hasConnectedCalls(), false, "hasConnectedCalls");
})
.then(() => waitForStateChanged(aAllInfo => {
return aAllInfo[0].callState === Ci.nsITelephonyService.CALL_STATE_ALERTING;
}))
.then(() => {
let p = waitForStateChanged();
let p = waitForStateChanged(aAllInfo => {
return aAllInfo[0].callState === Ci.nsITelephonyService.CALL_STATE_CONNECTED;
});
emulator.runCmd("gsm accept " + number);
return p;
})
.then(allInfo => {
is(allInfo[0].callState, Ci.nsITelephonyService.CALL_STATE_CONNECTED);
.then(() => {
is(TelephonyUtils.hasAnyCalls(), true, "hasAnyCalls");
is(TelephonyUtils.hasConnectedCalls(), true, "hasConnectedCalls");
})
@ -85,7 +92,10 @@ function test_oneCall() {
});
}
test_noCall()
.then(test_oneCall)
.catch(error => ok(false, "Promise reject: " + error))
.then(finish);
startTest(function() {
return Promise.resolve()
.then(test_noCall)
.then(test_oneCall)
.catch(error => ok(false, "Promise reject: " + error))
.then(finish);
});

View File

@ -20,8 +20,8 @@ import java.util.UUID;
import java.util.regex.Pattern;
import org.json.JSONObject;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.util.ThreadUtils;
import android.content.BroadcastReceiver;
@ -54,11 +54,11 @@ public final class ANRReporter extends BroadcastReceiver
private Handler mHandler;
private volatile boolean mPendingANR;
@WrapElementForJNI
@WrapForJNI
private static native boolean requestNativeStack(boolean unwind);
@WrapElementForJNI
@WrapForJNI
private static native String getNativeStack();
@WrapElementForJNI
@WrapForJNI
private static native void releaseNativeStack();
public static void register(Context context) {

View File

@ -5,11 +5,11 @@
package org.mozilla.gecko;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.util.NativeEventListener;
import org.mozilla.gecko.util.NativeJSObject;
import org.mozilla.gecko.util.EventCallback;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import java.io.File;
import java.lang.IllegalArgumentException;
@ -108,7 +108,7 @@ public class DownloadsIntegration implements NativeEventListener
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT == state);
}
@WrapElementForJNI
@WrapForJNI
public static void scanMedia(final String aFile, String aMimeType) {
String mimeType = aMimeType;
if (UNKNOWN_MIME_TYPES.contains(mimeType)) {

View File

@ -30,6 +30,7 @@ import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.favicons.Favicons;
@ -41,7 +42,6 @@ import org.mozilla.gecko.mozglue.ContextUtils;
import org.mozilla.gecko.mozglue.GeckoLoader;
import org.mozilla.gecko.mozglue.JNITarget;
import org.mozilla.gecko.mozglue.RobocopTarget;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.overlays.ui.ShareDialog;
import org.mozilla.gecko.prompts.PromptService;
import org.mozilla.gecko.util.EventCallback;
@ -461,19 +461,19 @@ public class GeckoAppShell
* The Gecko-side API: API methods that Gecko calls
*/
@WrapElementForJNI(allowMultithread = true, noThrow = true)
@WrapForJNI(allowMultithread = true, noThrow = true)
public static void handleUncaughtException(Thread thread, Throwable e) {
CRASH_HANDLER.uncaughtException(thread, e);
}
@WrapElementForJNI
@WrapForJNI
public static void notifyIME(int type) {
if (editableListener != null) {
editableListener.notifyIME(type);
}
}
@WrapElementForJNI
@WrapForJNI
public static void notifyIMEContext(int state, String typeHint,
String modeHint, String actionHint) {
if (editableListener != null) {
@ -482,7 +482,7 @@ public class GeckoAppShell
}
}
@WrapElementForJNI
@WrapForJNI
public static void notifyIMEChange(String text, int start, int end, int newEnd) {
if (newEnd < 0) { // Selection change
editableListener.onSelectionChange(start, end);
@ -534,7 +534,7 @@ public class GeckoAppShell
}
// Signal the Java thread that it's time to wake up
@WrapElementForJNI
@WrapForJNI
public static void acknowledgeEvent() {
synchronized (sEventAckLock) {
sWaitingForEventAck = false;
@ -555,7 +555,7 @@ public class GeckoAppShell
private static native long runUiThreadCallback();
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
private static void requestUiThreadCallback(long delay) {
ThreadUtils.getUiHandler().postDelayed(sCallbackRunnable, delay);
}
@ -591,7 +591,7 @@ public class GeckoAppShell
return lastKnownLocation;
}
@WrapElementForJNI
@WrapForJNI
public static void enableLocation(final boolean enable) {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -647,12 +647,12 @@ public class GeckoAppShell
}
}
@WrapElementForJNI
@WrapForJNI
public static void enableLocationHighAccuracy(final boolean enable) {
locationHighAccuracyEnabled = enable;
}
@WrapElementForJNI
@WrapForJNI
public static void enableSensor(int aSensortype) {
GeckoInterface gi = getGeckoInterface();
if (gi == null)
@ -722,7 +722,7 @@ public class GeckoAppShell
}
}
@WrapElementForJNI
@WrapForJNI
public static void disableSensor(int aSensortype) {
GeckoInterface gi = getGeckoInterface();
if (gi == null)
@ -776,7 +776,7 @@ public class GeckoAppShell
}
}
@WrapElementForJNI
@WrapForJNI
public static void startMonitoringGamepad() {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -786,7 +786,7 @@ public class GeckoAppShell
});
}
@WrapElementForJNI
@WrapForJNI
public static void stopMonitoringGamepad() {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -796,7 +796,7 @@ public class GeckoAppShell
});
}
@WrapElementForJNI
@WrapForJNI
public static void gamepadAdded(final int device_id, final int service_id) {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -806,20 +806,20 @@ public class GeckoAppShell
});
}
@WrapElementForJNI
@WrapForJNI
public static void moveTaskToBack() {
if (getGeckoInterface() != null)
getGeckoInterface().getActivity().moveTaskToBack(true);
}
@WrapElementForJNI
@WrapForJNI
static void scheduleRestart() {
getGeckoInterface().doRestart();
}
// Creates a homescreen shortcut for a web page.
// This is the entry point from nsIShellService.
@WrapElementForJNI
@WrapForJNI
static void createShortcut(final String aTitle, final String aURI, final String aIconData) {
// We have the favicon data (base64) decoded on the background thread, callback here, then
// call the other createShortcut method with the decoded favicon.
@ -943,7 +943,7 @@ public class GeckoAppShell
return bitmap;
}
@WrapElementForJNI(stubName = "GetHandlersForMimeTypeWrapper")
@WrapForJNI(stubName = "GetHandlersForMimeTypeWrapper")
static String[] getHandlersForMimeType(String aMimeType, String aAction) {
Intent intent = getIntentForActionString(aAction);
if (aMimeType != null && aMimeType.length() > 0)
@ -951,7 +951,7 @@ public class GeckoAppShell
return getHandlersForIntent(intent);
}
@WrapElementForJNI(stubName = "GetHandlersForURLWrapper")
@WrapForJNI(stubName = "GetHandlersForURLWrapper")
static String[] getHandlersForURL(String aURL, String aAction) {
// aURL may contain the whole URL or just the protocol
Uri uri = aURL.indexOf(':') >= 0 ? Uri.parse(aURL) : new Uri.Builder().scheme(aURL).build();
@ -962,12 +962,12 @@ public class GeckoAppShell
return getHandlersForIntent(intent);
}
@WrapElementForJNI(stubName = "GetHWEncoderCapability")
@WrapForJNI(stubName = "GetHWEncoderCapability")
static boolean getHWEncoderCapability() {
return HardwareCodecCapabilityUtils.getHWEncoderCapability();
}
@WrapElementForJNI(stubName = "GetHWDecoderCapability")
@WrapForJNI(stubName = "GetHWDecoderCapability")
static boolean getHWDecoderCapability() {
return HardwareCodecCapabilityUtils.getHWDecoderCapability();
}
@ -1028,12 +1028,12 @@ public class GeckoAppShell
return new Intent(aAction);
}
@WrapElementForJNI(stubName = "GetExtensionFromMimeTypeWrapper")
@WrapForJNI(stubName = "GetExtensionFromMimeTypeWrapper")
static String getExtensionFromMimeType(String aMimeType) {
return MimeTypeMap.getSingleton().getExtensionFromMimeType(aMimeType);
}
@WrapElementForJNI(stubName = "GetMimeTypeFromExtensionsWrapper")
@WrapForJNI(stubName = "GetMimeTypeFromExtensionsWrapper")
static String getMimeTypeFromExtensions(String aFileExt) {
StringTokenizer st = new StringTokenizer(aFileExt, ".,; ");
String type = null;
@ -1094,7 +1094,7 @@ public class GeckoAppShell
* @param title the title to use in <code>ACTION_SEND</code> intents.
* @return true if the activity started successfully; false otherwise.
*/
@WrapElementForJNI
@WrapForJNI
public static boolean openUriExternal(String targetURI,
String mimeType,
String packageName,
@ -1382,7 +1382,7 @@ public class GeckoAppShell
}
}
@WrapElementForJNI(stubName = "ShowAlertNotificationWrapper")
@WrapForJNI(stubName = "ShowAlertNotificationWrapper")
public static void showAlertNotification(String aImageUrl, String aAlertTitle, String aAlertText,
String aAlertCookie, String aAlertName) {
// The intent to launch when the user clicks the expanded notification
@ -1409,13 +1409,13 @@ public class GeckoAppShell
notificationClient.add(notificationID, aImageUrl, aAlertTitle, aAlertText, contentIntent);
}
@WrapElementForJNI
@WrapForJNI
public static void alertsProgressListener_OnProgress(String aAlertName, long aProgress, long aProgressMax, String aAlertText) {
int notificationID = aAlertName.hashCode();
notificationClient.update(notificationID, aProgress, aProgressMax, aAlertText);
}
@WrapElementForJNI
@WrapForJNI
public static void closeNotification(String aAlertName) {
String alertCookie = ALERT_COOKIES.get(aAlertName);
if (alertCookie != null) {
@ -1443,7 +1443,7 @@ public class GeckoAppShell
closeNotification(aAlertName);
}
@WrapElementForJNI(stubName = "GetDpiWrapper")
@WrapForJNI(stubName = "GetDpiWrapper")
public static int getDpi() {
if (sDensityDpi == 0) {
sDensityDpi = getContext().getResources().getDisplayMetrics().densityDpi;
@ -1452,7 +1452,7 @@ public class GeckoAppShell
return sDensityDpi;
}
@WrapElementForJNI
@WrapForJNI
public static float getDensity() {
return getContext().getResources().getDisplayMetrics().density;
}
@ -1465,7 +1465,7 @@ public class GeckoAppShell
* Returns the colour depth of the default screen. This will either be
* 24 or 16.
*/
@WrapElementForJNI(stubName = "GetScreenDepthWrapper")
@WrapForJNI(stubName = "GetScreenDepthWrapper")
public static synchronized int getScreenDepth() {
if (sScreenDepth == 0) {
sScreenDepth = 16;
@ -1488,13 +1488,13 @@ public class GeckoAppShell
sScreenDepth = aScreenDepth;
}
@WrapElementForJNI
@WrapForJNI
public static void setFullScreen(boolean fullscreen) {
if (getGeckoInterface() != null)
getGeckoInterface().setFullScreen(fullscreen);
}
@WrapElementForJNI
@WrapForJNI
public static void performHapticFeedback(boolean aIsLongPress) {
// Don't perform haptic feedback if a vibration is currently playing,
// because the haptic feedback will nuke the vibration.
@ -1527,14 +1527,14 @@ public class GeckoAppShell
}
}
@WrapElementForJNI(stubName = "Vibrate1")
@WrapForJNI(stubName = "Vibrate1")
public static void vibrate(long milliseconds) {
sVibrationEndTime = System.nanoTime() + milliseconds * 1000000;
sVibrationMaybePlaying = true;
vibrator().vibrate(milliseconds);
}
@WrapElementForJNI(stubName = "VibrateA")
@WrapForJNI(stubName = "VibrateA")
public static void vibrate(long[] pattern, int repeat) {
// If pattern.length is even, the last element in the pattern is a
// meaningless delay, so don't include it in vibrationDuration.
@ -1549,21 +1549,21 @@ public class GeckoAppShell
vibrator().vibrate(pattern, repeat);
}
@WrapElementForJNI
@WrapForJNI
public static void cancelVibrate() {
sVibrationMaybePlaying = false;
sVibrationEndTime = 0;
vibrator().cancel();
}
@WrapElementForJNI
@WrapForJNI
public static void showInputMethodPicker() {
InputMethodManager imm = (InputMethodManager)
getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showInputMethodPicker();
}
@WrapElementForJNI
@WrapForJNI
public static void setKeepScreenOn(final boolean on) {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -1573,7 +1573,7 @@ public class GeckoAppShell
});
}
@WrapElementForJNI
@WrapForJNI
public static void notifyDefaultPrevented(final boolean defaultPrevented) {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -1587,7 +1587,7 @@ public class GeckoAppShell
});
}
@WrapElementForJNI
@WrapForJNI
public static boolean isNetworkLinkUp() {
ConnectivityManager cm = (ConnectivityManager)
getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
@ -1601,7 +1601,7 @@ public class GeckoAppShell
return true;
}
@WrapElementForJNI
@WrapForJNI
public static boolean isNetworkLinkKnown() {
ConnectivityManager cm = (ConnectivityManager)
getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
@ -1614,7 +1614,7 @@ public class GeckoAppShell
return true;
}
@WrapElementForJNI
@WrapForJNI
public static int networkLinkType() {
ConnectivityManager cm = (ConnectivityManager)
getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
@ -1673,7 +1673,7 @@ public class GeckoAppShell
}
}
@WrapElementForJNI(stubName = "GetSystemColoursWrapper")
@WrapForJNI(stubName = "GetSystemColoursWrapper")
public static int[] getSystemColors() {
// attrsAppearance[] must correspond to AndroidSystemColors structure in android/AndroidBridge.h
final int[] attrsAppearance = {
@ -1710,7 +1710,7 @@ public class GeckoAppShell
return result;
}
@WrapElementForJNI
@WrapForJNI
public static void killAnyZombies() {
GeckoProcessesVisitor visitor = new GeckoProcessesVisitor() {
@Override
@ -1840,7 +1840,7 @@ public class GeckoAppShell
} catch (Exception e) { }
}
@WrapElementForJNI(stubName = "GetIconForExtensionWrapper")
@WrapForJNI(stubName = "GetIconForExtensionWrapper")
public static byte[] getIconForExtension(String aExt, int iconSize) {
try {
if (iconSize <= 0)
@ -1898,7 +1898,7 @@ public class GeckoAppShell
return activityInfo.loadIcon(pm);
}
@WrapElementForJNI
@WrapForJNI
public static boolean getShowPasswordSetting() {
try {
int showPassword =
@ -1911,7 +1911,7 @@ public class GeckoAppShell
}
}
@WrapElementForJNI(stubName = "AddPluginViewWrapper")
@WrapForJNI(stubName = "AddPluginViewWrapper")
public static void addPluginView(View view,
float x, float y,
float w, float h,
@ -1920,7 +1920,7 @@ public class GeckoAppShell
getGeckoInterface().addPluginView(view, new RectF(x, y, x + w, y + h), isFullScreen);
}
@WrapElementForJNI
@WrapForJNI
public static void removePluginView(View view, boolean isFullScreen) {
if (getGeckoInterface() != null)
getGeckoInterface().removePluginView(view, isFullScreen);
@ -2126,7 +2126,7 @@ public class GeckoAppShell
return pluginCL.loadClass(className);
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public static Class<?> loadPluginClass(String className, String libName) {
if (getGeckoInterface() == null)
return null;
@ -2146,7 +2146,7 @@ public class GeckoAppShell
private static ContextGetter sContextGetter;
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public static Context getContext() {
return sContextGetter.getContext();
}
@ -2210,7 +2210,7 @@ public class GeckoAppShell
static byte[] sCameraBuffer;
@WrapElementForJNI(stubName = "InitCameraWrapper")
@WrapForJNI(stubName = "InitCameraWrapper")
static int[] initCamera(String aContentType, int aCamera, int aWidth, int aHeight) {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -2304,7 +2304,7 @@ public class GeckoAppShell
return result;
}
@WrapElementForJNI
@WrapForJNI
static synchronized void closeCamera() {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -2326,33 +2326,33 @@ public class GeckoAppShell
/*
* Battery API related methods.
*/
@WrapElementForJNI
@WrapForJNI
public static void enableBatteryNotifications() {
GeckoBatteryManager.enableNotifications();
}
@WrapElementForJNI(stubName = "HandleGeckoMessageWrapper")
@WrapForJNI(stubName = "HandleGeckoMessageWrapper")
public static void handleGeckoMessage(final NativeJSContainer message) {
EventDispatcher.getInstance().dispatchEvent(message);
message.disposeNative();
}
@WrapElementForJNI
@WrapForJNI
public static void disableBatteryNotifications() {
GeckoBatteryManager.disableNotifications();
}
@WrapElementForJNI(stubName = "GetCurrentBatteryInformationWrapper")
@WrapForJNI(stubName = "GetCurrentBatteryInformationWrapper")
public static double[] getCurrentBatteryInformation() {
return GeckoBatteryManager.getCurrentInformation();
}
@WrapElementForJNI(stubName = "CheckURIVisited")
@WrapForJNI(stubName = "CheckURIVisited")
static void checkUriVisited(String uri) {
GlobalHistory.getInstance().checkUriVisited(uri);
}
@WrapElementForJNI(stubName = "MarkURIVisited")
@WrapForJNI(stubName = "MarkURIVisited")
static void markUriVisited(final String uri) {
final Context context = getContext();
final BrowserDB db = GeckoProfile.get(context).getDB();
@ -2364,7 +2364,7 @@ public class GeckoAppShell
});
}
@WrapElementForJNI(stubName = "SetURITitle")
@WrapForJNI(stubName = "SetURITitle")
static void setUriTitle(final String uri, final String title) {
final Context context = getContext();
final BrowserDB db = GeckoProfile.get(context).getDB();
@ -2376,7 +2376,7 @@ public class GeckoAppShell
});
}
@WrapElementForJNI
@WrapForJNI
static void hideProgressDialog() {
// unused stub
}
@ -2384,7 +2384,7 @@ public class GeckoAppShell
/*
* WebSMS related methods.
*/
@WrapElementForJNI(stubName = "SendMessageWrapper")
@WrapForJNI(stubName = "SendMessageWrapper")
public static void sendMessage(String aNumber, String aMessage, int aRequestId) {
if (!SmsManager.isEnabled()) {
return;
@ -2393,7 +2393,7 @@ public class GeckoAppShell
SmsManager.getInstance().send(aNumber, aMessage, aRequestId);
}
@WrapElementForJNI(stubName = "GetMessageWrapper")
@WrapForJNI(stubName = "GetMessageWrapper")
public static void getMessage(int aMessageId, int aRequestId) {
if (!SmsManager.isEnabled()) {
return;
@ -2402,7 +2402,7 @@ public class GeckoAppShell
SmsManager.getInstance().getMessage(aMessageId, aRequestId);
}
@WrapElementForJNI(stubName = "DeleteMessageWrapper")
@WrapForJNI(stubName = "DeleteMessageWrapper")
public static void deleteMessage(int aMessageId, int aRequestId) {
if (!SmsManager.isEnabled()) {
return;
@ -2411,7 +2411,7 @@ public class GeckoAppShell
SmsManager.getInstance().deleteMessage(aMessageId, aRequestId);
}
@WrapElementForJNI(stubName = "CreateMessageListWrapper")
@WrapForJNI(stubName = "CreateMessageListWrapper")
public static void createMessageList(long aStartDate, long aEndDate, String[] aNumbers, int aNumbersCount, String aDelivery, boolean aHasRead, boolean aRead, long aThreadId, boolean aReverse, int aRequestId) {
if (!SmsManager.isEnabled()) {
return;
@ -2420,7 +2420,7 @@ public class GeckoAppShell
SmsManager.getInstance().createMessageList(aStartDate, aEndDate, aNumbers, aNumbersCount, aDelivery, aHasRead, aRead, aThreadId, aReverse, aRequestId);
}
@WrapElementForJNI(stubName = "GetNextMessageInListWrapper")
@WrapForJNI(stubName = "GetNextMessageInListWrapper")
public static void getNextMessageInList(int aListId, int aRequestId) {
if (!SmsManager.isEnabled()) {
return;
@ -2429,7 +2429,7 @@ public class GeckoAppShell
SmsManager.getInstance().getNextMessageInList(aListId, aRequestId);
}
@WrapElementForJNI
@WrapForJNI
public static void clearMessageList(int aListId) {
if (!SmsManager.isEnabled()) {
return;
@ -2439,7 +2439,7 @@ public class GeckoAppShell
}
/* Called by JNI from AndroidBridge, and by reflection from tests/BaseTest.java.in */
@WrapElementForJNI
@WrapForJNI
@RobocopTarget
public static boolean isTablet() {
return HardwareUtils.isTablet();
@ -2453,12 +2453,12 @@ public class GeckoAppShell
}
}
@WrapElementForJNI(stubName = "GetCurrentNetworkInformationWrapper")
@WrapForJNI(stubName = "GetCurrentNetworkInformationWrapper")
public static double[] getCurrentNetworkInformation() {
return GeckoNetworkManager.getInstance().getCurrentInformation();
}
@WrapElementForJNI
@WrapForJNI
public static void enableNetworkNotifications() {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -2468,7 +2468,7 @@ public class GeckoAppShell
});
}
@WrapElementForJNI
@WrapForJNI
public static void disableNetworkNotifications() {
ThreadUtils.postToUiThread(new Runnable() {
@Override
@ -2478,32 +2478,32 @@ public class GeckoAppShell
});
}
@WrapElementForJNI(stubName = "GetScreenOrientationWrapper")
@WrapForJNI(stubName = "GetScreenOrientationWrapper")
public static short getScreenOrientation() {
return GeckoScreenOrientation.getInstance().getScreenOrientation().value;
}
@WrapElementForJNI
@WrapForJNI
public static void enableScreenOrientationNotifications() {
GeckoScreenOrientation.getInstance().enableNotifications();
}
@WrapElementForJNI
@WrapForJNI
public static void disableScreenOrientationNotifications() {
GeckoScreenOrientation.getInstance().disableNotifications();
}
@WrapElementForJNI
@WrapForJNI
public static void lockScreenOrientation(int aOrientation) {
GeckoScreenOrientation.getInstance().lock(aOrientation);
}
@WrapElementForJNI
@WrapForJNI
public static void unlockScreenOrientation() {
GeckoScreenOrientation.getInstance().unlock();
}
@WrapElementForJNI
@WrapForJNI
public static boolean pumpMessageLoop(final Message msg) {
final Handler geckoHandler = ThreadUtils.sGeckoHandler;
@ -2521,13 +2521,13 @@ public class GeckoAppShell
return true;
}
@WrapElementForJNI
@WrapForJNI
public static void notifyWakeLockChanged(String topic, String state) {
if (getGeckoInterface() != null)
getGeckoInterface().notifyWakeLockChanged(topic, state);
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public static void registerSurfaceTextureFrameListener(Object surfaceTexture, final int id) {
((SurfaceTexture)surfaceTexture).setOnFrameAvailableListener(new SurfaceTexture.OnFrameAvailableListener() {
@Override
@ -2537,12 +2537,12 @@ public class GeckoAppShell
});
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public static void unregisterSurfaceTextureFrameListener(Object surfaceTexture) {
((SurfaceTexture)surfaceTexture).setOnFrameAvailableListener(null);
}
@WrapElementForJNI
@WrapForJNI
public static boolean unlockProfile() {
// Try to kill any zombie Fennec's that might be running
GeckoAppShell.killAnyZombies();
@ -2556,7 +2556,7 @@ public class GeckoAppShell
return false;
}
@WrapElementForJNI(stubName = "GetProxyForURIWrapper")
@WrapForJNI(stubName = "GetProxyForURIWrapper")
public static String getProxyForURI(String spec, String scheme, String host, int port) {
final ProxySelector ps = new ProxySelector();
@ -2653,12 +2653,12 @@ public class GeckoAppShell
toast.show();
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
static InputStream createInputStream(URLConnection connection) throws IOException {
return connection.getInputStream();
}
@WrapElementForJNI(allowMultithread = true, narrowChars = true)
@WrapForJNI(allowMultithread = true, narrowChars = true)
static URLConnection getConnection(String url) {
try {
String spec;
@ -2679,7 +2679,7 @@ public class GeckoAppShell
return null;
}
@WrapElementForJNI(allowMultithread = true, narrowChars = true)
@WrapForJNI(allowMultithread = true, narrowChars = true)
static String connectionGetMimeType(URLConnection connection) {
return connection.getContentType();
}
@ -2690,7 +2690,7 @@ public class GeckoAppShell
* @param type The type of directory to return
* @return Absolute path of the specified directory or null on failure
*/
@WrapElementForJNI
@WrapForJNI
static String getExternalPublicDirectory(final String type) {
final String state = Environment.getExternalStorageState();
if (!Environment.MEDIA_MOUNTED.equals(state) &&
@ -2719,7 +2719,7 @@ public class GeckoAppShell
return Environment.getExternalStoragePublicDirectory(systemType).getAbsolutePath();
}
@WrapElementForJNI
@WrapForJNI
static int getMaxTouchPoints() {
PackageManager pm = getContext().getPackageManager();
if (pm.hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND)) {

View File

@ -9,7 +9,7 @@ import android.os.SystemClock;
import android.util.Log;
import android.util.SparseArray;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
import java.lang.Thread;
import java.util.Set;
@ -126,7 +126,7 @@ public class GeckoJavaSampler {
}
@WrapElementForJNI(allowMultithread = true, stubName = "GetThreadNameJavaProfilingWrapper")
@WrapForJNI(allowMultithread = true, stubName = "GetThreadNameJavaProfilingWrapper")
public synchronized static String getThreadName(int aThreadId) {
if (aThreadId == 0 && sMainThread != null) {
return sMainThread.getName();
@ -138,7 +138,7 @@ public class GeckoJavaSampler {
return sSamplingRunnable.getSample(aThreadId, aSampleId);
}
@WrapElementForJNI(allowMultithread = true, stubName = "GetSampleTimeJavaProfiling")
@WrapForJNI(allowMultithread = true, stubName = "GetSampleTimeJavaProfiling")
public synchronized static double getSampleTime(int aThreadId, int aSampleId) {
Sample sample = getSample(aThreadId, aSampleId);
if (sample != null) {
@ -152,7 +152,7 @@ public class GeckoJavaSampler {
return 0;
}
@WrapElementForJNI(allowMultithread = true, stubName = "GetFrameNameJavaProfilingWrapper")
@WrapForJNI(allowMultithread = true, stubName = "GetFrameNameJavaProfilingWrapper")
public synchronized static String getFrameName(int aThreadId, int aSampleId, int aFrameId) {
Sample sample = getSample(aThreadId, aSampleId);
if (sample != null && aFrameId < sample.mFrames.length) {
@ -165,7 +165,7 @@ public class GeckoJavaSampler {
return null;
}
@WrapElementForJNI(allowMultithread = true, stubName = "StartJavaProfiling")
@WrapForJNI(allowMultithread = true, stubName = "StartJavaProfiling")
public static void start(int aInterval, int aSamples) {
synchronized (GeckoJavaSampler.class) {
if (sSamplingRunnable != null) {
@ -177,21 +177,21 @@ public class GeckoJavaSampler {
}
}
@WrapElementForJNI(allowMultithread = true, stubName = "PauseJavaProfiling")
@WrapForJNI(allowMultithread = true, stubName = "PauseJavaProfiling")
public static void pause() {
synchronized (GeckoJavaSampler.class) {
sSamplingRunnable.mPauseSampler = true;
}
}
@WrapElementForJNI(allowMultithread = true, stubName = "UnpauseJavaProfiling")
@WrapForJNI(allowMultithread = true, stubName = "UnpauseJavaProfiling")
public static void unpause() {
synchronized (GeckoJavaSampler.class) {
sSamplingRunnable.mPauseSampler = false;
}
}
@WrapElementForJNI(allowMultithread = true, stubName = "StopJavaProfiling")
@WrapForJNI(allowMultithread = true, stubName = "StopJavaProfiling")
public static void stop() {
synchronized (GeckoJavaSampler.class) {
if (sSamplingThread == null) {

View File

@ -5,9 +5,9 @@
package org.mozilla.gecko;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.mozglue.RobocopTarget;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.restrictions.DefaultConfiguration;
import org.mozilla.gecko.restrictions.GuestProfileConfiguration;
import org.mozilla.gecko.restrictions.RestrictedProfileConfiguration;
@ -90,7 +90,7 @@ public class RestrictedProfiles {
return getConfiguration(context).canLoadUrl(url);
}
@WrapElementForJNI
@WrapForJNI
public static boolean isUserRestricted() {
return isUserRestricted(GeckoAppShell.getContext());
}
@ -103,7 +103,7 @@ public class RestrictedProfiles {
return getConfiguration(context).isAllowed(restriction);
}
@WrapElementForJNI
@WrapForJNI
public static boolean isAllowed(int action, String url) {
final Restriction restriction;
try {

View File

@ -4,11 +4,11 @@
package org.mozilla.gecko;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
import java.nio.ByteBuffer;
@WrapElementForJNI
@WrapForJNI
public class SurfaceBits {
public int width;
public int height;

View File

@ -5,9 +5,9 @@
package org.mozilla.gecko;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.gfx.BitmapUtils;
import org.mozilla.gecko.mozglue.DirectBufferAllocator;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import android.content.res.Resources;
import android.graphics.Bitmap;
@ -153,7 +153,7 @@ public final class ThumbnailHelper {
}
/* This method is invoked by JNI once the thumbnail data is ready. */
@WrapElementForJNI(stubName = "SendThumbnail")
@WrapForJNI(stubName = "SendThumbnail")
public static void notifyThumbnail(ByteBuffer data, int tabId, boolean success, boolean shouldStore) {
Tab tab = Tabs.getInstance().getTab(tabId);
ThumbnailHelper helper = ThumbnailHelper.getInstance();

View File

@ -2,7 +2,7 @@
* 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/. */
package org.mozilla.gecko.mozglue.generatorannotations;
package org.mozilla.gecko.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
@ -24,7 +24,7 @@ import java.lang.annotation.Target;
*/
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR})
@Retention(RetentionPolicy.RUNTIME)
public @interface WrapElementForJNI {
public @interface WrapForJNI {
// Optional parameter specifying the name of the generated method stub. If omitted, the name
// of the Java method will be used.
String stubName() default "";

View File

@ -5,7 +5,7 @@
package org.mozilla.gecko.gfx;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.util.FloatUtils;
import android.graphics.RectF;
@ -19,16 +19,16 @@ import android.graphics.RectF;
* subsection of that with compositor scaling.
*/
public final class DisplayPortMetrics {
@WrapElementForJNI
@WrapForJNI
public final float resolution;
@WrapElementForJNI
@WrapForJNI
private final RectF mPosition;
public DisplayPortMetrics() {
this(0, 0, 0, 0, 1);
}
@WrapElementForJNI
@WrapForJNI
public DisplayPortMetrics(float left, float top, float right, float bottom, float resolution) {
this.resolution = resolution;
mPosition = new RectF(left, top, right, bottom);

View File

@ -5,11 +5,11 @@
package org.mozilla.gecko.gfx;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants;
import org.mozilla.gecko.GeckoAppShell;
import org.mozilla.gecko.GeckoEvent;
import org.mozilla.gecko.GeckoThread;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.util.ThreadUtils;
import android.util.Log;
@ -250,7 +250,7 @@ public class GLController {
return mEGLSurfaceForCompositor != null;
}
@WrapElementForJNI(allowMultithread = true, stubName = "CreateEGLSurfaceForCompositorWrapper")
@WrapForJNI(allowMultithread = true, stubName = "CreateEGLSurfaceForCompositorWrapper")
private synchronized EGLSurface createEGLSurfaceForCompositor() {
AttemptPreallocateEGLSurfaceForCompositor();
EGLSurface result = mEGLSurfaceForCompositor;

View File

@ -5,6 +5,7 @@
package org.mozilla.gecko.gfx;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.GeckoAppShell;
import org.mozilla.gecko.GeckoEvent;
import org.mozilla.gecko.gfx.LayerView.DrawListener;
@ -12,7 +13,6 @@ import org.mozilla.gecko.Tab;
import org.mozilla.gecko.Tabs;
import org.mozilla.gecko.ZoomConstraints;
import org.mozilla.gecko.mozglue.RobocopTarget;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.EventDispatcher;
import org.mozilla.gecko.util.FloatUtils;
import org.mozilla.gecko.AppConstants;
@ -436,7 +436,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
return mDisplayPort;
}
@WrapElementForJNI
@WrapForJNI
DisplayPortMetrics getDisplayPort(boolean pageSizeUpdate, boolean isBrowserContentDisplayed, int tabId, ImmutableViewportMetrics metrics) {
Tabs tabs = Tabs.getInstance();
if (isBrowserContentDisplayed && tabs.isSelectedTabId(tabId)) {
@ -453,12 +453,12 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
}
}
@WrapElementForJNI
@WrapForJNI
void contentDocumentChanged() {
mContentDocumentIsDisplayed = false;
}
@WrapElementForJNI
@WrapForJNI
boolean isContentDocumentDisplayed() {
return mContentDocumentIsDisplayed;
}
@ -468,7 +468,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
// to abort the current update and continue with any subsequent ones. This
// is useful for slow-to-render pages when the display-port starts lagging
// behind enough that continuing to draw it is wasted effort.
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public ProgressiveUpdateData progressiveUpdateCallback(boolean aHasPendingNewThebesContent,
float x, float y, float width, float height,
float resolution, boolean lowPrecision) {
@ -582,7 +582,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
* viewport information provided. setPageRect will never be invoked on the same frame that
* this function is invoked on; and this function will always be called prior to syncViewportInfo.
*/
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public void setFirstPaintViewport(float offsetX, float offsetY, float zoom,
float cssPageLeft, float cssPageTop, float cssPageRight, float cssPageBottom) {
synchronized (getLock()) {
@ -642,7 +642,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
* is invoked on a frame, then this function will not be. For any given frame, this
* function will be invoked before syncViewportInfo.
*/
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public void setPageRect(float cssPageLeft, float cssPageTop, float cssPageRight, float cssPageBottom) {
synchronized (getLock()) {
RectF cssPageRect = new RectF(cssPageLeft, cssPageTop, cssPageRight, cssPageBottom);
@ -663,7 +663,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
* every time we're called. NOTE: we might be able to return a ImmutableViewportMetrics
* which would avoid the copy into mCurrentViewTransform.
*/
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public ViewTransform syncViewportInfo(int x, int y, int width, int height, float resolution, boolean layersUpdated) {
// getViewportMetrics is thread safe so we don't need to synchronize.
// We save the viewport metrics here, so we later use it later in
@ -720,7 +720,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
return mCurrentViewTransform;
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public ViewTransform syncFrameMetrics(float offsetX, float offsetY, float zoom,
float cssPageLeft, float cssPageTop, float cssPageRight, float cssPageBottom,
boolean layersUpdated, int x, int y, int width, int height, float resolution,
@ -734,7 +734,7 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
return syncViewportInfo(x, y, width, height, resolution, layersUpdated);
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public LayerRenderer.Frame createFrame() {
// Create the shaders and textures if necessary.
if (!mLayerRendererInitialized) {
@ -754,12 +754,12 @@ class GeckoLayerClient implements LayerView.Listener, PanZoomTarget
}
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public void activateProgram() {
mLayerRenderer.activateDefaultProgram();
}
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public void deactivateProgramAndRestoreState(boolean enableScissor,
int scissorX, int scissorY, int scissorW, int scissorH)
{

View File

@ -5,7 +5,7 @@
package org.mozilla.gecko.gfx;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.util.FloatUtils;
import android.graphics.PointF;
@ -53,7 +53,7 @@ public class ImmutableViewportMetrics {
/** This constructor is used by native code in AndroidJavaWrappers.cpp, be
* careful when modifying the signature.
*/
@WrapElementForJNI(allowMultithread = true)
@WrapForJNI(allowMultithread = true)
public ImmutableViewportMetrics(float aPageRectLeft, float aPageRectTop,
float aPageRectRight, float aPageRectBottom, float aCssPageRectLeft,
float aCssPageRectTop, float aCssPageRectRight, float aCssPageRectBottom,

View File

@ -10,6 +10,7 @@ import java.nio.IntBuffer;
import java.util.ArrayList;
import org.mozilla.gecko.AndroidGamepadManager;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.EventDispatcher;
import org.mozilla.gecko.GeckoAccessibility;
@ -20,7 +21,6 @@ import org.mozilla.gecko.Tab;
import org.mozilla.gecko.Tabs;
import org.mozilla.gecko.ZoomConstraints;
import org.mozilla.gecko.mozglue.RobocopTarget;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import android.content.Context;
import android.graphics.Bitmap;
@ -515,7 +515,7 @@ public class LayerView extends FrameLayout implements Tabs.OnTabsChangedListener
return mTextureView.getSurfaceTexture();
}
@WrapElementForJNI(allowMultithread = true, stubName = "RegisterCompositorWrapper")
@WrapForJNI(allowMultithread = true, stubName = "RegisterCompositorWrapper")
public static GLController registerCxxCompositor() {
try {
LayerView layerView = GeckoAppShell.getLayerView();
@ -529,7 +529,7 @@ public class LayerView extends FrameLayout implements Tabs.OnTabsChangedListener
}
//This method is called on the Gecko main thread.
@WrapElementForJNI(allowMultithread = true, stubName = "updateZoomedView")
@WrapForJNI(allowMultithread = true, stubName = "updateZoomedView")
public static void updateZoomedView(ByteBuffer data) {
LayerView layerView = GeckoAppShell.getLayerView();
if (layerView != null) {

View File

@ -5,9 +5,9 @@
package org.mozilla.gecko.gfx;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.GeckoEvent;
import org.mozilla.gecko.GeckoThread;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.EventDispatcher;
import org.mozilla.gecko.util.GeckoEventListener;
@ -97,7 +97,7 @@ class NativePanZoomController implements PanZoomController, GeckoEventListener {
@Override
public native int getOverScrollMode();
@WrapElementForJNI(allowMultithread = true, stubName = "RequestContentRepaintWrapper")
@WrapForJNI(allowMultithread = true, stubName = "RequestContentRepaintWrapper")
private void requestContentRepaint(float x, float y, float width, float height, float resolution) {
mTarget.forceRedraw(new DisplayPortMetrics(x, y, x + width, y + height, resolution));
}

View File

@ -5,7 +5,7 @@
package org.mozilla.gecko.gfx;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
/**
* This is the data structure that's returned by the progressive tile update
@ -13,7 +13,7 @@ import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
* representing whether the front-end is interested in the current progressive
* update continuing.
*/
@WrapElementForJNI
@WrapForJNI
public class ProgressiveUpdateData {
public float x;
public float y;

View File

@ -5,9 +5,9 @@
package org.mozilla.gecko.gfx;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
@WrapElementForJNI
@WrapForJNI
public class ViewTransform {
public float x;
public float y;

View File

@ -37,7 +37,8 @@ public abstract class MulticastDNSManager {
public static MulticastDNSManager getInstance(final Context context) {
if (instance == null) {
if (Versions.feature16Plus) {
// Bug 1188935: There's a bug on Android 4.4 and before.
if (Versions.feature21Plus) {
instance = new NsdMulticastDNSManager(context);
} else {
instance = new DummyMulticastDNSManager();

View File

@ -14,6 +14,7 @@ thirdparty_source_dir = TOPSRCDIR + '/mobile/android/thirdparty/'
constants_jar = add_java_jar('constants')
constants_jar.sources = [
'adjust/AdjustHelperInterface.java',
'annotation/WrapForJNI.java',
'SysInfo.java',
]
constants_jar.generated_sources = [
@ -54,7 +55,6 @@ mgjar.sources += [
'mozglue/ContextUtils.java',
'mozglue/DirectBufferAllocator.java',
'mozglue/GeckoLoader.java',
'mozglue/generatorannotations/WrapElementForJNI.java',
'mozglue/JNIObject.java',
'mozglue/JNITarget.java',
'mozglue/NativeReference.java',
@ -133,6 +133,7 @@ if CONFIG['MOZ_WEBRTC']:
audio_root + 'WebRtcAudioTrack.java',
]
wrjar.extra_jars = [
'constants.jar',
'gecko-R.jar',
'gecko-browser.jar',
'gecko-util.jar',

View File

@ -5,7 +5,7 @@
package org.mozilla.gecko.mozglue;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.mozglue.JNITarget;
import java.io.InputStream;
import java.nio.ByteBuffer;
@ -69,7 +69,7 @@ public class NativeZip implements NativeReference {
private static native void _release(long obj);
private native InputStream _getInputStream(long obj, String path);
@WrapElementForJNI
@JNITarget
private InputStream createInputStream(ByteBuffer buffer, int compression) {
if (compression != STORE && compression != DEFLATE) {
throw new IllegalArgumentException("Unexpected compression: " + compression);

View File

@ -20,8 +20,8 @@ package org.mozilla.gecko.sqlite;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import android.database.AbstractCursor;
import android.database.CursorIndexOutOfBoundsException;
@ -56,7 +56,7 @@ public class MatrixBlobCursor extends AbstractCursor {
* determines column ordering elsewhere in this cursor
* @param initialCapacity in rows
*/
@WrapElementForJNI
@WrapForJNI
public MatrixBlobCursor(String[] columnNames, int initialCapacity) {
this.columnNames = columnNames;
this.columnCount = columnNames.length;
@ -77,7 +77,7 @@ public class MatrixBlobCursor extends AbstractCursor {
* @param columnNames names of the columns, the ordering of which
* determines column ordering elsewhere in this cursor
*/
@WrapElementForJNI
@WrapForJNI
public MatrixBlobCursor(String[] columnNames) {
this(columnNames, 16);
}
@ -132,7 +132,7 @@ public class MatrixBlobCursor extends AbstractCursor {
* @param columnValues in the same order as the the column names specified
* at cursor construction time
*/
@WrapElementForJNI
@WrapForJNI
public void addRow(Object[] columnValues) {
if (columnValues.length != columnCount) {
throw new IllegalArgumentException("columnNames.length = "
@ -154,7 +154,7 @@ public class MatrixBlobCursor extends AbstractCursor {
* @param columnValues in the same order as the the column names specified
* at cursor construction time
*/
@WrapElementForJNI
@WrapForJNI
public void addRow(Iterable<?> columnValues) {
final int start = rowCount * columnCount;
@ -188,7 +188,7 @@ public class MatrixBlobCursor extends AbstractCursor {
}
/** Optimization for {@link ArrayList}. */
@WrapElementForJNI
@WrapForJNI
private void addRow(ArrayList<?> columnValues, int start) {
final int size = columnValues.size();
if (size != columnCount) {

View File

@ -5,9 +5,9 @@
package org.mozilla.gecko.sqlite;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
@WrapElementForJNI
@WrapForJNI
public class SQLiteBridgeException extends RuntimeException {
static final long serialVersionUID = 1L;

View File

@ -6,8 +6,8 @@ package org.mozilla.gecko.util;
import java.util.concurrent.SynchronousQueue;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.AppConstants.Versions;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import android.content.ClipData;
import android.content.Context;
@ -32,7 +32,7 @@ public final class Clipboard {
mContext = c.getApplicationContext();
}
@WrapElementForJNI(stubName = "GetClipboardTextWrapper")
@WrapForJNI(stubName = "GetClipboardTextWrapper")
public static String getText() {
// If we're on the UI thread or the background thread, we have a looper on the thread
// and can just call this directly. For any other threads, post the call to the
@ -59,7 +59,7 @@ public final class Clipboard {
}
}
@WrapElementForJNI(stubName = "SetClipboardText")
@WrapForJNI(stubName = "SetClipboardText")
public static void setText(final CharSequence text) {
ThreadUtils.postToBackgroundThread(new Runnable() {
@Override
@ -90,7 +90,7 @@ public final class Clipboard {
/**
* @return true if the clipboard is nonempty, false otherwise.
*/
@WrapElementForJNI
@WrapForJNI
public static boolean hasText() {
if (Versions.feature11Plus) {
android.content.ClipboardManager cm = (android.content.ClipboardManager) mContext.getSystemService(Context.CLIPBOARD_SERVICE);
@ -105,7 +105,7 @@ public final class Clipboard {
/**
* Deletes all text from the clipboard.
*/
@WrapElementForJNI
@WrapForJNI
public static void clearText() {
setText(null);
}

View File

@ -5,7 +5,7 @@
package org.mozilla.gecko.util;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.mozglue.JNITarget;
/**
@ -16,8 +16,7 @@ import org.mozilla.gecko.mozglue.JNITarget;
* thread, call {@link #clone()} to make a copy, and use the copy on the other thread.
* When a copy is first used, it becomes attached to the thread using it.
*/
@JNITarget
@WrapElementForJNI
@WrapForJNI
public final class NativeJSContainer extends NativeJSObject
{
private NativeJSContainer() {

View File

@ -5,7 +5,7 @@
package org.mozilla.gecko.util;
import org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI;
import org.mozilla.gecko.annotation.WrapForJNI;
import org.mozilla.gecko.mozglue.JNIObject;
import org.mozilla.gecko.mozglue.JNITarget;
@ -15,8 +15,7 @@ import android.os.Bundle;
* NativeJSObject is a wrapper around the SpiderMonkey JSAPI to make it possible to
* access Javascript objects in Java.
*/
@JNITarget
@WrapElementForJNI
@WrapForJNI
public class NativeJSObject extends JNIObject
{
@SuppressWarnings("serial")

View File

@ -179,20 +179,20 @@
}
# Keep generator-targeted entry points.
-keep @interface org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI
-keep @org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI class *
-keep @interface org.mozilla.gecko.annotation.WrapForJNI
-keep @org.mozilla.gecko.annotation.WrapForJNI class *
-keepclassmembers class * {
@org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI *;
@org.mozilla.gecko.annotation.WrapForJNI *;
}
-keepclasseswithmembers class * {
@org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI <methods>;
@org.mozilla.gecko.annotation.WrapForJNI <methods>;
}
-keepclasseswithmembers class * {
@org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI <fields>;
@org.mozilla.gecko.annotation.WrapForJNI <fields>;
}
# Keep all members of an annotated class.
-keepclassmembers @org.mozilla.gecko.mozglue.generatorannotations.WrapElementForJNI class * {
-keepclassmembers @org.mozilla.gecko.annotation.WrapForJNI class * {
*;
}

View File

@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android' and CONFIG['ANDROID_VERSION'] >= '21':
EXTRA_COMPONENTS += [
'nsDNSServiceDiscovery.js',
'nsDNSServiceDiscovery.manifest',

View File

@ -85,8 +85,6 @@ const TELEMETRY_TEST_DELAY = 100;
const SCHEDULER_TICK_INTERVAL_MS = 5 * 60 * 1000;
// When user is idle, execute a scheduler tick every 60 minutes.
const SCHEDULER_TICK_IDLE_INTERVAL_MS = 60 * 60 * 1000;
// The maximum number of times a scheduled operation can fail.
const SCHEDULER_RETRY_ATTEMPTS = 3;
// The tolerance we have when checking if it's midnight (15 minutes).
const SCHEDULER_MIDNIGHT_TOLERANCE_MS = 15 * 60 * 1000;
@ -381,9 +379,6 @@ let TelemetryScheduler = {
_log: null,
// The number of times a daily ping fails.
_dailyPingRetryAttempts: 0,
// The timer which drives the scheduler.
_schedulerTimer: null,
// The interval used by the scheduler timer.
@ -546,8 +541,8 @@ let TelemetryScheduler = {
if (shouldSendDaily) {
this._log.trace("_schedulerTickLogic - Daily ping due.");
return Impl._sendDailyPing().then(() => this._dailyPingSucceeded(now),
() => this._dailyPingFailed(now));
this._lastDailyPingTime = now;
return Impl._sendDailyPing();
}
// Check if the aborted-session ping is due. If a daily ping was saved above, it was
@ -561,10 +556,6 @@ let TelemetryScheduler = {
// No ping is due.
this._log.trace("_schedulerTickLogic - No ping due.");
// It's possible, because of sleeps, that we're no longer within midnight tolerance for
// daily pings. Because of that, daily retry attempts would not be 0 on the next midnight.
// Reset that count on do-nothing ticks.
this._dailyPingRetryAttempts = 0;
return Promise.resolve();
},
@ -597,33 +588,6 @@ let TelemetryScheduler = {
this._rescheduleTimeout();
},
/**
* Called when a scheduled operation successfully completes (ping sent or saved).
* @param {Number} now The current time, in milliseconds.
*/
_dailyPingSucceeded: function(now) {
this._log.trace("_dailyPingSucceeded");
this._lastDailyPingTime = now;
this._dailyPingRetryAttempts = 0;
},
/**
* Called when a scheduled operation fails (ping sent or saved).
* @param {Number} now The current time, in milliseconds.
*/
_dailyPingFailed: function(now) {
this._log.error("_dailyPingFailed");
this._dailyPingRetryAttempts++;
// If we reach the maximum number of retry attempts for a daily ping, log the error
// and skip this daily ping.
if (this._dailyPingRetryAttempts >= SCHEDULER_RETRY_ATTEMPTS) {
this._log.error("_pingFailed - The daily ping failed too many times. Skipping it.");
this._dailyPingRetryAttempts = 0;
this._lastDailyPingTime = now;
}
},
/**
* Stops the scheduler.
*/
@ -1894,8 +1858,8 @@ let Impl = {
// Also save the payload as an aborted session. If we delay this, aborted-session can
// lag behind for the profileSubsessionCounter and other state, complicating analysis.
if (IS_UNIFIED_TELEMETRY) {
let abortedPromise = this._saveAbortedSessionPing(payload);
promise = promise.then(() => abortedPromise);
this._saveAbortedSessionPing(payload)
.catch(e => this._log.error("_sendDailyPing - Failed to save the aborted session ping", e));
}
return promise;

View File

@ -1682,6 +1682,106 @@ add_task(function* test_schedulerUserIdle() {
yield TelemetrySession.shutdown();
});
add_task(function* test_DailyDueAndIdle() {
if (gIsAndroid || gIsGonk) {
// We don't have the aborted session or the daily ping here.
return;
}
yield TelemetrySession.reset();
clearPendingPings();
PingServer.clearRequests();
let receivedPingRequest = null;
// Register a ping handler that will assert when receiving multiple daily pings.
PingServer.registerPingHandler(req => {
Assert.ok(!receivedPingRequest, "Telemetry must only send one daily ping.");
receivedPingRequest = req;
});
let schedulerTickCallback = null;
let now = new Date(2030, 1, 1, 0, 0, 0);
fakeNow(now);
// Fake scheduler functions to control daily collection flow in tests.
fakeSchedulerTimer(callback => schedulerTickCallback = callback, () => {});
yield TelemetrySession.setup();
// Trigger the daily ping.
let firstDailyDue = new Date(2030, 1, 2, 0, 0, 0);
fakeNow(firstDailyDue);
// Run a scheduler tick: it should trigger the daily ping.
Assert.ok(!!schedulerTickCallback);
let tickPromise = schedulerTickCallback();
// Send an idle and then an active user notification.
fakeIdleNotification("idle");
fakeIdleNotification("active");
// Wait on the tick promise.
yield tickPromise;
yield TelemetrySend.testWaitOnOutgoingPings();
// Decode the ping contained in the request and check that's a daily ping.
Assert.ok(receivedPingRequest, "Telemetry must send one daily ping.");
const receivedPing = decodeRequestPayload(receivedPingRequest);
checkPingFormat(receivedPing, PING_TYPE_MAIN, true, true);
Assert.equal(receivedPing.payload.info.reason, REASON_DAILY);
yield TelemetrySession.shutdown();
});
add_task(function* test_userIdleAndSchedlerTick() {
if (gIsAndroid || gIsGonk) {
// We don't have the aborted session or the daily ping here.
return;
}
yield TelemetrySession.reset();
clearPendingPings();
PingServer.clearRequests();
let receivedPingRequest = null;
// Register a ping handler that will assert when receiving multiple daily pings.
PingServer.registerPingHandler(req => {
Assert.ok(!receivedPingRequest, "Telemetry must only send one daily ping.");
receivedPingRequest = req;
});
let schedulerTickCallback = null;
let now = new Date(2030, 1, 1, 0, 0, 0);
fakeNow(now);
// Fake scheduler functions to control daily collection flow in tests.
fakeSchedulerTimer(callback => schedulerTickCallback = callback, () => {});
yield TelemetrySession.setup();
// Move the current date/time to midnight.
let firstDailyDue = new Date(2030, 1, 2, 0, 0, 0);
fakeNow(firstDailyDue);
// The active notification should trigger a scheduler tick. The latter will send the
// due daily ping.
fakeIdleNotification("active");
// Immediately running another tick should not send a daily ping again.
Assert.ok(!!schedulerTickCallback);
yield schedulerTickCallback();
// A new "idle" notification should not send a new daily ping.
fakeIdleNotification("idle");
yield TelemetrySend.testWaitOnOutgoingPings();
// Decode the ping contained in the request and check that's a daily ping.
Assert.ok(receivedPingRequest, "Telemetry must send one daily ping.");
const receivedPing = decodeRequestPayload(receivedPingRequest);
checkPingFormat(receivedPing, PING_TYPE_MAIN, true, true);
Assert.equal(receivedPing.payload.info.reason, REASON_DAILY);
yield TelemetrySession.shutdown();
});
add_task(function* stopServer(){
yield PingServer.stop();
do_test_finished();

View File

@ -59,13 +59,13 @@ exports.items = [
hidden: true,
exec: function(args, context) {
let env = context.environment;
let { document } = env;
// Calling the command again after the rulers have been shown once hides
// them.
if (highlighters.has(env.document)) {
let { highlighter, environment } = highlighters.get(env.document);
if (highlighters.has(document)) {
let { highlighter } = highlighters.get(document);
highlighter.destroy();
environment.destroy();
return false;
}
@ -76,15 +76,15 @@ exports.items = [
// Store the instance of the rulers highlighter for this document so we
// can hide it later.
highlighters.set(env.document, { highlighter, environment });
highlighters.set(document, { highlighter, environment });
// Listen to the highlighter's destroy event which may happen if the
// window is refreshed or closed with the rulers shown.
events.once(highlighter, "destroy", () => {
if (highlighters.has(env.document)) {
let { environment } = highlighters.get(env.document);
if (highlighters.has(document)) {
let { environment } = highlighters.get(document);
environment.destroy();
highlighters.delete(env.document);
highlighters.delete(document);
}
});

View File

@ -265,7 +265,7 @@ const GcliActor = ActorClass({
},
get document() {
return tabActor.window.document;
return tabActor.window && tabActor.window.document;
}
};

View File

@ -248,15 +248,6 @@
fill: #fff;
}
/*
Setting `stroke-width` with a low floating point number, ensure that `path`
draws always 1px despites the zoom level, with `crispEdges` on the ancestor.
*/
:-moz-native-anonymous .rulers-highlighter-ruler-graduations,
:-moz-native-anonymous .rulers-highlighter-ruler-markers {
stroke-width: 0.0001;
}
:-moz-native-anonymous .rulers-highlighter-ruler-graduations {
stroke: #bebebe;
}
@ -282,4 +273,3 @@
transform: rotate(-90deg);
text-anchor: end;
}

View File

@ -2933,6 +2933,45 @@ RulersHighlighter.prototype = {
.setAttribute("transform", `translate(0, ${-scrollY})`);
},
_update: function() {
setIgnoreLayoutChanges(true);
let zoom = LayoutHelpers.getCurrentZoom(this.win);
let isZoomChanged = zoom !== this._zoom;
if (isZoomChanged) {
this._zoom = zoom;
this.updateViewport();
}
setIgnoreLayoutChanges(false, this.win.document.documentElement);
this._rafID = this.win.requestAnimationFrame(() => this._update());
},
_cancelUpdate: function() {
if (this._rafID) {
this.win.cancelAnimationFrame(this._rafID);
this._rafID = 0;
}
},
updateViewport: function() {
let { devicePixelRatio } = this.win;
// Because `devicePixelRatio` is affected by zoom (see bug 809788),
// in order to get the "real" device pixel ratio, we need divide by `zoom`
let pixelRatio = devicePixelRatio / this._zoom;
// The "real" device pixel ratio is used to calculate the max stroke
// width we can actually assign: on retina, for instance, it would be 0.5,
// where on non high dpi monitor would be 1.
let minWidth = 1 / pixelRatio;
let strokeWidth = Math.min(minWidth, minWidth / this._zoom);
this.markup.getElement(this.ID_CLASS_PREFIX + "root").setAttribute("style",
`stroke-width:${strokeWidth};`);
},
destroy: function() {
this.hide();
@ -2947,12 +2986,17 @@ RulersHighlighter.prototype = {
show: function() {
this.markup.removeAttributeForElement(this.ID_CLASS_PREFIX + "elements",
"hidden");
this._update();
return true;
},
hide: function() {
this.markup.setAttributeForElement(this.ID_CLASS_PREFIX + "elements",
"hidden", "true");
this._cancelUpdate();
}
};

View File

@ -1214,16 +1214,6 @@ void ViewTransform::Y(float a0) const
return mozilla::jni::Field<Y_t>::Set(this, nullptr, a0);
}
constexpr char NativeZip::name[];
constexpr char NativeZip::CreateInputStream_t::name[];
constexpr char NativeZip::CreateInputStream_t::signature[];
mozilla::jni::Object::LocalRef NativeZip::CreateInputStream(mozilla::jni::Object::Param a0, int32_t a1) const
{
return mozilla::jni::Method<CreateInputStream_t>::Call(this, nullptr, a0, a1);
}
constexpr char MatrixBlobCursor::name[];
constexpr char MatrixBlobCursor::New_t::name[];

View File

@ -2826,41 +2826,6 @@ public:
};
class NativeZip : public mozilla::jni::Class<NativeZip>
{
public:
typedef mozilla::jni::Ref<NativeZip> Ref;
typedef mozilla::jni::LocalRef<NativeZip> LocalRef;
typedef mozilla::jni::GlobalRef<NativeZip> GlobalRef;
typedef const mozilla::jni::Param<NativeZip>& Param;
static constexpr char name[] =
"org/mozilla/gecko/mozglue/NativeZip";
protected:
NativeZip(jobject instance) : Class(instance) {}
public:
struct CreateInputStream_t {
typedef NativeZip Owner;
typedef mozilla::jni::Object::LocalRef ReturnType;
typedef mozilla::jni::Object::Param SetterType;
typedef mozilla::jni::Args<
mozilla::jni::Object::Param,
int32_t> Args;
static constexpr char name[] = "createInputStream";
static constexpr char signature[] =
"(Ljava/nio/ByteBuffer;I)Ljava/io/InputStream;";
static const bool isStatic = false;
static const bool isMultithreaded = false;
static const mozilla::jni::ExceptionMode exceptionMode =
mozilla::jni::ExceptionMode::ABORT;
};
mozilla::jni::Object::LocalRef CreateInputStream(mozilla::jni::Object::Param, int32_t) const;
};
class MatrixBlobCursor : public mozilla::jni::Class<MatrixBlobCursor>
{
public: