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 #include "gen/thing.h" | 5 #include "gen/thing.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 | 8 |
9 class InterfaceOutsideOfBlink { | 9 class InterfaceOutsideOfBlink { |
10 public: | 10 public: |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
174 struct StructInBlink { | 174 struct StructInBlink { |
175 // Structs in blink should rename their methods to capitals. | 175 // Structs in blink should rename their methods to capitals. |
176 bool function() { return true; } | 176 bool function() { return true; } |
177 }; | 177 }; |
178 | 178 |
179 class BitVector { | 179 class BitVector { |
180 public: | 180 public: |
181 class OutOfLineBits {}; | 181 class OutOfLineBits {}; |
182 enum Foo { Blah }; | 182 enum Foo { Blah }; |
183 struct Bar {}; | 183 struct Bar {}; |
184 class Baz {}; | |
185 | |
186 template <typename T> | |
187 class MyRefPtr {}; | |
184 | 188 |
185 // Naive renaming will break the build, by leaving return type the same | 189 // Naive renaming will break the build, by leaving return type the same |
186 // as method the name - to avoid this "Get" prefix needs to be prepended | 190 // as the method name - to avoid this "Get" prefix needs to be prepended |
187 // as suggested in https://crbug.com/582312#c17. | 191 // as suggested in https://crbug.com/582312#c17. |
188 const OutOfLineBits* outOfLineBits() const { return nullptr; } | 192 const OutOfLineBits* outOfLineBits() const { return nullptr; } |
189 Foo foo() { return Blah; } | 193 Foo foo() { return Blah; } |
190 const Bar& bar() const { return m_bar; } | 194 const Bar& bar() const { return m_bar; } |
195 MyRefPtr<Baz> baz() { return MyRefPtr<Baz>(); } | |
danakj
2016/09/08 23:30:40
does it work for "const MyRefPtr<Baz>&" also? add
Łukasz Anforowicz
2016/09/09 00:20:35
It works. I've added a test.
| |
191 | 196 |
192 private: | 197 private: |
193 Bar m_bar; | 198 Bar m_bar; |
194 }; | 199 }; |
195 | 200 |
196 } // namespace blink | 201 } // namespace blink |
197 | 202 |
198 namespace WTF { | 203 namespace WTF { |
199 | 204 |
200 struct StructInWTF { | 205 struct StructInWTF { |
(...skipping 24 matching lines...) Expand all Loading... | |
225 static void method(); | 230 static void method(); |
226 }; | 231 }; |
227 | 232 |
228 } // namespace internal | 233 } // namespace internal |
229 | 234 |
230 } // namespace blink | 235 } // namespace blink |
231 | 236 |
232 // https://crbug.com/640688 - need to rewrite method name below. | 237 // https://crbug.com/640688 - need to rewrite method name below. |
233 void blink::ClassDeclaredInsideBlink::methodDefinedOutsideBlink() {} | 238 void blink::ClassDeclaredInsideBlink::methodDefinedOutsideBlink() {} |
234 void blink::internal::InternalClass::method() {} | 239 void blink::internal::InternalClass::method() {} |
OLD | NEW |