Commit 1040ee9f authored by Ehsan Akhgari's avatar Ehsan Akhgari
Browse files

Bug 1347035 - Store the maximum touch points for each tab child on the object...

Bug 1347035 - Store the maximum touch points for each tab child on the object instead of querying it synchronously from the parent actor when neeeded; r=smaug ipc-r=kanru
parent 691628a3
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -825,6 +825,7 @@ ContentChild::ProvideWindowCommon(TabChild* aTabOpener,
  TextureFactoryIdentifier textureFactoryIdentifier;
  uint64_t layersId = 0;
  CompositorOptions compositorOptions;
  uint32_t maxTouchPoints = 0;

  if (aIframeMoz) {
    MOZ_ASSERT(aTabOpener);
@@ -841,7 +842,7 @@ ContentChild::ProvideWindowCommon(TabChild* aTabOpener,
    newChild->SendBrowserFrameOpenWindow(aTabOpener, renderFrame, NS_ConvertUTF8toUTF16(url),
                                         name, NS_ConvertUTF8toUTF16(features),
                                         aWindowIsNew, &textureFactoryIdentifier,
                                         &layersId, &compositorOptions);
                                         &layersId, &compositorOptions, &maxTouchPoints);
  } else {
    nsAutoCString baseURIString;
    float fullZoom;
@@ -865,7 +866,8 @@ ContentChild::ProvideWindowCommon(TabChild* aTabOpener,
                          &urlToLoad,
                          &textureFactoryIdentifier,
                          &layersId,
                          &compositorOptions)) {
                          &compositorOptions,
                          &maxTouchPoints)) {
      PRenderFrameChild::Send__delete__(renderFrame);
      return NS_ERROR_NOT_AVAILABLE;
    }
@@ -896,6 +898,8 @@ ContentChild::ProvideWindowCommon(TabChild* aTabOpener,
                        aTabOpener->mDefaultScale);
  }

  newChild->SetMaxTouchPoints(maxTouchPoints);

  // Set the opener window for this window before we start loading the document
  // inside of it. We have to do this before loading the remote scripts, because
  // they can poke at the document and cause the nsDocument to be created before
+5 −1
Original line number Diff line number Diff line
@@ -4617,7 +4617,8 @@ ContentParent::RecvCreateWindow(PBrowserParent* aThisTab,
                                nsCString* aURLToLoad,
                                TextureFactoryIdentifier* aTextureFactoryIdentifier,
                                uint64_t* aLayersId,
                                CompositorOptions* aCompositorOptions)
                                CompositorOptions* aCompositorOptions,
                                uint32_t* aMaxTouchPoints)
{
  // We always expect to open a new window here. If we don't, it's an error.
  *aWindowIsNew = true;
@@ -4671,6 +4672,9 @@ ContentParent::RecvCreateWindow(PBrowserParent* aThisTab,
  }
  *aCompositorOptions = rfp->GetCompositorOptions();

  nsCOMPtr<nsIWidget> widget = newTab->GetWidget();
  *aMaxTouchPoints = widget ? widget->GetMaxTouchPoints() : 0;

  return IPC_OK();
}

+2 −1
Original line number Diff line number Diff line
@@ -549,7 +549,8 @@ public:
                   nsCString* aURLToLoad,
                   layers::TextureFactoryIdentifier* aTextureFactoryIdentifier,
                   uint64_t* aLayersId,
                   mozilla::layers::CompositorOptions* aCompositorOptions) override;
                   mozilla::layers::CompositorOptions* aCompositorOptions,
                   uint32_t* aMaxTouchPoints) override;

  virtual mozilla::ipc::IPCResult RecvCreateWindowInDifferentProcess(
    PBrowserParent* aThisTab,
+2 −6
Original line number Diff line number Diff line
@@ -377,11 +377,6 @@ parent:
     */
    sync GetWidgetRounding() returns (int32_t value);

    /**
     * Gets maximum of touch points at current device.
     */
    sync GetMaxTouchPoints() returns (uint32_t value);

    /**
     * Set the native cursor.
     * @param value
@@ -466,7 +461,8 @@ parent:
      returns (bool windowOpened,
               TextureFactoryIdentifier textureFactoryIdentifier,
               uint64_t layersId,
               CompositorOptions compositorOptions);
               CompositorOptions compositorOptions,
               uint32_t maxTouchPoints);

    /**
     * Tells the containing widget whether the given input block results in a
+2 −1
Original line number Diff line number Diff line
@@ -1020,7 +1020,8 @@ parent:
               nsCString urlToLoad,
               TextureFactoryIdentifier textureFactoryIdentifier,
               uint64_t layersId,
               CompositorOptions compositorOptions);
               CompositorOptions compositorOptions,
               uint32_t maxTouchPoints);

    async CreateWindowInDifferentProcess(
      PBrowser aThisTab,
Loading