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

Unified Diff: content/test/fuzzer/clear_site_data_fuzzer.cc

Issue 2368923003: Support the Clear-Site-Data header on resource requests (Closed)
Patch Set: Rebase. Created 3 years, 7 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: content/test/fuzzer/clear_site_data_fuzzer.cc
diff --git a/content/test/fuzzer/clear_site_data_fuzzer.cc b/content/test/fuzzer/clear_site_data_fuzzer.cc
index a0cc6b27648eabc9620a94ff0b356cc11710c68b..e242c2d6d7ba90c6148db8db6e11b2c2510be3f3 100644
--- a/content/test/fuzzer/clear_site_data_fuzzer.cc
+++ b/content/test/fuzzer/clear_site_data_fuzzer.cc
@@ -10,28 +10,18 @@
namespace content {
-class ClearSiteDataFuzzerTest {
- public:
- ClearSiteDataFuzzerTest() : throttle_(nullptr) {}
-
- void TestHeader(const std::string& header) {
- bool remove_cookies;
- bool remove_storage;
- bool remove_cache;
- std::vector<content::ClearSiteDataThrottle::ConsoleMessage> messages;
-
- throttle_.ParseHeader(header, &remove_cookies, &remove_storage,
- &remove_cache, &messages);
- }
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ std::string header(reinterpret_cast<const char*>(data), size);
- private:
- content::ClearSiteDataThrottle throttle_;
-};
+ bool remove_cookies;
+ bool remove_storage;
+ bool remove_cache;
+ ClearSiteDataThrottle::ConsoleMessagesDelegate delegate_;
-ClearSiteDataFuzzerTest* test = new ClearSiteDataFuzzerTest();
+ content::ClearSiteDataThrottle::ParseHeader(header, &remove_cookies,
+ &remove_storage, &remove_cache,
+ &delegate_, GURL());
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
- test->TestHeader(std::string(reinterpret_cast<const char*>(data), size));
return 0;
}

Powered by Google App Engine
This is Rietveld 408576698