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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSValue.cpp

Issue 2231953003: Added ASSERT_SIZE macro for checking size of size-sensitive classes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Andreas Kling (kling@webkit.org) 2 * Copyright (C) 2011 Andreas Kling (kling@webkit.org)
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 #include "core/css/CSSReflectValue.h" 55 #include "core/css/CSSReflectValue.h"
56 #include "core/css/CSSShadowValue.h" 56 #include "core/css/CSSShadowValue.h"
57 #include "core/css/CSSStringValue.h" 57 #include "core/css/CSSStringValue.h"
58 #include "core/css/CSSTimingFunctionValue.h" 58 #include "core/css/CSSTimingFunctionValue.h"
59 #include "core/css/CSSURIValue.h" 59 #include "core/css/CSSURIValue.h"
60 #include "core/css/CSSUnicodeRangeValue.h" 60 #include "core/css/CSSUnicodeRangeValue.h"
61 #include "core/css/CSSUnsetValue.h" 61 #include "core/css/CSSUnsetValue.h"
62 #include "core/css/CSSValueList.h" 62 #include "core/css/CSSValueList.h"
63 #include "core/css/CSSValuePair.h" 63 #include "core/css/CSSValuePair.h"
64 #include "core/css/CSSVariableReferenceValue.h" 64 #include "core/css/CSSVariableReferenceValue.h"
65 #include "wtf/SizeAssertions.h"
65 66
66 namespace blink { 67 namespace blink {
67 68
68 struct SameSizeAsCSSValue : public GarbageCollectedFinalized<SameSizeAsCSSValue> { 69 ASSERT_SIZE(CSSValue, 4, 8);
69 uint32_t bitfields;
70 };
71
72 static_assert(sizeof(CSSValue) <= sizeof(SameSizeAsCSSValue), "CSSValue should s tay small");
73 70
74 bool CSSValue::isImplicitInitialValue() const 71 bool CSSValue::isImplicitInitialValue() const
75 { 72 {
76 return m_classType == InitialClass && toCSSInitialValue(this)->isImplicit(); 73 return m_classType == InitialClass && toCSSInitialValue(this)->isImplicit();
77 } 74 }
78 75
79 bool CSSValue::hasFailedOrCanceledSubresources() const 76 bool CSSValue::hasFailedOrCanceledSubresources() const
80 { 77 {
81 if (isValueList()) 78 if (isValueList())
82 return toCSSValueList(this)->hasFailedOrCanceledSubresources(); 79 return toCSSValueList(this)->hasFailedOrCanceledSubresources();
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 toCSSCustomPropertyDeclaration(this)->traceAfterDispatch(visitor); 662 toCSSCustomPropertyDeclaration(this)->traceAfterDispatch(visitor);
666 return; 663 return;
667 case PendingSubstitutionValueClass: 664 case PendingSubstitutionValueClass:
668 toCSSPendingSubstitutionValue(this)->traceAfterDispatch(visitor); 665 toCSSPendingSubstitutionValue(this)->traceAfterDispatch(visitor);
669 return; 666 return;
670 } 667 }
671 ASSERT_NOT_REACHED(); 668 ASSERT_NOT_REACHED();
672 } 669 }
673 670
674 } // namespace blink 671 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/wtf/SizeAssertions.h » ('j') | third_party/WebKit/Source/wtf/SizeAssertions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698