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

Unified Diff: content/child/blink_platform_impl.cc

Issue 1700233003: [WIP][SVG 2/4] Make data URL handling in ResourceFetcher and WebURLLoaderImpl consistent Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: auto-Rebase Created 4 years, 9 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
« no previous file with comments | « content/child/blink_platform_impl.h ('k') | content/child/web_url_loader_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/blink_platform_impl.cc
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index 6474a7f8741570ee5ae6e789be4967cf5af72759..042a5dc9d6d6f65e9eda60be695065a8795aba85 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -432,17 +432,25 @@ WebString BlinkPlatformImpl::userAgent() {
return user_agent;
}
-WebData BlinkPlatformImpl::parseDataURL(const WebURL& url,
- WebString& mimetype_out,
- WebString& charset_out) {
+bool BlinkPlatformImpl::parseDataURLIfCanBeHandledLocally(
+ const blink::WebURLRequest& request,
+ WebString& mimetype_out,
+ WebString& charset_out,
+ WebData& data_out) {
+ // |resource_dispatcher_exists| is a workaround for RenderViewImplTest
+ // (https://crbug.com/187500). We set it to |true| when used from Blink.
+ if (!WebURLLoaderImpl::CanHandleDataURLRequestLocally(request, true))
+ return false;
+
std::string mime_type, char_set, data;
- if (net::DataURL::Parse(url, &mime_type, &char_set, &data) &&
- mime_util::IsSupportedMimeType(mime_type)) {
+ if (net::DataURL::Parse(request.url(), &mime_type, &char_set, &data)) {
mimetype_out = WebString::fromUTF8(mime_type);
charset_out = WebString::fromUTF8(char_set);
- return data;
+ data_out = data;
+ } else {
+ data_out = WebData();
}
- return WebData();
+ return true;
}
WebURLError BlinkPlatformImpl::cancelledError(
« no previous file with comments | « content/child/blink_platform_impl.h ('k') | content/child/web_url_loader_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698