Commit 8910d08f authored by servolk@chromium.org's avatar servolk@chromium.org

Fix handling of media files in InspectorFileSystemAgent

Here is the piece of code that categorizes various file types:
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/modules/filesystem/InspectorFileSystemAgent.cpp&rcl=1424812033&l=280
Note that it doesn't handle media (audio/video, e.g. "audio/mp3",
"video/mp4" and so on) types explicitly. Currently
MIMETypeRegistry::isSupportedNonImageMIMEType will return true for
supported media types, and that will cause media files to be reported
as ResourceType::Document and we'll do
entryForFrontend->setIsTextFile(true) for media files as well.

BUG=462329

Review URL: https://codereview.chromium.org/960333002

git-svn-id: svn://svn.chromium.org/blink/trunk@200949 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 5312f6f0
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment