Bug 1266484 - Fix crash in libsystem_kernel.dylib@0x16db6 when using Pinboard bookmarklet. r=gabor, a=lizzard
authorHaik Aftandilian <haftandilian@mozilla.com>
Mon, 25 Apr 2016 09:33:00 -0400
changeset 332805 36e12a7d0ae8166ce03cefc51c93ac3456a12daf
parent 332804 bf290651a401d007f849c1fbd9b246fce41d3b0e
child 332806 5e345d6d359c93ccb70aeaf6cccb3713f217a3ab
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgabor, lizzard
bugs1266484
milestone48.0a2
Bug 1266484 - Fix crash in libsystem_kernel.dylib@0x16db6 when using Pinboard bookmarklet. r=gabor, a=lizzard
dom/ipc/PBrowser.ipdl
dom/ipc/TabParent.cpp
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -477,17 +477,24 @@ parent:
                                      double aPointerPressure,
                                      uint32_t aPointerOrientation,
                                      uint64_t aObserverId);
     async SynthesizeNativeTouchTap(LayoutDeviceIntPoint aPoint,
                                    bool aLongTap,
                                    uint64_t aObserverId);
     async ClearNativeTouchSequence(uint64_t aObserverId);
 
+    /**
+     * Returns the number of tabs in the window via the out parameter.
+     * If the number of tabs can't be determined, returns 0.
+     *
+     * @param aValue where to store the tab count
+     */
     sync GetTabCount() returns (uint32_t value);
+
 child:
     async NativeSynthesisResponse(uint64_t aObserverId, nsCString aResponse);
 
 
 parent:
 
     /**
      * Child informs the parent that the graphics objects are ready for
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -3282,22 +3282,24 @@ TabParent::AudioChannelChangeNotificatio
 
     window = win;
   }
 }
 
 bool
 TabParent::RecvGetTabCount(uint32_t* aValue)
 {
+  *aValue = 0;
+
   nsCOMPtr<nsIXULBrowserWindow> xulBrowserWindow = GetXULBrowserWindow();
-  NS_ENSURE_TRUE(xulBrowserWindow, false);
+  NS_ENSURE_TRUE(xulBrowserWindow, true);
 
   uint32_t tabCount;
   nsresult rv = xulBrowserWindow->GetTabCount(&tabCount);
-  NS_ENSURE_SUCCESS(rv, false);
+  NS_ENSURE_SUCCESS(rv, true);
 
   *aValue = tabCount;
   return true;
 }
 
 NS_IMETHODIMP
 FakeChannel::OnAuthAvailable(nsISupports *aContext, nsIAuthInformation *aAuthInfo)
 {