Bug 957880 - Expose memory pressure events to gaia's system app r=gwagner
authorFabrice Desré <fabrice@mozilla.com>
Tue, 14 Jan 2014 21:32:19 -0800
changeset 163491 3f48bdbc6808c5727ac95c2de203ffa03378d053
parent 163490 d8036ae67c2010704b8f0913fb3e8d18fa88db50
child 163492 5ec1de269424fe7289d76032c83038cf2af4b6de
push idunknown
push userunknown
push dateunknown
reviewersgwagner
bugs957880
milestone29.0a1
Bug 957880 - Expose memory pressure events to gaia's system app r=gwagner
b2g/chrome/content/shell.js
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -678,16 +678,20 @@ Services.obs.addObserver(function onWeba
 
 Services.obs.addObserver(function onBluetoothVolumeChange(subject, topic, data) {
   shell.sendChromeEvent({
     type: "bluetooth-volumeset",
     value: data
   });
 }, 'bluetooth-volume-change', false);
 
+Services.obs.addObserver(function(subject, topic, data) {
+  shell.sendCustomEvent('mozmemorypressure');
+}, 'memory-pressure', false);
+
 var CustomEventManager = {
   init: function custevt_init() {
     window.addEventListener("ContentStart", (function(evt) {
       let content = shell.contentBrowser.contentWindow;
       content.addEventListener("mozContentEvent", this, false, true);
 
       // After content starts to load for 10 seconds, send and
       // clean up the buffered open-app requests if there is any.