toolkit/mozapps/extensions/internal/Content.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/mozapps/extensions/internal/Content.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,31 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +"use strict";
     1.9 +
    1.10 +(function() {
    1.11 +
    1.12 +const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
    1.13 +
    1.14 +let {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
    1.15 +
    1.16 +let nsIFile = Components.Constructor("@mozilla.org/file/local;1", "nsIFile",
    1.17 +                                     "initWithPath");
    1.18 +
    1.19 +const MSG_JAR_FLUSH = "AddonJarFlush";
    1.20 +
    1.21 +
    1.22 +try {
    1.23 +  if (Services.appinfo.processType !== Services.appinfo.PROCESS_TYPE_DEFAULT) {
    1.24 +  // Propagate JAR cache flush notifications across process boundaries.
    1.25 +    addMessageListener(MSG_JAR_FLUSH, function jar_flushMessageListener(message) {
    1.26 +      let file = new nsIFile(message.data);
    1.27 +      Services.obs.notifyObservers(file, "flush-cache-entry", null);
    1.28 +    });
    1.29 +  }
    1.30 +} catch(e) {
    1.31 +  Cu.reportError(e);
    1.32 +}
    1.33 +
    1.34 +})();

mercurial