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