Bug 1284888 part 1: Annotate TextOverflow as a heap-only final class, to reflect reality. r?jfkthame
MozReview-Commit-ID: 9e03pevzCOc
--- 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) {}