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

Unified Diff: Source/core/fetch/ResourceFetcher.cpp

Issue 25519002: Adding ASSERT for RuntimeEnabled feature XSLT (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review comments addressed. Created 7 years, 2 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 | « no previous file | Source/core/fetch/XSLStyleSheetResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index 8b03bb6589ec488ce49110e97efdd8acfd7653de..6a9b540f6da0aa0f678e234d3f9335eccdec76c7 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -27,6 +27,7 @@
#include "config.h"
#include "core/fetch/ResourceFetcher.h"
+#include "RuntimeEnabledFeatures.h"
#include "bindings/v8/ScriptController.h"
#include "core/dom/Document.h"
#include "core/fetch/CSSStyleSheetResource.h"
@@ -125,6 +126,7 @@ static ResourceLoadPriority loadPriority(Resource::Type type, const FetchRequest
case Resource::Image:
return request.forPreload() ? ResourceLoadPriorityVeryLow : ResourceLoadPriorityLow;
case Resource::XSLStyleSheet:
+ ASSERT(RuntimeEnabledFeatures::xsltEnabled());
return ResourceLoadPriorityHigh;
case Resource::SVGDocument:
return ResourceLoadPriorityLow;
@@ -298,6 +300,7 @@ ResourcePtr<ScriptResource> ResourceFetcher::fetchScript(FetchRequest& request)
ResourcePtr<XSLStyleSheetResource> ResourceFetcher::fetchXSLStyleSheet(FetchRequest& request)
{
+ ASSERT(RuntimeEnabledFeatures::xsltEnabled());
return static_cast<XSLStyleSheetResource*>(requestResource(Resource::XSLStyleSheet, request).get());
}
@@ -327,8 +330,9 @@ bool ResourceFetcher::checkInsecureContent(Resource::Type type, const KURL& url,
{
if (treatment == TreatAsDefaultForType) {
switch (type) {
- case Resource::Script:
case Resource::XSLStyleSheet:
+ ASSERT(RuntimeEnabledFeatures::xsltEnabled());
+ case Resource::Script:
case Resource::SVGDocument:
case Resource::CSSStyleSheet:
case Resource::ImportResource:
@@ -405,8 +409,9 @@ bool ResourceFetcher::canRequest(Resource::Type type, const KURL& url, const Res
return false;
}
break;
- case Resource::SVGDocument:
case Resource::XSLStyleSheet:
+ ASSERT(RuntimeEnabledFeatures::xsltEnabled());
+ case Resource::SVGDocument:
if (!m_document->securityOrigin()->canRequest(url)) {
printAccessDeniedMessage(url);
return false;
@@ -416,6 +421,7 @@ bool ResourceFetcher::canRequest(Resource::Type type, const KURL& url, const Res
switch (type) {
case Resource::XSLStyleSheet:
+ ASSERT(RuntimeEnabledFeatures::xsltEnabled());
if (!shouldBypassMainWorldContentSecurityPolicy && !m_document->contentSecurityPolicy()->allowScriptFromSource(url))
return false;
break;
@@ -619,8 +625,9 @@ void ResourceFetcher::determineTargetType(ResourceRequest& request, Resource::Ty
else
targetType = ResourceRequest::TargetIsMainFrame;
break;
- case Resource::CSSStyleSheet:
case Resource::XSLStyleSheet:
+ ASSERT(RuntimeEnabledFeatures::xsltEnabled());
+ case Resource::CSSStyleSheet:
targetType = ResourceRequest::TargetIsStyleSheet;
break;
case Resource::Script:
« no previous file with comments | « no previous file | Source/core/fetch/XSLStyleSheetResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698