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

Unified Diff: third_party/WebKit/Source/platform/network/NetworkUtils.cpp

Issue 2702503002: Block renderer-initiated main frame navigations to data URLs (Closed)
Patch Set: Fix Android PDF tests where PDFs should be downloaded Created 3 years, 8 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: third_party/WebKit/Source/platform/network/NetworkUtils.cpp
diff --git a/third_party/WebKit/Source/platform/network/NetworkUtils.cpp b/third_party/WebKit/Source/platform/network/NetworkUtils.cpp
index 4f1358404eea48e28730c89629cf21c065cbc469..060fd655116e76a6153868c23ea31ead4936cf21 100644
--- a/third_party/WebKit/Source/platform/network/NetworkUtils.cpp
+++ b/third_party/WebKit/Source/platform/network/NetworkUtils.cpp
@@ -105,6 +105,16 @@ PassRefPtr<SharedBuffer> ParseDataURLAndPopulateResponse(
return data;
}
+bool IsDataURLMimeTypeSupported(const KURL& url) {
+ std::string utf8_mime_type;
+ std::string utf8_charset;
+ if (net::DataURL::Parse(WebStringToGURL(url.GetString()), &utf8_mime_type,
+ &utf8_charset, nullptr)) {
+ return mime_util::IsSupportedMimeType(utf8_mime_type);
+ }
+ return false;
+}
+
bool IsRedirectResponseCode(int response_code) {
return net::HttpResponseHeaders::IsRedirectResponseCode(response_code);
}
« no previous file with comments | « third_party/WebKit/Source/platform/network/NetworkUtils.h ('k') | third_party/WebKit/Source/web/LocalFrameClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698