Bug 1095754 - Remove obsolete PPluginWidget apis and code. r=aklotz
authorJim Mathies <jmathies@mozilla.com>
Thu, 29 Jan 2015 13:41:56 -0600
changeset 226590 f3b07e994214eb60ca78d97c043cc1a89cbe7d9d
parent 226589 b9b207933991119c6a74c23620c590933d05fc6d
child 226591 51b36ab1efb7421c1ff91b3b978444d5bb1b095e
push id28200
push userkwierso@gmail.com
push dateThu, 29 Jan 2015 23:01:46 +0000
treeherdermozilla-central@4380ed39de3a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaklotz
bugs1095754
milestone38.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 1095754 - Remove obsolete PPluginWidget apis and code. r=aklotz
dom/ipc/PPluginWidget.ipdl
dom/plugins/ipc/PluginWidgetParent.cpp
dom/plugins/ipc/PluginWidgetParent.h
--- a/dom/ipc/PPluginWidget.ipdl
+++ b/dom/ipc/PPluginWidget.ipdl
@@ -31,30 +31,20 @@ sync protocol PPluginWidget {
 
 parent:
   async __delete__();
 
 parent:
   async Create();
   async Destroy();
   async SetFocus(bool aRaise);
-  async Invalidate(nsIntRect aRect);
 
   /**
    * Returns NS_NATIVE_PLUGIN_PORT and its variants: a sharable native
    * window for plugins. On Linux, this returns an XID for a socket widget
    * embedded in the chrome side native window. On Windows this returns the
    * native HWND of the plugin widget.
    */
   sync GetNativePluginPort() returns (uintptr_t value);
-
-  /**
-   * nsIWidget interfaces we'll need until this information flows
-   * over the compositor connection.
-   */
-  async Show(bool aState);
-  async Resize(nsIntRect aRect);
-  async Move(double aX, double aY);
-  async SetWindowClipRegion(nsIntRect[] Regions, bool aIntersectWithExisting);
 };
 
 }
 }
--- a/dom/plugins/ipc/PluginWidgetParent.cpp
+++ b/dom/plugins/ipc/PluginWidgetParent.cpp
@@ -112,21 +112,16 @@ PluginWidgetParent::RecvCreate()
   mWidget->Enable(false);
 
   // This is a special call we make to nsBaseWidget to register this
   // window as a remote plugin window which is expected to receive
   // visibility updates from the compositor, which ships this data
   // over with corresponding layer updates.
   mWidget->RegisterPluginWindowForRemoteUpdates();
 
-  // Force the initial position down into content. If we miss an
-  // initial position update this insures the widget doesn't overlap
-  // chrome.
-  RecvMove(0, 0);
-
 #if defined(MOZ_WIDGET_GTK)
   // For setup, initially GTK code expects 'window' to hold the parent.
   mWrapper->window = mWidget->GetNativeData(NS_NATIVE_PLUGIN_PORT);
   mWrapper->CreateXEmbedWindow(false);
   mWrapper->SetAllocation();
   PWLOG("Plugin XID=%p\n", (void*)mWrapper->window);
 #endif
 
@@ -140,99 +135,32 @@ PluginWidgetParent::RecvDestroy()
   PWLOG("PluginWidgetParent::RecvDestroy()\n");
   mWidget->UnregisterPluginWindowForRemoteUpdates();
   mWidget->Destroy();
   mWidget = nullptr;
   return true;
 }
 
 bool
-PluginWidgetParent::RecvShow(const bool& aState)
-{
-  ENSURE_CHANNEL;
-  PWLOG("PluginWidgetParent::RecvShow(%d)\n", aState);
-  mWidget->Show(aState);
-  return true;
-}
-
-bool
 PluginWidgetParent::RecvSetFocus(const bool& aRaise)
 {
   ENSURE_CHANNEL;
   PWLOG("PluginWidgetParent::RecvSetFocus(%d)\n", aRaise);
   mWidget->SetFocus(aRaise);
   return true;
 }
 
 bool
-PluginWidgetParent::RecvInvalidate(const nsIntRect& aRect)
-{
-  ENSURE_CHANNEL;
-  PWLOG("PluginWidgetParent::RecvInvalidate(%d, %d, %d, %d)\n", aRect.x, aRect.y, aRect.width, aRect.height);
-  mWidget->Invalidate(aRect);
-  return true;
-}
-
-bool
 PluginWidgetParent::RecvGetNativePluginPort(uintptr_t* value)
 {
   ENSURE_CHANNEL;
   PWLOG("PluginWidgetParent::RecvGetNativeData()\n");
 #if defined(MOZ_WIDGET_GTK)
   *value = (uintptr_t)mWrapper->window;
 #else
   *value = (uintptr_t)mWidget->GetNativeData(NS_NATIVE_PLUGIN_PORT);
 #endif
   PWLOG("PluginWidgetParent::RecvGetNativeData() %p\n", (void*)*value);
   return true;
 }
 
-bool
-PluginWidgetParent::RecvResize(const nsIntRect& aRect)
-{
-  ENSURE_CHANNEL;
-  PWLOG("PluginWidgetParent::RecvResize(%d, %d, %d, %d)\n", aRect.x, aRect.y, aRect.width, aRect.height);
-  mWidget->Resize(aRect.width, aRect.height, true);
-#if defined(MOZ_WIDGET_GTK)
-  mWrapper->width = aRect.width;
-  mWrapper->height = aRect.height;
-  mWrapper->SetAllocation();
-#endif
-  return true;
-}
-
-bool
-PluginWidgetParent::RecvMove(const double& aX, const double& aY)
-{
-  ENSURE_CHANNEL;
-  PWLOG("PluginWidgetParent::RecvMove(%f, %f)\n", aX, aY);
-
-
-  // This returns the top level window
-  nsCOMPtr<nsIWidget> widget = GetTabParent()->GetWidget();
-  if (!widget) {
-    // return true otherwise ipc will abort the content process, crashing
-    // all tabs.
-    return true;
-  }
-
-  // Passed in coords are at the tab origin, adjust to the main window.
-  nsIntPoint offset = GetTabParent()->GetChildProcessOffset();
-  offset.x = abs(offset.x);
-  offset.y = abs(offset.y);
-  offset += nsIntPoint(ceil(aX), ceil(aY));
-  mWidget->Move(offset.x, offset.y);
-
-  return true;
-}
-
-bool
-PluginWidgetParent::RecvSetWindowClipRegion(InfallibleTArray<nsIntRect>&& Regions,
-                                            const bool& aIntersectWithExisting)
-{
-  ENSURE_CHANNEL;
-  PWLOG("PluginWidgetParent::RecvSetWindowClipRegion()\n");
-  mWidget->SetWindowClipRegion(Regions, aIntersectWithExisting);
-  return true;
-}
-
 } // namespace plugins
 } // namespace mozilla
--- a/dom/plugins/ipc/PluginWidgetParent.h
+++ b/dom/plugins/ipc/PluginWidgetParent.h
@@ -25,24 +25,18 @@ class PluginWidgetParent : public PPlugi
 {
 public:
   PluginWidgetParent();
   virtual ~PluginWidgetParent();
 
   virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
   virtual bool RecvCreate() MOZ_OVERRIDE;
   virtual bool RecvDestroy() MOZ_OVERRIDE;
-  virtual bool RecvShow(const bool& aState) MOZ_OVERRIDE;
   virtual bool RecvSetFocus(const bool& aRaise) MOZ_OVERRIDE;
-  virtual bool RecvInvalidate(const nsIntRect& aRect) MOZ_OVERRIDE;
   virtual bool RecvGetNativePluginPort(uintptr_t* value) MOZ_OVERRIDE;
-  virtual bool RecvResize(const nsIntRect& aRect) MOZ_OVERRIDE;
-  virtual bool RecvMove(const double& aX, const double& aY) MOZ_OVERRIDE;
-  virtual bool RecvSetWindowClipRegion(InfallibleTArray<nsIntRect>&& Regions,
-				       const bool& aIntersectWithExisting) MOZ_OVERRIDE;
 
 private:
   // The tab our connection is associated with.
   mozilla::dom::TabParent* GetTabParent();
   // The chrome side native widget.
   nsCOMPtr<nsIWidget> mWidget;
 #if defined(MOZ_WIDGET_GTK)
   UniquePtr<nsPluginNativeWindowGtk> mWrapper;