| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 namespace blink { | 5 namespace blink { |
| 6 | 6 |
| 7 // Note: do not add any copy or move constructors to this class: doing so will | 7 // Note: do not add any copy or move constructors to this class: doing so will |
| 8 // break test coverage that we don't clobber the class name by trying to emit | 8 // break test coverage that we don't clobber the class name by trying to emit |
| 9 // replacements for synthesized functions. | 9 // replacements for synthesized functions. |
| 10 class C { | 10 class C { |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 private: | 138 private: |
| 139 // Okay to rename |isGarbageCollected| to |kIsGarbageCollected|. | 139 // Okay to rename |isGarbageCollected| to |kIsGarbageCollected|. |
| 140 static const bool kIsGarbageCollected = true; | 140 static const bool kIsGarbageCollected = true; |
| 141 | 141 |
| 142 public: | 142 public: |
| 143 // Expecting no rename of |value|. | 143 // Expecting no rename of |value|. |
| 144 static const LifetimeManagementType value = | 144 static const LifetimeManagementType value = |
| 145 !kIsGarbageCollected ? kRefCountedLifetime : kGarbageCollectedLifetime; | 145 !kIsGarbageCollected ? kRefCountedLifetime : kGarbageCollectedLifetime; |
| 146 }; | 146 }; |
| 147 | 147 |
| 148 template <typename T> |
| 149 struct GenericHashTraitsBase { |
| 150 // We don't want to capitalize fields in type traits |
| 151 // (i.e. the |value| -> |kValue| rename is undesirable below). |
| 152 // This problem is prevented by IsCallee heuristic. |
| 153 static const int kWeakHandlingFlag = TypeTrait2<T>::value ? 123 : 456; |
| 154 }; |
| 155 |
| 148 }; // namespace WTF | 156 }; // namespace WTF |
| 149 | 157 |
| 150 void F() { | 158 void F() { |
| 151 // Test that references to a static field are correctly rewritten. | 159 // Test that references to a static field are correctly rewritten. |
| 152 blink::C::instance_count_++; | 160 blink::C::instance_count_++; |
| 153 // Force instantiation of a copy constructor for blink::C to make sure field | 161 // Force instantiation of a copy constructor for blink::C to make sure field |
| 154 // initializers for synthesized functions don't cause weird rewrites. | 162 // initializers for synthesized functions don't cause weird rewrites. |
| 155 blink::C c; | 163 blink::C c; |
| 156 blink::C c2 = c; | 164 blink::C c2 = c; |
| 157 | 165 |
| 158 bool b1 = WTF::TypeTrait1::value; | 166 bool b1 = WTF::TypeTrait1::value; |
| 159 bool b2 = WTF::TypeTrait2<void>::value; | 167 bool b2 = WTF::TypeTrait2<void>::value; |
| 160 } | 168 } |
| OLD | NEW |