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

Unified Diff: third_party/WebKit/Source/core/fetch/ScriptResource.cpp

Issue 1706243002: Don't use SVG resource documents with an unrecognized MIME-type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/fetch/ScriptResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ScriptResource.cpp b/third_party/WebKit/Source/core/fetch/ScriptResource.cpp
index c85a6c747dbeba825b3fd7675610633fdb24d274..0c40defd3743dfee34504f066f715bbc395395cd 100644
--- a/third_party/WebKit/Source/core/fetch/ScriptResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/ScriptResource.cpp
@@ -32,7 +32,6 @@
#include "core/fetch/ResourceFetcher.h"
#include "platform/MIMETypeRegistry.h"
#include "platform/SharedBuffer.h"
-#include "platform/network/HTTPParsers.h"
#include "public/platform/WebProcessMemoryDump.h"
namespace blink {
@@ -85,11 +84,6 @@ void ScriptResource::onMemoryDump(WebMemoryDumpLevelOfDetail levelOfDetail, WebP
memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllocatedObjectPoolName));
}
-AtomicString ScriptResource::mimeType() const
-{
- return extractMIMETypeFromMediaType(m_response.httpHeaderField(HTTPNames::Content_Type)).lower();
-}
-
const CompressibleString& ScriptResource::script()
{
ASSERT(!isPurgeable());
@@ -115,7 +109,7 @@ void ScriptResource::destroyDecodedDataForFailedRevalidation()
bool ScriptResource::mimeTypeAllowedByNosniff() const
{
- return parseContentTypeOptionsHeader(m_response.httpHeaderField(HTTPNames::X_Content_Type_Options)) != ContentTypeOptionsNosniff || MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimeType());
+ return parseContentTypeOptionsHeader(m_response.httpHeaderField(HTTPNames::X_Content_Type_Options)) != ContentTypeOptionsNosniff || MIMETypeRegistry::isSupportedJavaScriptMIMEType(httpContentType());
}
void ScriptResource::setIntegrityDisposition(ScriptIntegrityDisposition disposition)

Powered by Google App Engine
This is Rietveld 408576698