Bug 1284888 part 1: Annotate TextOverflow as a heap-only final class, to reflect reality. r=jfkthame
authorDaniel Holbert <dholbert@cs.stanford.edu>
Tue, 18 Jul 2017 22:36:24 -0700
changeset 418385 ded6ed223ce51b170aa42787d31c875810b7f128
parent 418384 46fb0382583cd90f594a3670fbbd6b865e9a6f99
child 418386 4cc4ef8f7e73bf7c5730577769fb6b516229b4fb
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)
reviewersjfkthame
bugs1284888
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 1284888 part 1: Annotate TextOverflow as a heap-only final class, to reflect reality. r=jfkthame MozReview-Commit-ID: 9e03pevzCOc
layout/generic/TextOverflow.h
--- a/layout/generic/TextOverflow.h
+++ b/layout/generic/TextOverflow.h
@@ -4,33 +4,34 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef TextOverflow_h_
 #define TextOverflow_h_
 
 #include "nsDisplayList.h"
 #include "nsTHashtable.h"
+#include "mozilla/Attributes.h"
 #include "mozilla/Likely.h"
 #include "mozilla/WritingModes.h"
 #include <algorithm>
 
 class nsIScrollableFrame;
 class nsLineBox;
 
 namespace mozilla {
 namespace css {
 
 /**
  * A class for rendering CSS3 text-overflow.
  * Usage:
  *  1. allocate an object using WillProcessLines
  *  2. then call ProcessLine for each line you are building display lists for
  */
-class TextOverflow {
+class MOZ_HEAP_CLASS TextOverflow final {
  public:
   /**
    * Allocate an object for text-overflow processing.
    * @return nullptr if no processing is necessary.  The caller owns the object.
    */
   static TextOverflow* WillProcessLines(nsDisplayListBuilder*   aBuilder,
                                         nsIFrame*               aBlockFrame);
   /**
@@ -50,19 +51,19 @@ class TextOverflow {
    * @return true if aBlockFrmae has text-overflow:clip on both sides.
    */
   static bool HasClippedOverflow(nsIFrame* aBlockFrame);
   /**
    * @return true if aBlockFrame needs analysis for text overflow.
    */
   static bool CanHaveTextOverflow(nsIFrame* aBlockFrame);
 
-  typedef nsTHashtable<nsPtrHashKey<nsIFrame> > FrameHashtable;
+  typedef nsTHashtable<nsPtrHashKey<nsIFrame>> FrameHashtable;
 
- protected:
+ private:
   TextOverflow(nsDisplayListBuilder* aBuilder,
                nsIFrame* aBlockFrame);
 
   typedef mozilla::WritingMode WritingMode;
   typedef mozilla::LogicalRect LogicalRect;
 
   struct AlignmentEdges {
     AlignmentEdges() : mAssigned(false) {}