| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "core/MediaTypeNames.h" | 5 #include "core/MediaTypeNames.h" |
| 6 #include "core/css/MediaValuesCached.h" | 6 #include "core/css/MediaValuesCached.h" |
| 7 #include "core/html/HTMLDocument.h" | 7 #include "core/html/HTMLDocument.h" |
| 8 #include "core/html/parser/HTMLDocumentParser.h" | 8 #include "core/html/parser/HTMLDocumentParser.h" |
| 9 #include "core/html/parser/ResourcePreloader.h" | 9 #include "core/html/parser/ResourcePreloader.h" |
| 10 #include "core/html/parser/TextResourceDecoderForFuzzing.h" | 10 #include "core/html/parser/TextResourceDecoderForFuzzing.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 mediaData.displayMode = WebDisplayModeBrowser; | 60 mediaData.displayMode = WebDisplayModeBrowser; |
| 61 | 61 |
| 62 MockResourcePreloader preloader; | 62 MockResourcePreloader preloader; |
| 63 | 63 |
| 64 std::unique_ptr<HTMLPreloadScanner> scanner = HTMLPreloadScanner::create(opt
ions, documentURL, std::move(documentParameters), mediaData); | 64 std::unique_ptr<HTMLPreloadScanner> scanner = HTMLPreloadScanner::create(opt
ions, documentURL, std::move(documentParameters), mediaData); |
| 65 | 65 |
| 66 TextResourceDecoderForFuzzing decoder(fuzzedData); | 66 TextResourceDecoderForFuzzing decoder(fuzzedData); |
| 67 CString bytes = fuzzedData.ConsumeRemainingBytes(); | 67 CString bytes = fuzzedData.ConsumeRemainingBytes(); |
| 68 String decodedBytes = decoder.decode(bytes.data(), bytes.length()); | 68 String decodedBytes = decoder.decode(bytes.data(), bytes.length()); |
| 69 scanner->appendToEnd(decodedBytes); | 69 scanner->appendToEnd(decodedBytes); |
| 70 scanner->scanAndPreload(&preloader, KURL(), nullptr); | 70 scanner->scanAndPreload(&preloader, documentURL, nullptr); |
| 71 return 0; | 71 return 0; |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace blink | 74 } // namespace blink |
| 75 | 75 |
| 76 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) | 76 extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) |
| 77 { | 77 { |
| 78 return blink::LLVMFuzzerTestOneInput(data, size); | 78 return blink::LLVMFuzzerTestOneInput(data, size); |
| 79 } | 79 } |
| 80 | 80 |
| 81 extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) | 81 extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) |
| 82 { | 82 { |
| 83 blink::InitializeBlinkFuzzTest(argc, argv); | 83 blink::InitializeBlinkFuzzTest(argc, argv); |
| 84 return 0; | 84 return 0; |
| 85 } | 85 } |
| OLD | NEW |