gecko-dev/dom/tests/mochitest
Mike Conley 448f596abf Bug 1077168 - Cancel in-flight Webapp install jobs from windows that change location. r=myk.
Installing a Webapp is an asynchronous job, and there is a pocket of time
between when web content requests to install an app and before the browser
displays an installation prompt that the outer window of the content can
browse away. This pocket of time is typically used by XHR to request the
web app resources and verify their contents.

This pocket of time is, essentially, bug 771294, and is a bit of a security
problem.

This problem was originally patched over on Desktop by checking in the parent
process that the outer window was still at the same URI as it had been when it
made the request. I'm not entirely sure if Android / B2G made similar checks.

With separated content processes, however, the browser front-end can no longer
performantly check to ensure that the outer window is at the same URI.

We solve this problem by sending up a message in the content process when
the location of an outer window making use of navigator.mozApps changes.
We hold a Map of "actions" mapping to in-flight installs mapped by the
outer window ID of the requesting content. When we notice a location
change, we mark those actions as cancelled. When the XHR returns, we have
it check the state of its actions, and if they're cancelled, it aborts
further action.

Normally, this wouldn't be necessary, since any XHR initiated by the
content window would be cancelled once the location changed, but in
this case, the XHR is occurring in Webapps.jsm, and is not influenced
by the outer window of the content.

--HG--
extra : rebase_source : 5f95002a21c96c5cbf3dca8ca265400448251b43
2015-02-10 13:18:47 -05:00
..
ajax Bug 1131317 - Always unwrap objects before wrapping them in XPCWrappedJS (r=mrbkap) 2015-02-18 10:42:28 -08:00
beacon Bug 1080987 - navigator.sendBeacon() needs to sent origin header - test (r=sicking) 2014-11-19 16:03:30 -08:00
bugs Bug 1056851 - Change existing callers of SpecialPowers.setBoolPref/setIntPref/setCharPref to SpecialPowers.pushPrefEnv. r=jmaher,mwargers 2015-02-19 11:53:01 -05:00
chrome Bug 1056851 - Change existing callers of SpecialPowers.setBoolPref/setIntPref/setCharPref to SpecialPowers.pushPrefEnv. r=jmaher,mwargers 2015-02-19 11:53:01 -05:00
crypto
dom-level0 Bug 932350 - Re-enable dom-level0 tests. 2014-10-14 16:55:13 +02:00
dom-level1-core Bug 932350 - Re-enable the dom-level* mochitests on desktop platforms. 2014-10-14 10:31:15 -04:00
dom-level2-core Bug 932350 - Re-enable the dom-level* mochitests on desktop platforms. 2014-10-14 10:31:15 -04:00
dom-level2-html Bug 932350 - Re-enable the dom-level* mochitests on desktop platforms. 2014-10-14 10:31:15 -04:00
fetch Back out 3 changesets (bug 1117650) for allowing an ASan mochitest-2 leak exactly like they allowed it on try 2015-02-08 23:07:51 -08:00
gamepad bug 852257 fixup, add missing skip-if in manifest (CLOSED TREE) 2015-01-12 13:25:58 -05:00
general Bug 1056851 - Change existing callers of SpecialPowers.setBoolPref/setIntPref/setCharPref to SpecialPowers.pushPrefEnv. r=jmaher,mwargers 2015-02-19 11:53:01 -05:00
geolocation Bug 649012 - Fail mochitest-plains which use flaky timeouts (setTimeout(x) for x > 0); r=ted 2014-12-11 13:34:40 -05:00
localstorage Bug 1056851 - Change existing callers of SpecialPowers.setBoolPref/setIntPref/setCharPref to SpecialPowers.pushPrefEnv. r=jmaher,mwargers 2015-02-19 11:53:01 -05:00
notification Bug 649012 - Fail mochitest-plains which use flaky timeouts (setTimeout(x) for x > 0); r=ted 2014-12-11 13:34:40 -05:00
orientation
pointerlock Bug 744125 - Disable test_pointerlock-api.html on 10.10, too 2015-01-14 22:32:08 -08:00
sessionstorage
storageevent
webapps Bug 1077168 - Cancel in-flight Webapp install jobs from windows that change location. r=myk. 2015-02-10 13:18:47 -05:00
webcomponents Bug 1087460 - Part 2: Call attached and detached callback when attached and detached to/from the composed document. r=smaug 2015-02-09 10:01:24 -08:00
whatwg