Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Side by Side Diff: tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc

Issue 2601063002: Blacklisting of method names coming from std library. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 256 // https://crbug.com/677166: We blacklist renaming of |hash|, because it
257 // collides with a struct named Hash. Blacklisting therefore should be broad 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. 258 // and should cover both instance and static methods as well as functions.
259 int hash() const { return 123; } 259 int hash() const { return 123; }
260 static int hash(const Foo& x) { return x.hash(); } 260 static int hash(const Foo& x) { return x.hash(); }
261
262 // https://crbug.com672902: std-like names should not be rewritten.
263 void emplace_back(int x) {}
264 void push_back(int x) {}
265 int* back() { return nullptr; }
266 int* front() { return nullptr; }
267 void erase() {}
268 bool empty() { return true; }
261 }; 269 };
262 270
263 void Begin(int x) {} 271 void Begin(int x) {}
264 int hash(int x) { 272 int hash(int x) {
265 return 123 * x; 273 return 123 * x;
266 } 274 }
267 void swap(Foo& x, Foo& y) {} 275 void swap(Foo& x, Foo& y) {}
268 276
269 } // blacklisting_of_method_and_function_names 277 } // blacklisting_of_method_and_function_names
270 278
(...skipping 29 matching lines...) Expand all
300 static void Method(); 308 static void Method();
301 }; 309 };
302 310
303 } // namespace internal 311 } // namespace internal
304 312
305 } // namespace blink 313 } // namespace blink
306 314
307 // https://crbug.com/640688 - need to rewrite method name below. 315 // https://crbug.com/640688 - need to rewrite method name below.
308 void blink::ClassDeclaredInsideBlink::MethodDefinedOutsideBlink() {} 316 void blink::ClassDeclaredInsideBlink::MethodDefinedOutsideBlink() {}
309 void blink::internal::InternalClass::Method() {} 317 void blink::internal::InternalClass::Method() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698