Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 'use strict';
7 const Cc = Components.classes;
8 const Ci = Components.interfaces;
10 // use ppmm to handle file-picker message.
11 let ppmm = Cc['@mozilla.org/parentprocessmessagemanager;1']
12 .getService(Ci.nsIMessageListenerManager);
14 let pickResult = null;
16 function processPickMessage(message) {
17 let sender = message.target.QueryInterface(Ci.nsIMessageSender);
18 // reply FilePicker's message
19 sender.sendAsyncMessage('file-picked', pickResult);
20 // notify caller
21 sendAsyncMessage('file-picked-posted', { type: 'file-picked-posted' });
22 }
24 function updatePickResult(result) {
25 pickResult = result;
26 sendAsyncMessage('pick-result-updated', { type: 'pick-result-updated' });
27 }
29 ppmm.addMessageListener('file-picker', processPickMessage);
30 // use update-pick-result to change the expected pick result.
31 addMessageListener('update-pick-result', updatePickResult);