michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: "use strict"; michael@0: michael@0: (function() { michael@0: michael@0: const {classes: Cc, interfaces: Ci, utils: Cu} = Components; michael@0: michael@0: let {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); michael@0: michael@0: let nsIFile = Components.Constructor("@mozilla.org/file/local;1", "nsIFile", michael@0: "initWithPath"); michael@0: michael@0: const MSG_JAR_FLUSH = "AddonJarFlush"; michael@0: michael@0: michael@0: try { michael@0: if (Services.appinfo.processType !== Services.appinfo.PROCESS_TYPE_DEFAULT) { michael@0: // Propagate JAR cache flush notifications across process boundaries. michael@0: addMessageListener(MSG_JAR_FLUSH, function jar_flushMessageListener(message) { michael@0: let file = new nsIFile(message.data); michael@0: Services.obs.notifyObservers(file, "flush-cache-entry", null); michael@0: }); michael@0: } michael@0: } catch(e) { michael@0: Cu.reportError(e); michael@0: } michael@0: michael@0: })();