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

Unified Diff: fuzz/fuzz.cpp

Issue 2206633004: Move off SK_SUPPORT_LEGACY_DATA_FACTORIES. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Gotta catch 'em all. Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: fuzz/fuzz.cpp
diff --git a/fuzz/fuzz.cpp b/fuzz/fuzz.cpp
index 4ca253343d2f1db222475eaacc653c5a3b2253cf..d2dc787dbefb623da521aff511f3eda7de3742c7 100644
--- a/fuzz/fuzz.cpp
+++ b/fuzz/fuzz.cpp
@@ -44,31 +44,31 @@ int main(int argc, char** argv) {
SkCommandLineFlags::Parse(argc, argv);
const char* path = FLAGS_bytes.isEmpty() ? argv[0] : FLAGS_bytes[0];
- SkAutoTUnref<SkData> bytes(SkData::NewFromFileName(path));
+ sk_sp<SkData> bytes(SkData::MakeFromFileName(path));
if (!bytes) {
SkDebugf("Could not read %s\n", path);
return 2;
}
- uint8_t option = calculate_option(bytes);
+ uint8_t option = calculate_option(bytes.get());
if (!FLAGS_type.isEmpty()) {
switch (FLAGS_type[0][0]) {
- case 'a': return fuzz_api(bytes);
+ case 'a': return fuzz_api(bytes.get());
- case 'c': return fuzz_color_deserialize(bytes);
+ case 'c': return fuzz_color_deserialize(bytes.get());
case 'i':
if (FLAGS_type[0][1] == 'c') { //icc
- return fuzz_icc(bytes);
+ return fuzz_icc(bytes.get());
}
// We only allow one degree of freedom to avoid a search space explosion for afl-fuzz.
if (FLAGS_type[0][6] == 's') { // image_scale
- return fuzz_img(bytes, option, 0);
+ return fuzz_img(bytes.get(), option, 0);
}
// image_mode
- return fuzz_img(bytes, 0, option);
- case 's': return fuzz_skp(bytes);
+ return fuzz_img(bytes.get(), 0, option);
+ case 's': return fuzz_skp(bytes.get());
}
}
return printUsage(argv[0]);

Powered by Google App Engine
This is Rietveld 408576698