Merge bools into bit fields in TextTrackCue and VTTCue
On x86_64 Linux, this reduces sizeof(VTTCue) from 248 to 232.
This does likely not result in real runtime savings, but is a
step back from 256, where a real memory increase is likely.
BUG=none
Review URL: https://codereview.chromium.org/104243003
git-svn-id: svn://svn.chromium.org/blink/trunk@163183 bbb929c8-8fbe-4397-9dbb-9b2b20218538
diff --git a/third_party/WebKit/Source/core/html/track/TextTrackCue.h b/third_party/WebKit/Source/core/html/track/TextTrackCue.h
index 303375e..89ecd07 100644
--- a/third_party/WebKit/Source/core/html/track/TextTrackCue.h
+++ b/third_party/WebKit/Source/core/html/track/TextTrackCue.h
@@ -106,8 +106,8 @@
TextTrack* m_track;
- bool m_isActive;
- bool m_pauseOnExit;
+ bool m_isActive : 1;
+ bool m_pauseOnExit : 1;
};
} // namespace WebCore
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
index 8a5f3ff..9d5a914 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
@@ -209,10 +209,10 @@
, m_writingDirection(Horizontal)
, m_cueAlignment(Middle)
, m_vttNodeTree(0)
- , m_snapToLines(true)
, m_cueBackgroundBox(HTMLDivElement::create(document))
- , m_displayTreeShouldChange(true)
, m_displayDirection(CSSValueLtr)
+ , m_snapToLines(true)
+ , m_displayTreeShouldChange(true)
, m_notifyRegion(true)
{
ScriptWrappable::init(this);
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.h b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.h
index e006ae7..87c8cfa7 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.h
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.h
@@ -168,24 +168,20 @@
int m_textPosition;
int m_cueSize;
WritingDirection m_writingDirection;
-
CueAlignment m_cueAlignment;
+ String m_regionId;
RefPtr<DocumentFragment> m_vttNodeTree;
- bool m_snapToLines;
-
RefPtr<HTMLDivElement> m_cueBackgroundBox;
-
- bool m_displayTreeShouldChange;
RefPtr<VTTCueBox> m_displayTree;
CSSValueID m_displayDirection;
-
int m_displaySize;
-
std::pair<float, float> m_displayPosition;
- String m_regionId;
- bool m_notifyRegion;
+
+ bool m_snapToLines : 1;
+ bool m_displayTreeShouldChange : 1;
+ bool m_notifyRegion : 1;
};
inline VTTCue* toVTTCue(TextTrackCue* cue)