Bug 1370089 - Assume APZ is enabled in TabChild if we are queried before we have the compositor options. r?dvander draft
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 30 Jun 2017 14:51:33 -0400
changeset 602801 91b0c8988fded137258c7800d358d73cd114a5db
parent 602765 abd8809269675a9c5efb6778b19ba6e6607f626d
child 635715 0236170bf2257e161076bd85e3bd322eb2fc1639
push id66553
push userkgupta@mozilla.com
push dateFri, 30 Jun 2017 18:52:07 +0000
reviewersdvander
bugs1370089
milestone56.0a1
Bug 1370089 - Assume APZ is enabled in TabChild if we are queried before we have the compositor options. r?dvander MozReview-Commit-ID: KHvAvGCQQUr
dom/ipc/TabChild.cpp
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -427,20 +427,21 @@ TabChild::TabChild(nsIContentChild* aMan
     MOZ_ASSERT(NestedTabChildMap().find(mUniqueId) == NestedTabChildMap().end());
     NestedTabChildMap()[mUniqueId] = this;
   }
 }
 
 bool
 TabChild::AsyncPanZoomEnabled() const
 {
-  // By the time anybody calls this, we must have had InitRenderingState called
-  // already, and so mCompositorOptions should be populated.
-  MOZ_RELEASE_ASSERT(mCompositorOptions);
-  return mCompositorOptions->UseAPZ();
+  // This might get called by the TouchEvent::PrefEnabled code before we have
+  // mCompositorOptions populated (bug 1370089). In that case we just assume
+  // APZ is enabled because we're in a content process (because TabChild) and
+  // APZ is probably going to be enabled here since e10s is enabled.
+  return mCompositorOptions ? mCompositorOptions->UseAPZ() : true;
 }
 
 NS_IMETHODIMP
 TabChild::Observe(nsISupports *aSubject,
                   const char *aTopic,
                   const char16_t *aData)
 {
   if (!strcmp(aTopic, BEFORE_FIRST_PAINT)) {