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

Side by Side Diff: dm/DM.cpp

Issue 1806903002: Split uninteresting hash lines correctly on Windows. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « no previous file | 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 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "CrashHandler.h" 8 #include "CrashHandler.h"
9 #include "DMJsonWriter.h" 9 #include "DMJsonWriter.h"
10 #include "DMSrcSink.h" 10 #include "DMSrcSink.h"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 SkString path(FLAGS_readPath[0]); 255 SkString path(FLAGS_readPath[0]);
256 path.append("/dm.json"); 256 path.append("/dm.json");
257 if (!JsonWriter::ReadJson(path.c_str(), add_gold)) { 257 if (!JsonWriter::ReadJson(path.c_str(), add_gold)) {
258 fail(SkStringPrintf("Couldn't read %s for golden results.", path.c_s tr())); 258 fail(SkStringPrintf("Couldn't read %s for golden results.", path.c_s tr()));
259 } 259 }
260 } 260 }
261 } 261 }
262 262
263 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/ 263 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/
264 264
265 #if defined(SK_BUILD_FOR_WIN32)
266 static const char* kNewline = "\r\n";
267 #else
268 static const char* kNewline = "\n";
269 #endif
270
265 static SkTHashSet<SkString> gUninterestingHashes; 271 static SkTHashSet<SkString> gUninterestingHashes;
266 272
267 static void gather_uninteresting_hashes() { 273 static void gather_uninteresting_hashes() {
268 if (!FLAGS_uninterestingHashesFile.isEmpty()) { 274 if (!FLAGS_uninterestingHashesFile.isEmpty()) {
269 SkAutoTUnref<SkData> data(SkData::NewFromFileName(FLAGS_uninterestingHas hesFile[0])); 275 SkAutoTUnref<SkData> data(SkData::NewFromFileName(FLAGS_uninterestingHas hesFile[0]));
270 if (!data) { 276 if (!data) {
271 info("WARNING: unable to read uninteresting hashes from %s\n", 277 info("WARNING: unable to read uninteresting hashes from %s\n",
272 FLAGS_uninterestingHashesFile[0]); 278 FLAGS_uninterestingHashesFile[0]);
273 return; 279 return;
274 } 280 }
275 SkTArray<SkString> hashes; 281 SkTArray<SkString> hashes;
276 SkStrSplit((const char*)data->data(), "\n", &hashes); 282 SkStrSplit((const char*)data->data(), kNewline, &hashes);
277 for (const SkString& hash : hashes) { 283 for (const SkString& hash : hashes) {
278 gUninterestingHashes.add(hash); 284 gUninterestingHashes.add(hash);
279 } 285 }
280 info("FYI: loaded %d distinct uninteresting hashes from %d lines\n", 286 info("FYI: loaded %d distinct uninteresting hashes from %d lines\n",
281 gUninterestingHashes.count(), hashes.count()); 287 gUninterestingHashes.count(), hashes.count());
282 } 288 }
283 } 289 }
284 290
285 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/ 291 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~*/
286 292
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 Reporter* reporter, 1486 Reporter* reporter,
1481 GrContextFactory* fac tory); 1487 GrContextFactory* fac tory);
1482 } // namespace skiatest 1488 } // namespace skiatest
1483 1489
1484 #if !defined(SK_BUILD_FOR_IOS) 1490 #if !defined(SK_BUILD_FOR_IOS)
1485 int main(int argc, char** argv) { 1491 int main(int argc, char** argv) {
1486 SkCommandLineFlags::Parse(argc, argv); 1492 SkCommandLineFlags::Parse(argc, argv);
1487 return dm_main(); 1493 return dm_main();
1488 } 1494 }
1489 #endif 1495 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698