Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(671)

Unified Diff: third_party/WebKit/Source/core/style/ComputedStyle.cpp

Issue 2841413002: [DO NOT LAND] Find alignment of various data structures.
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/style/ComputedStyle.cpp
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index 6ffa36a18ecac80713d9b4ba8f05ea7370791bce..b0ed0f1560e1c4e6d488d12b1ac5efbdabf506f4 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -80,6 +80,76 @@ struct SameSizeAsComputedStyle : public RefCounted<SameSizeAsComputedStyle> {
void* data_ref_svg_style;
};
+/* Length */
+struct AlignmentSizeLength {
+ char v; /* aligned to float */
+ Length data;
+};
+static_assert(sizeof(AlignmentSizeLength) == sizeof(float) + sizeof(Length),
+ "Alignment of Length is incorrect");
+
+/* LengthBox */
+struct AlignmentSizeLengthBox {
+ char v; /* aligned to float */
+ LengthBox data;
+};
+static_assert(sizeof(AlignmentSizeLengthBox) ==
+ sizeof(float) + sizeof(LengthBox),
+ "Alignment of LengthBox is incorrect");
+
+/* Color */
+struct AlignmentSizeColor {
+ char v; /* aligned to unsigned */
+ Color data;
+};
+static_assert(sizeof(AlignmentSizeColor) == sizeof(unsigned) + sizeof(Color),
+ "Alignment of Color is incorrect");
+
+/* BorderValue */
+struct AlignmentSizeBorderValue {
+ char v; /* aligned to unsigned */
+ BorderValue data;
+};
+static_assert(sizeof(AlignmentSizeBorderValue) ==
+ sizeof(unsigned) + sizeof(BorderValue),
+ "Alignment of BorderValue is incorrect");
+
+/* NinePieceImage */
+struct AlignmentSizeNinePieceImage {
+ char v; /* aligned to void* */
+ NinePieceImage data;
+};
+static_assert(sizeof(AlignmentSizeNinePieceImage) ==
+ sizeof(void*) + sizeof(NinePieceImage),
+ "Alignment of NinePieceImage is incorrect");
+
+/* LengthSize */
+struct AlignmentSizeLengthSize {
+ char v; /* aligned to float */
+ LengthSize data;
+};
+static_assert(sizeof(AlignmentSizeLengthSize) ==
+ sizeof(float) + sizeof(LengthSize),
+ "Alignment of LengthSize is incorrect");
+
+/* BorderData */
+struct AlignmentSizeBorderData {
+ char v; /* aligned to void* */
+ BorderData data;
+};
+static_assert(sizeof(AlignmentSizeBorderData) ==
+ sizeof(void*) + sizeof(BorderData),
+ "Alignment of BorderData is incorrect");
+
+/* FillLayer */
+struct AlignmentSizeFillLayer {
+ char v; /* aligned to void* */
+ FillLayer data;
+};
+static_assert(sizeof(AlignmentSizeFillLayer) ==
+ sizeof(void*) + sizeof(FillLayer),
+ "Alignment of FillLayer is incorrect");
+
// If this assert fails, it means that size of ComputedStyle has changed. Please
// check that you really *do* what to increase the size of ComputedStyle, then
// update the SameSizeAsComputedStyle struct to match the updated storage of
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698