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

Unified Diff: third_party/WebKit/Source/platform/MIMETypeRegistry.h

Issue 2444873002: Move WebMIMERegistry impl from //content to blink:platform/network/mime (Closed)
Patch Set: remove indirection Created 4 years, 2 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/platform/MIMETypeRegistry.h
diff --git a/third_party/WebKit/Source/platform/MIMETypeRegistry.h b/third_party/WebKit/Source/platform/MIMETypeRegistry.h
index b7531f3d592a9d06a59d54ef0434311aac116990..2219007a5546e2c01528757167eaa6b8a1a2db08 100644
--- a/third_party/WebKit/Source/platform/MIMETypeRegistry.h
+++ b/third_party/WebKit/Source/platform/MIMETypeRegistry.h
@@ -34,56 +34,67 @@
namespace blink {
+// TODO(kinuko): Move this file under platform/network/mime.
class PLATFORM_EXPORT MIMETypeRegistry {
STATIC_ONLY(MIMETypeRegistry);
public:
+ // For Media MIME type checks.
+ enum SupportsType { IsNotSupported, IsSupported, MayBeSupported };
+
static String getMIMETypeForExtension(const String& extension);
static String getWellKnownMIMETypeForExtension(const String& extension);
-
static String getMIMETypeForPath(const String& path);
- // Check to see if a mime type is suitable for being loaded inline as an
+ // Checks to see if the given mime type is supported.
+ static bool isSupportedMIMEType(const String& mimeType);
+
+ // Checks to see if a mime type is suitable for being loaded inline as an
// image (e.g., <img> tags).
static bool isSupportedImageMIMEType(const String& mimeType);
- // Check to see if a mime type is suitable for being loaded as an image
+ // Checks to see if a mime type is suitable for being loaded as an image
// document in a frame.
static bool isSupportedImageResourceMIMEType(const String& mimeType);
- // Check to see if a mime type is suitable for being displayed as an image.
+ // Checks to see if a mime type is suitable for being displayed as an image.
static bool isSupportedImagePrefixedMIMEType(const String& mimeType);
- // Check to see if a mime type is suitable for being encoded.
+ // Checks to see if a mime type is suitable for being encoded.
static bool isSupportedImageMIMETypeForEncoding(const String& mimeType);
- // Check to see if a mime type is suitable for being loaded as a JavaScript
+ // Checks to see if a mime type is suitable for being loaded as a JavaScript
// resource.
static bool isSupportedJavaScriptMIMEType(const String& mimeType);
- // Check to see if a non-image mime type is suitable for being loaded as a
+ // Checks to see if a non-image mime type is suitable for being loaded as a
// document in a frame. Includes supported JavaScript MIME types.
static bool isSupportedNonImageMIMEType(const String& mimeType);
- // Check to see if the mime type and codecs are supported media MIME types.
+ // Checks to see if the mime type and codecs are supported media MIME types.
static bool isSupportedMediaMIMEType(const String& mimeType,
const String& codecs);
- // Check to see if the mime type and codecs are supported by the MediaSource
+ // Does similar to isSupportedMediaMIMEType, but returns a little more
+ // detailed information in SupportsType enum.
+ static SupportsType supportsMediaMIMEType(const String& mimeType,
+ const String& codecs);
+
+ // Checks to see if the mime type and codecs are supported by the MediaSource
// implementation.
static bool isSupportedMediaSourceMIMEType(const String& mimeType,
const String& codecs);
- // Check to see if a mime type is a valid Java applet mime type
+ // Checks to see if a mime type is a valid Java applet mime type
static bool isJavaAppletMIMEType(const String& mimeType);
- // Check to see if a mime type is suitable for being loaded as a stylesheet.
+ // Checks to see if a mime type is suitable for being loaded as a stylesheet.
static bool isSupportedStyleSheetMIMEType(const String& mimeType);
- // Check to see if a mime type is suitable for being loaded as a font.
+ // Checks to see if a mime type is suitable for being loaded as a font.
static bool isSupportedFontMIMEType(const String& mimeType);
- // Check to see if a mime type is suitable for being loaded as a text track.
+ // Checks to see if a mime type is suitable for being loaded as a text track.
static bool isSupportedTextTrackMIMEType(const String& mimeType);
};

Powered by Google App Engine
This is Rietveld 408576698