Chromium Code Reviews| 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 a4b726bb84f2a249a71230d73ba758a2ca12581e..57cae06c770906b1f05d207d8a6c1343f8b7de44 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, |
|
kinuko
2017/05/18 05:43:30
ditto
|
| const String& mime_type, |
| const SecurityOrigin* security_origin) { |
| if (MIMETypeRegistry::IsSupportedJavaScriptMIMEType(mime_type)) |
| @@ -58,21 +58,22 @@ bool ClassicScript::IsEmpty() const { |
| 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/")) { |