Bug 1331988 - Don't provide DPI and related values until the TabChild has received the the ShowInfo, to avoid doing sync IPC. r=dvander a=gchang
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 23 Jan 2017 12:03:53 -0500
changeset 377955 89cd8285510642646b44887bea8942d503c26851
parent 377954 3f9f37f1bcf80544d2e491d812afffbb77631164
child 377956 f0e4b9855df1986fbc3e560b6373bd4f276440e5
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdvander, gchang
bugs1331988, 1331509
milestone53.0a2
Bug 1331988 - Don't provide DPI and related values until the TabChild has received the the ShowInfo, to avoid doing sync IPC. r=dvander a=gchang In bug 1331509, mRemoteFrame started getting populated earlier, while the DPI and default scale values remained unpopulated until RecvShow was called. This opened a small window where calling TabChild::GetDPI (and GetDefaultScale) would result in a sync IPC message where previously it would just return -1. This restores the original behaviour and elimintes the perf regression from the sync IPC. MozReview-Commit-ID: AikQmZjVHc9
dom/ipc/TabChild.cpp
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -2646,51 +2646,51 @@ TabChild::InitAPZState()
   RefPtr<GeckoContentController> contentController = new ContentProcessController(this);
   cbc->SendPAPZConstructor(new APZChild(contentController), mLayersId);
 }
 
 void
 TabChild::GetDPI(float* aDPI)
 {
     *aDPI = -1.0;
-    if (!mRemoteFrame) {
+    if (!(mDidFakeShow || mDidSetRealShowInfo)) {
         return;
     }
 
     if (mDPI > 0) {
       *aDPI = mDPI;
       return;
     }
 
     // Fallback to a sync call if needed.
     SendGetDPI(aDPI);
 }
 
 void
 TabChild::GetDefaultScale(double* aScale)
 {
     *aScale = -1.0;
-    if (!mRemoteFrame) {
+    if (!(mDidFakeShow || mDidSetRealShowInfo)) {
         return;
     }
 
     if (mDefaultScale > 0) {
       *aScale = mDefaultScale;
       return;
     }
 
     // Fallback to a sync call if needed.
     SendGetDefaultScale(aScale);
 }
 
 void
 TabChild::GetWidgetRounding(int32_t* aRounding)
 {
   *aRounding = 1;
-  if (!mRemoteFrame) {
+  if (!(mDidFakeShow || mDidSetRealShowInfo)) {
     return;
   }
   if (mRounding > 0) {
     *aRounding = mRounding;
     return;
   }
 
   // Fallback to a sync call if needed.