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

Unified Diff: Source/modules/filesystem/InspectorFileSystemAgent.cpp

Issue 960333002: Fix handling of media files in InspectorFileSystemAgent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use HTMLMediaElement::supportsType instead of MIMETypeRegistry Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/filesystem/InspectorFileSystemAgent.cpp
diff --git a/Source/modules/filesystem/InspectorFileSystemAgent.cpp b/Source/modules/filesystem/InspectorFileSystemAgent.cpp
index bd2573263e90271126958bf6b0fb59c219ee8941..38c50bec454c2126feebf9947c7777f45bd7c939 100644
--- a/Source/modules/filesystem/InspectorFileSystemAgent.cpp
+++ b/Source/modules/filesystem/InspectorFileSystemAgent.cpp
@@ -41,6 +41,7 @@
#include "core/fileapi/FileError.h"
#include "core/fileapi/FileReader.h"
#include "core/frame/LocalFrame.h"
+#include "core/html/HTMLMediaElement.h"
#include "core/html/VoidCallback.h"
#include "core/html/parser/TextResourceDecoder.h"
#include "core/inspector/InspectorState.h"
@@ -58,6 +59,7 @@
#include "modules/filesystem/LocalFileSystem.h"
#include "modules/filesystem/Metadata.h"
#include "modules/filesystem/MetadataCallback.h"
+#include "platform/ContentType.h"
#include "platform/MIMETypeRegistry.h"
#include "platform/heap/Handle.h"
#include "platform/weborigin/KURL.h"
@@ -296,6 +298,9 @@ bool DirectoryContentRequest::didReadDirectoryEntries(const EntryHeapVector& ent
if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType)) {
resourceType = ResourceType::Image;
entryForFrontend->setIsTextFile(false);
+ } else if (HTMLMediaElement::supportsType(ContentType(mimeType)) != WebMimeRegistry::IsNotSupported) {
+ resourceType = ResourceType::Media;
+ entryForFrontend->setIsTextFile(false);
} else if (MIMETypeRegistry::isSupportedJavaScriptMIMEType(mimeType)) {
resourceType = ResourceType::Script;
entryForFrontend->setIsTextFile(true);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698