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

Side by Side Diff: ios/net/clients/crn_forwarding_network_client_factory_unittest.mm

Issue 1242023005: Remove legacy StartsWithASCII function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: y Created 5 years, 5 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 | « ios/chrome/browser/experimental_flags.mm ('k') | media/base/android/media_codec_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #import <Foundation/Foundation.h> 5 #import <Foundation/Foundation.h>
6 #import <objc/runtime.h> 6 #import <objc/runtime.h>
7 7
8 #include "base/mac/scoped_nsobject.h" 8 #include "base/mac/scoped_nsobject.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 // Look at every known class and find those that are subclasses of 135 // Look at every known class and find those that are subclasses of
136 // |factory_superclass|. 136 // |factory_superclass|.
137 int class_count = objc_getClassList(nullptr, 0); 137 int class_count = objc_getClassList(nullptr, 0);
138 Class* classes = nullptr; 138 Class* classes = nullptr;
139 classes = static_cast<Class*>(malloc(sizeof(Class) * class_count)); 139 classes = static_cast<Class*>(malloc(sizeof(Class) * class_count));
140 class_count = objc_getClassList(classes, class_count); 140 class_count = objc_getClassList(classes, class_count);
141 141
142 for (NSInteger i = 0; i < class_count; i++) { 142 for (NSInteger i = 0; i < class_count; i++) {
143 std::string class_name = class_getName(classes[i]); 143 std::string class_name = class_getName(classes[i]);
144 // Skip the test classes defined above. 144 // Skip the test classes defined above.
145 if (base::StartsWithASCII(class_name, "TestFactory", false)) 145 if (base::StartsWith(class_name, "TestFactory",
146 base::CompareCase::INSENSITIVE_ASCII))
146 continue; 147 continue;
147 148
148 Class subclass_super = classes[i]; 149 Class subclass_super = classes[i];
149 int subclassing_count = 0; 150 int subclassing_count = 0;
150 // Walk up the class hiererchy from |classes[i]| to |factory_superclass|. 151 // Walk up the class hiererchy from |classes[i]| to |factory_superclass|.
151 do { 152 do {
152 subclass_super = class_getSuperclass(subclass_super); 153 subclass_super = class_getSuperclass(subclass_super);
153 subclassing_count++; 154 subclassing_count++;
154 } while (subclass_super && subclass_super != factory_superclass); 155 } while (subclass_super && subclass_super != factory_superclass);
155 156
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 ASSERT_NE(0u, [subclass_implementations count]) 212 ASSERT_NE(0u, [subclass_implementations count])
212 << class_name 213 << class_name
213 << " does not implement any required clientHandling methods."; 214 << " does not implement any required clientHandling methods.";
214 ASSERT_EQ(1u, [subclass_implementations count]) 215 ASSERT_EQ(1u, [subclass_implementations count])
215 << class_name << " implements too many superclass methods (" 216 << class_name << " implements too many superclass methods ("
216 << method_list << ")."; 217 << method_list << ").";
217 } 218 }
218 219
219 free(classes); 220 free(classes);
220 } 221 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/experimental_flags.mm ('k') | media/base/android/media_codec_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698