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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.h

Issue 2261873002: Add fuzzer for HTMLPreloadScanner (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add include 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2010 Google Inc. All Rights Reserved. 3 * Copyright (C) 2010 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 }; 57 };
58 58
59 struct CORE_EXPORT CachedDocumentParameters { 59 struct CORE_EXPORT CachedDocumentParameters {
60 USING_FAST_MALLOC(CachedDocumentParameters); 60 USING_FAST_MALLOC(CachedDocumentParameters);
61 public: 61 public:
62 static std::unique_ptr<CachedDocumentParameters> create(Document* document) 62 static std::unique_ptr<CachedDocumentParameters> create(Document* document)
63 { 63 {
64 return wrapUnique(new CachedDocumentParameters(document)); 64 return wrapUnique(new CachedDocumentParameters(document));
65 } 65 }
66 66
67 static std::unique_ptr<CachedDocumentParameters> create()
68 {
69 return wrapUnique(new CachedDocumentParameters);
70 }
71
67 bool doHtmlPreloadScanning; 72 bool doHtmlPreloadScanning;
68 bool doDocumentWritePreloadScanning; 73 bool doDocumentWritePreloadScanning;
69 Length defaultViewportMinWidth; 74 Length defaultViewportMinWidth;
70 bool viewportMetaZeroValuesQuirk; 75 bool viewportMetaZeroValuesQuirk;
71 bool viewportMetaEnabled; 76 bool viewportMetaEnabled;
72 ReferrerPolicy referrerPolicy; 77 ReferrerPolicy referrerPolicy;
73 78
74 private: 79 private:
75 explicit CachedDocumentParameters(Document*); 80 explicit CachedDocumentParameters(Document*);
81 CachedDocumentParameters() = default;
76 }; 82 };
77 83
78 class TokenPreloadScanner { 84 class TokenPreloadScanner {
79 WTF_MAKE_NONCOPYABLE(TokenPreloadScanner); USING_FAST_MALLOC(TokenPreloadSca nner); 85 WTF_MAKE_NONCOPYABLE(TokenPreloadScanner); USING_FAST_MALLOC(TokenPreloadSca nner);
80 public: 86 public:
81 TokenPreloadScanner(const KURL& documentURL, std::unique_ptr<CachedDocumentP arameters>, const MediaValuesCached::MediaValuesCachedData&); 87 TokenPreloadScanner(const KURL& documentURL, std::unique_ptr<CachedDocumentP arameters>, const MediaValuesCached::MediaValuesCachedData&);
82 ~TokenPreloadScanner(); 88 ~TokenPreloadScanner();
83 89
84 void scan(const HTMLToken&, const SegmentedString&, PreloadRequestStream& re quests, ViewportDescriptionWrapper*, bool* isCSPMetaTag); 90 void scan(const HTMLToken&, const SegmentedString&, PreloadRequestStream& re quests, ViewportDescriptionWrapper*, bool* isCSPMetaTag);
85 void scan(const CompactHTMLToken&, const SegmentedString&, PreloadRequestStr eam& requests, ViewportDescriptionWrapper*, bool* isCSPMetaTag, bool* likelyDocu mentWriteScript); 91 void scan(const CompactHTMLToken&, const SegmentedString&, PreloadRequestStr eam& requests, ViewportDescriptionWrapper*, bool* isCSPMetaTag, bool* likelyDocu mentWriteScript);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 173
168 TokenPreloadScanner m_scanner; 174 TokenPreloadScanner m_scanner;
169 SegmentedString m_source; 175 SegmentedString m_source;
170 HTMLToken m_token; 176 HTMLToken m_token;
171 std::unique_ptr<HTMLTokenizer> m_tokenizer; 177 std::unique_ptr<HTMLTokenizer> m_tokenizer;
172 }; 178 };
173 179
174 } // namespace blink 180 } // namespace blink
175 181
176 #endif 182 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/BUILD.gn ('k') | third_party/WebKit/Source/core/html/parser/HTMLPreloadScannerFuzzer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698