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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 // because Google C++ Styke Guide uses "Swap" in examples. | 250 // because Google C++ Styke Guide uses "Swap" in examples. |
251 void swap() {} | 251 void swap() {} |
252 static void swap(Foo& x, Foo& y) {} | 252 static void swap(Foo& x, Foo& y) {} |
253 | 253 |
254 // We don't rename |begin|, so that <algorithms> and other templates that | 254 // We don't rename |begin|, so that <algorithms> and other templates that |
255 // expect |begin|, |end|, etc. continue to work. This is only necessary | 255 // expect |begin|, |end|, etc. continue to work. This is only necessary |
256 // for instance methods - renaming static methods and funcitons is okay. | 256 // for instance methods - renaming static methods and funcitons is okay. |
257 void begin() {} | 257 void begin() {} |
258 static void begin(int x) {} | 258 static void begin(int x) {} |
259 | 259 |
260 // https://crbug.com/677166: We blacklist renaming of |hash|, because it | |
261 // collides with a struct named Hash. Blacklisting therefore should be broad | |
262 // and should cover both instance and static methods as well as functions. | |
263 int hash() const { return 123; } | |
264 static int hash(const Foo& x) { return x.hash(); } | |
265 | |
266 // https://crbug.com672902: std-like names should not be rewritten. | 260 // https://crbug.com672902: std-like names should not be rewritten. |
267 void emplace_back(int x) {} | 261 void emplace_back(int x) {} |
268 void insert(int x) {} | 262 void insert(int x) {} |
269 void push_back(int x) {} | 263 void push_back(int x) {} |
270 int* back() { return nullptr; } | 264 int* back() { return nullptr; } |
271 int* front() { return nullptr; } | 265 int* front() { return nullptr; } |
272 void erase() {} | 266 void erase() {} |
273 bool empty() { return true; } | 267 bool empty() { return true; } |
274 }; | 268 }; |
275 | 269 |
276 void begin(int x) {} | 270 void begin(int x) {} |
277 int hash(int x) { | |
278 return 123 * x; | |
279 } | |
280 void swap(Foo& x, Foo& y) {} | 271 void swap(Foo& x, Foo& y) {} |
281 | 272 |
282 } // blacklisting_of_method_and_function_names | 273 } // blacklisting_of_method_and_function_names |
283 | 274 |
284 } // namespace blink | 275 } // namespace blink |
285 | 276 |
286 namespace WTF { | 277 namespace WTF { |
287 | 278 |
288 struct StructInWTF { | 279 struct StructInWTF { |
289 // Structs in WTF should rename their methods to capitals. | 280 // Structs in WTF should rename their methods to capitals. |
(...skipping 23 matching lines...) Expand all Loading... |
313 static void method(); | 304 static void method(); |
314 }; | 305 }; |
315 | 306 |
316 } // namespace internal | 307 } // namespace internal |
317 | 308 |
318 } // namespace blink | 309 } // namespace blink |
319 | 310 |
320 // https://crbug.com/640688 - need to rewrite method name below. | 311 // https://crbug.com/640688 - need to rewrite method name below. |
321 void blink::ClassDeclaredInsideBlink::methodDefinedOutsideBlink() {} | 312 void blink::ClassDeclaredInsideBlink::methodDefinedOutsideBlink() {} |
322 void blink::internal::InternalClass::method() {} | 313 void blink::internal::InternalClass::method() {} |
OLD | NEW |