gecko/dom/tests
Mike Conley 9c2406f932 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.
2015-02-10 13:18:47 -05:00
..
browser Bug 1107699 - Remove timeout before Console.log() and the dispatching of ConsoleEvents, r=past 2015-01-23 13:12:02 +00:00
html
js
mochitest Bug 1077168 - Cancel in-flight Webapp install jobs from windows that change location. r=myk. 2015-02-10 13:18:47 -05:00
unit Bug 811470 - Fix broken manifest on a CLOSED TREE. 2014-11-03 17:19:51 -05:00
moz.build