Repository navigation
Conversation
https://bugs.webkit.org/show_bug.cgi?id=327967 Reviewed by NOBODY (OOPS!). For file:// loads, NetworkDataTaskSoup::didGetFileInfo() chooses between the MIME type from the file's extension and the one GIO sniffed from its content with MIMETypeRegistry::canShowMIMEType(). For audio, video and application types that asks the media engines, which initializes GStreamer and reads its registry in the Network process: about 4 MB of memory and 10 ms of CPU for loading a file of an unknown type. Keep audio and video types from the extension as they are, and check other types without the media engines, with the new MIMETypeRegistry::canShowNonMediaMIMEType(). The extension's type is kept rather than the sniffed one because GIO sniffs Ogg files as subtypes such as audio/x-opus+ogg and video/x-theora+ogg, which GStreamer doesn't register. The Network process now release-asserts that it never initializes GStreamer. * Source/WebCore/platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::canShowMIMEType): (WebCore::MIMETypeRegistry::canShowNonMediaMIMEType): * Source/WebCore/platform/MIMETypeRegistry.h: * Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::ensureGStreamerInitializedNonWebProcess): * Source/WebKit/NetworkProcess/soup/NetworkDataTaskSoup.cpp: (WebKit::NetworkDataTaskSoup::didGetFileInfo):
Collaborator
|
EWS run on current version of this PR (hash 01ee1df) Details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
01ee1df
01ee1df