Bug 1103410 - Unhandled error for GeckoRequest FindInPage:Find, r=wesj
authorMark Capella <markcapella@twcny.rr.com>
Sat, 20 Dec 2014 00:50:11 -0500
changeset 220737 0ff1c9cd9d15c32aaedd466b7b70a78a16781a28
parent 220736 3b9d11c60685ba81c363a5d268d33d5f8ce212c3
child 220738 48b7608267e912bdf529cbdbbcdac983ad7ed0cb
push id27997
push userphilringnalda@gmail.com
push dateSat, 20 Dec 2014 20:18:46 +0000
treeherdermozilla-central@7b33ee7fd162 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswesj
bugs1103410
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1103410 - Unhandled error for GeckoRequest FindInPage:Find, r=wesj
mobile/android/base/FindInPageBar.java
mobile/android/chrome/content/FindHelper.js
--- a/mobile/android/base/FindInPageBar.java
+++ b/mobile/android/base/FindInPageBar.java
@@ -219,17 +219,18 @@ public class FindInPageBar extends Linea
         GeckoAppShell.sendRequestToGecko(new GeckoRequest(request, json) {
             @Override
             public void onResponse(NativeJSObject nativeJSObject) {
                 final int total = nativeJSObject.optInt("total", 0);
                 final int current = nativeJSObject.optInt("current", 0);
                 updateResult(total, current);
             }
 
-            public void onError() {
+            @Override
+            public void onError(NativeJSObject error) {
                 // Gecko didn't respond due to state change, javascript error, etc.
                 updateResult(0, 0);
                 Log.d(LOGTAG, "No response from Gecko on request to match string: [" +
                     searchString + "]");
             }
 
             private void updateResult(int total, int current) {
                 final Boolean statusVisibility = (total > 0);
--- a/mobile/android/chrome/content/FindHelper.js
+++ b/mobile/android/chrome/content/FindHelper.js
@@ -50,17 +50,23 @@ var FindHelper = {
 
   _init: function() {
     // If there's no find in progress, start one.
     if (this._finder) {
       return;
     }
 
     this._targetTab = BrowserApp.selectedTab;
-    this._finder = this._targetTab.browser.finder;
+    try {
+      this._finder = this._targetTab.browser.finder;
+    } catch (e) {
+      throw new Error("FindHelper: " + e + "\n" +
+        "JS stack: \n" + (e.stack || Components.stack.formattedStack));
+    }
+
     this._finder.addResultListener(this);
     this._initialViewport = JSON.stringify(this._targetTab.getViewport());
     this._viewportChanged = false;
   },
 
   _uninit: function() {
     // If there's no find in progress, there's nothing to clean up.
     if (!this._finder) {