Bug 1379940 - Fix high memory consumption when hovering links on Windows. r=kmag
authorStephen A Pohl <spohl.mozilla.bugs@gmail.com>
Wed, 12 Jul 2017 12:06:00 -0400
changeset 417678 c623242b62daf626f9e45889449c175f78bd42ae
parent 417677 ba31bf7e9dc7d3a462eb60b603cc31972b5a2b13
child 417679 d90c8018a22f87f300323648b623a6b87761145a
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1379940
milestone56.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 1379940 - Fix high memory consumption when hovering links on Windows. r=kmag
widget/windows/nsWindow.cpp
widget/windows/nsWindow.h
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -7183,16 +7183,26 @@ bool nsWindow::AutoErase(HDC dc)
 }
 
 bool
 nsWindow::IsPopup()
 {
   return mWindowType == eWindowType_popup;
 }
 
+bool
+nsWindow::ShouldUseOffMainThreadCompositing()
+{
+  if (IsSmallPopup()) {
+    return false;
+  }
+
+  return nsBaseWidget::ShouldUseOffMainThreadCompositing();
+}
+
 void
 nsWindow::WindowUsesOMTC()
 {
   ULONG_PTR style = ::GetClassLongPtr(mWnd, GCL_STYLE);
   if (!style) {
     NS_WARNING("Could not get window class style");
     return;
   }
--- a/widget/windows/nsWindow.h
+++ b/widget/windows/nsWindow.h
@@ -297,16 +297,17 @@ public:
 
   // Open file picker tracking
   void                    PickerOpen();
   void                    PickerClosed();
 
   bool                    const DestroyCalled() { return mDestroyCalled; }
 
   bool IsPopup();
+  virtual bool ShouldUseOffMainThreadCompositing() override;
 
   const IMEContext& DefaultIMC() const { return mDefaultIMC; }
 
   virtual void SetCandidateWindowForPlugin(
                  const mozilla::widget::CandidateWindowPosition&
                    aPosition) override;
   virtual void DefaultProcOfPluginEvent(
                  const mozilla::WidgetPluginEvent& aEvent) override;