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

Unified Diff: third_party/WebKit/Source/core/dom/ClassicScript.cpp

Issue 2724673002: [WIP] Introduce ScriptResourceData
Patch Set: Compile fix Created 3 years, 4 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/core/dom/ClassicScript.cpp
diff --git a/third_party/WebKit/Source/core/dom/ClassicScript.cpp b/third_party/WebKit/Source/core/dom/ClassicScript.cpp
index 701576205e511815e6b7f3be8ed1a5aa9e80c1f3..4f9e7d067b84dc34d96d0829875867c25048f959 100644
--- a/third_party/WebKit/Source/core/dom/ClassicScript.cpp
+++ b/third_party/WebKit/Source/core/dom/ClassicScript.cpp
@@ -17,7 +17,7 @@ namespace blink {
namespace {
void LogScriptMIMEType(LocalFrame* frame,
- ScriptResource* resource,
+ const ScriptResourceData* resource,
const String& mime_type,
const SecurityOrigin* security_origin) {
if (MIMETypeRegistry::IsSupportedJavaScriptMIMEType(mime_type))
@@ -53,21 +53,22 @@ DEFINE_TRACE(ClassicScript) {
bool ClassicScript::CheckMIMETypeBeforeRunScript(
Document* context_document,
const SecurityOrigin* security_origin) const {
- ScriptResource* resource = GetScriptSourceCode().GetResource();
+ const ScriptResourceData* resource = GetScriptSourceCode().GetResource();
CHECK(resource);
- if (!ScriptResource::MimeTypeAllowedByNosniff(resource->GetResponse())) {
+ if (!ScriptResourceData::MimeTypeAllowedByNosniff(resource->GetResponse())) {
context_document->AddConsoleMessage(ConsoleMessage::Create(
kSecurityMessageSource, kErrorMessageLevel,
"Refused to execute script from '" + resource->Url().ElidedString() +
- "' because its MIME type ('" + resource->HttpContentType() +
+ "' because its MIME type ('" +
+ resource->GetResponse().HttpContentType() +
"') is not executable, and "
"strict MIME type checking is "
"enabled."));
return false;
}
- String mime_type = resource->HttpContentType();
+ String mime_type = resource->GetResponse().HttpContentType();
LocalFrame* frame = context_document->GetFrame();
if (mime_type.StartsWith("image/") || mime_type == "text/csv" ||
mime_type.StartsWith("audio/") || mime_type.StartsWith("video/")) {

Powered by Google App Engine
This is Rietveld 408576698