Bug 930452 - GeckoView busted by HelperApps.jsm again r=blassey
authorMark Finkle <mfinkle@mozilla.com>
Thu, 24 Oct 2013 07:20:07 -0400
changeset 151931 50b017bc4a01adb494d96f6492420b06468c49d0
parent 151930 677fb0cd248c525381197bd5c0c9b05082e7634f
child 151932 a5fe1b3e8f7908930f1bcfe4ad920e6e50261454
push id3198
push usermfinkle@mozilla.com
push dateThu, 24 Oct 2013 11:21:39 +0000
treeherderfx-team@50b017bc4a01 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs930452
milestone27.0a1
Bug 930452 - GeckoView busted by HelperApps.jsm again r=blassey
mobile/android/modules/HelperApps.jsm
--- a/mobile/android/modules/HelperApps.jsm
+++ b/mobile/android/modules/HelperApps.jsm
@@ -70,17 +70,21 @@ var HelperApps =  {
     return results;
   },
 
   getAppsForUri: function getAppsForUri(uri, flags = { filterHttp: true }) {
     flags.filterHttp = "filterHttp" in flags ? flags.filterHttp : true;
 
     // Query for apps that can/can't handle the mimetype
     let msg = this._getMessage("Intent:GetHandlers", uri, flags);
-    let apps = this._parseApps(this._sendMessage(msg).apps);
+    let data = this._sendMessage(msg);
+    if (!data)
+      return [];
+
+    let apps = this._parseApps(data.apps);
 
     if (flags.filterHttp) {
       apps = apps.filter(function(app) {
         return app.name && !this.defaultHttpHandlers[app.name];
       }, this);
     }
 
     return apps;
@@ -127,13 +131,12 @@ var HelperApps =  {
       packageName: app.packageName,
       className: app.activityName
     });
 
     this._sendMessage(msg);
   },
 
   _sendMessage: function(msg) {
-    Services.console.logStringMessage("Sending: " + JSON.stringify(msg));
     let res = Services.androidBridge.handleGeckoMessage(JSON.stringify(msg));
     return JSON.parse(res);
   },
 };