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

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

Issue 2324643002: Prepending "Get" when type with conflicting name is hidden inside return type. (Closed)
Patch Set: Addressed CR feedback from danakj@. Created 4 years, 3 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
« no previous file with comments | « tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 class FooBar {};
186
187 template <typename T>
188 class MyRefPtr {};
184 189
185 // Naive renaming will break the build, by leaving return type the same 190 // 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 191 // as the method name - to avoid this "Get" prefix needs to be prepended
187 // as suggested in https://crbug.com/582312#c17. 192 // as suggested in https://crbug.com/582312#c17.
188 const OutOfLineBits* outOfLineBits() const { return nullptr; } 193 const OutOfLineBits* outOfLineBits() const { return nullptr; }
189 Foo foo() { return Blah; } 194 Foo foo() { return Blah; }
190 const Bar& bar() const { return m_bar; } 195 const Bar& bar() const { return m_bar; }
196 MyRefPtr<Baz> baz() { return MyRefPtr<Baz>(); }
197 const MyRefPtr<FooBar>& fooBar() { return foobar_; }
191 198
192 private: 199 private:
193 Bar m_bar; 200 Bar m_bar;
201 MyRefPtr<FooBar> foobar_;
194 }; 202 };
195 203
196 } // namespace blink 204 } // namespace blink
197 205
198 namespace WTF { 206 namespace WTF {
199 207
200 struct StructInWTF { 208 struct StructInWTF {
201 // Structs in WTF should rename their methods to capitals. 209 // Structs in WTF should rename their methods to capitals.
202 bool function() { return true; } 210 bool function() { return true; }
203 }; 211 };
(...skipping 21 matching lines...) Expand all
225 static void method(); 233 static void method();
226 }; 234 };
227 235
228 } // namespace internal 236 } // namespace internal
229 237
230 } // namespace blink 238 } // namespace blink
231 239
232 // https://crbug.com/640688 - need to rewrite method name below. 240 // https://crbug.com/640688 - need to rewrite method name below.
233 void blink::ClassDeclaredInsideBlink::methodDefinedOutsideBlink() {} 241 void blink::ClassDeclaredInsideBlink::methodDefinedOutsideBlink() {}
234 void blink::internal::InternalClass::method() {} 242 void blink::internal::InternalClass::method() {}
OLDNEW
« no previous file with comments | « tools/clang/rewrite_to_chrome_style/tests/methods-expected.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698