| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 Google Inc. All rights reserved. | 2 * Copyright (c) 2010 Google Inc. All rights reserved. |
| 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 DEFINE_INLINE_TRACE() { visitor->trace(range); } | 62 DEFINE_INLINE_TRACE() { visitor->trace(range); } |
| 63 | 63 |
| 64 String name; | 64 String name; |
| 65 String value; | 65 String value; |
| 66 bool important; | 66 bool important; |
| 67 bool disabled; | 67 bool disabled; |
| 68 bool parsedOk; | 68 bool parsedOk; |
| 69 SourceRange range; | 69 SourceRange range; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 struct CSSStyleSourceData : public RefCountedWillBeGarbageCollected<CSSStyleSour
ceData> { | 72 struct CSSStyleSourceData : public GarbageCollected<CSSStyleSourceData> { |
| 73 static PassRefPtrWillBeRawPtr<CSSStyleSourceData> create() | 73 static RawPtr<CSSStyleSourceData> create() |
| 74 { | 74 { |
| 75 return adoptRefWillBeNoop(new CSSStyleSourceData()); | 75 return (new CSSStyleSourceData()); |
| 76 } | 76 } |
| 77 | 77 |
| 78 DEFINE_INLINE_TRACE() | 78 DEFINE_INLINE_TRACE() |
| 79 { | 79 { |
| 80 #if ENABLE(OILPAN) | 80 #if ENABLE(OILPAN) |
| 81 visitor->trace(propertyData); | 81 visitor->trace(propertyData); |
| 82 #endif | 82 #endif |
| 83 } | 83 } |
| 84 | 84 |
| 85 WillBeHeapVector<CSSPropertySourceData> propertyData; | 85 HeapVector<CSSPropertySourceData> propertyData; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 struct CSSMediaQueryExpSourceData { | 88 struct CSSMediaQueryExpSourceData { |
| 89 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 89 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 90 public: | 90 public: |
| 91 CSSMediaQueryExpSourceData(const SourceRange& valueRange) | 91 CSSMediaQueryExpSourceData(const SourceRange& valueRange) |
| 92 : valueRange(valueRange) { } | 92 : valueRange(valueRange) { } |
| 93 | 93 |
| 94 DEFINE_INLINE_TRACE() { visitor->trace(valueRange); } | 94 DEFINE_INLINE_TRACE() { visitor->trace(valueRange); } |
| 95 | 95 |
| 96 SourceRange valueRange; | 96 SourceRange valueRange; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 struct CSSMediaQuerySourceData : public RefCountedWillBeGarbageCollected<CSSMedi
aQuerySourceData> { | 99 struct CSSMediaQuerySourceData : public GarbageCollected<CSSMediaQuerySourceData
> { |
| 100 static PassRefPtrWillBeRawPtr<CSSMediaQuerySourceData> create() | 100 static RawPtr<CSSMediaQuerySourceData> create() |
| 101 { | 101 { |
| 102 return adoptRefWillBeNoop(new CSSMediaQuerySourceData()); | 102 return (new CSSMediaQuerySourceData()); |
| 103 } | 103 } |
| 104 | 104 |
| 105 DEFINE_INLINE_TRACE() | 105 DEFINE_INLINE_TRACE() |
| 106 { | 106 { |
| 107 #if ENABLE(OILPAN) | 107 #if ENABLE(OILPAN) |
| 108 visitor->trace(expData); | 108 visitor->trace(expData); |
| 109 #endif | 109 #endif |
| 110 } | 110 } |
| 111 | 111 |
| 112 WillBeHeapVector<CSSMediaQueryExpSourceData> expData; | 112 HeapVector<CSSMediaQueryExpSourceData> expData; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 struct CSSMediaSourceData : public RefCountedWillBeGarbageCollected<CSSMediaSour
ceData> { | 115 struct CSSMediaSourceData : public GarbageCollected<CSSMediaSourceData> { |
| 116 static PassRefPtrWillBeRawPtr<CSSMediaSourceData> create() | 116 static RawPtr<CSSMediaSourceData> create() |
| 117 { | 117 { |
| 118 return adoptRefWillBeNoop(new CSSMediaSourceData()); | 118 return (new CSSMediaSourceData()); |
| 119 } | 119 } |
| 120 | 120 |
| 121 DEFINE_INLINE_TRACE() | 121 DEFINE_INLINE_TRACE() |
| 122 { | 122 { |
| 123 #if ENABLE(OILPAN) | 123 #if ENABLE(OILPAN) |
| 124 visitor->trace(queryData); | 124 visitor->trace(queryData); |
| 125 #endif | 125 #endif |
| 126 } | 126 } |
| 127 | 127 |
| 128 WillBeHeapVector<RefPtrWillBeMember<CSSMediaQuerySourceData>> queryData; | 128 HeapVector<Member<CSSMediaQuerySourceData>> queryData; |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 struct CSSRuleSourceData; | 131 struct CSSRuleSourceData; |
| 132 using RuleSourceDataList = WillBeHeapVector<RefPtrWillBeMember<CSSRuleSourceData
>>; | 132 using RuleSourceDataList = HeapVector<Member<CSSRuleSourceData>>; |
| 133 using SelectorRangeList = WillBeHeapVector<SourceRange>; | 133 using SelectorRangeList = HeapVector<SourceRange>; |
| 134 | 134 |
| 135 struct CSSRuleSourceData : public RefCountedWillBeGarbageCollected<CSSRuleSource
Data> { | 135 struct CSSRuleSourceData : public GarbageCollected<CSSRuleSourceData> { |
| 136 static PassRefPtrWillBeRawPtr<CSSRuleSourceData> create(StyleRule::Type type
) | 136 static RawPtr<CSSRuleSourceData> create(StyleRule::Type type) |
| 137 { | 137 { |
| 138 return adoptRefWillBeNoop(new CSSRuleSourceData(type)); | 138 return (new CSSRuleSourceData(type)); |
| 139 } | 139 } |
| 140 | 140 |
| 141 CSSRuleSourceData(StyleRule::Type type) | 141 CSSRuleSourceData(StyleRule::Type type) |
| 142 : type(type) | 142 : type(type) |
| 143 { | 143 { |
| 144 if (type == StyleRule::Style || type == StyleRule::FontFace || type == S
tyleRule::Page || type == StyleRule::Keyframe) | 144 if (type == StyleRule::Style || type == StyleRule::FontFace || type == S
tyleRule::Page || type == StyleRule::Keyframe) |
| 145 styleSourceData = CSSStyleSourceData::create(); | 145 styleSourceData = CSSStyleSourceData::create(); |
| 146 if (type == StyleRule::Media || type == StyleRule::Import) | 146 if (type == StyleRule::Media || type == StyleRule::Import) |
| 147 mediaSourceData = CSSMediaSourceData::create(); | 147 mediaSourceData = CSSMediaSourceData::create(); |
| 148 } | 148 } |
| 149 | 149 |
| 150 DECLARE_TRACE(); | 150 DECLARE_TRACE(); |
| 151 | 151 |
| 152 StyleRule::Type type; | 152 StyleRule::Type type; |
| 153 | 153 |
| 154 // Range of the selector list in the enclosing source. | 154 // Range of the selector list in the enclosing source. |
| 155 SourceRange ruleHeaderRange; | 155 SourceRange ruleHeaderRange; |
| 156 | 156 |
| 157 // Range of the rule body (e.g. style text for style rules) in the enclosing
source. | 157 // Range of the rule body (e.g. style text for style rules) in the enclosing
source. |
| 158 SourceRange ruleBodyRange; | 158 SourceRange ruleBodyRange; |
| 159 | 159 |
| 160 // Only for CSSStyleRules. | 160 // Only for CSSStyleRules. |
| 161 SelectorRangeList selectorRanges; | 161 SelectorRangeList selectorRanges; |
| 162 | 162 |
| 163 // Only for CSSStyleRules, CSSFontFaceRules, and CSSPageRules. | 163 // Only for CSSStyleRules, CSSFontFaceRules, and CSSPageRules. |
| 164 RefPtrWillBeMember<CSSStyleSourceData> styleSourceData; | 164 Member<CSSStyleSourceData> styleSourceData; |
| 165 | 165 |
| 166 // Only for CSSMediaRules. | 166 // Only for CSSMediaRules. |
| 167 RuleSourceDataList childRules; | 167 RuleSourceDataList childRules; |
| 168 | 168 |
| 169 // Only for CSSMediaRules and CSSImportRules. | 169 // Only for CSSMediaRules and CSSImportRules. |
| 170 RefPtrWillBeMember<CSSMediaSourceData> mediaSourceData; | 170 Member<CSSMediaSourceData> mediaSourceData; |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 } // namespace blink | 173 } // namespace blink |
| 174 | 174 |
| 175 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::SourceRange); | 175 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::SourceRange); |
| 176 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSPropertySourceData); | 176 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSPropertySourceData); |
| 177 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSMediaQueryExpSourceData); | 177 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSMediaQueryExpSourceData); |
| 178 | 178 |
| 179 #endif // CSSPropertySourceData_h | 179 #endif // CSSPropertySourceData_h |
| OLD | NEW |