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

Side by Side Diff: Source/core/css/RuleSet.h

Issue 809823002: replace COMPILE_ASSERT with static assert in core/css/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « Source/core/css/CSSValue.cpp ('k') | Source/core/css/StylePropertySet.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 unsigned m_descendantSelectorIdentifierHashes[maximumIdentifierCount]; 113 unsigned m_descendantSelectorIdentifierHashes[maximumIdentifierCount];
114 }; 114 };
115 115
116 struct SameSizeAsRuleData { 116 struct SameSizeAsRuleData {
117 void* a; 117 void* a;
118 unsigned b; 118 unsigned b;
119 unsigned c; 119 unsigned c;
120 unsigned d[4]; 120 unsigned d[4];
121 }; 121 };
122 122
123 COMPILE_ASSERT(sizeof(RuleData) == sizeof(SameSizeAsRuleData), RuleData_should_s tay_small); 123 static_assert(sizeof(RuleData) == sizeof(SameSizeAsRuleData), "RuleData should s tay small");
124 124
125 class RuleSet : public NoBaseWillBeGarbageCollectedFinalized<RuleSet> { 125 class RuleSet : public NoBaseWillBeGarbageCollectedFinalized<RuleSet> {
126 WTF_MAKE_NONCOPYABLE(RuleSet); 126 WTF_MAKE_NONCOPYABLE(RuleSet);
127 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; 127 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
128 public: 128 public:
129 static PassOwnPtrWillBeRawPtr<RuleSet> create() { return adoptPtrWillBeNoop( new RuleSet); } 129 static PassOwnPtrWillBeRawPtr<RuleSet> create() { return adoptPtrWillBeNoop( new RuleSet); }
130 130
131 void addRulesFromSheet(StyleSheetContents*, const MediaQueryEvaluator&, AddR uleFlags = RuleHasNoSpecialState); 131 void addRulesFromSheet(StyleSheetContents*, const MediaQueryEvaluator&, AddR uleFlags = RuleHasNoSpecialState);
132 void addStyleRule(StyleRule*, AddRuleFlags); 132 void addStyleRule(StyleRule*, AddRuleFlags);
133 void addRule(StyleRule*, unsigned selectorIndex, AddRuleFlags); 133 void addRule(StyleRule*, unsigned selectorIndex, AddRuleFlags);
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 WillBeHeapVector<RuleData> m_allRules; 235 WillBeHeapVector<RuleData> m_allRules;
236 #endif 236 #endif
237 }; 237 };
238 238
239 } // namespace blink 239 } // namespace blink
240 240
241 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData); 241 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::RuleData);
242 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MinimalRuleData); 242 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MinimalRuleData);
243 243
244 #endif // RuleSet_h 244 #endif // RuleSet_h
OLDNEW
« no previous file with comments | « Source/core/css/CSSValue.cpp ('k') | Source/core/css/StylePropertySet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698