OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
12 * | 12 * |
(...skipping 17 matching lines...) Expand all Loading... |
30 #include "wtf/Allocator.h" | 30 #include "wtf/Allocator.h" |
31 #include "wtf/HashSet.h" | 31 #include "wtf/HashSet.h" |
32 #include "wtf/text/StringHash.h" | 32 #include "wtf/text/StringHash.h" |
33 #include "wtf/text/WTFString.h" | 33 #include "wtf/text/WTFString.h" |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 // Note/reminder: MIME type and parameter names are per-RFC case | 37 // Note/reminder: MIME type and parameter names are per-RFC case |
38 // insensitive (https://www.ietf.org/rfc/rfc2045.txt , section 5.1). | 38 // insensitive (https://www.ietf.org/rfc/rfc2045.txt , section 5.1). |
39 // The MIMETypeRegistry predicates are all case-insensitive. | 39 // The MIMETypeRegistry predicates are all case-insensitive. |
40 | |
41 // TODO(kinuko): Move this file under platform/network/mime. | |
42 class PLATFORM_EXPORT MIMETypeRegistry { | 40 class PLATFORM_EXPORT MIMETypeRegistry { |
43 STATIC_ONLY(MIMETypeRegistry); | 41 STATIC_ONLY(MIMETypeRegistry); |
44 | 42 |
45 public: | 43 public: |
46 // For Media MIME type checks. | 44 // For Media MIME type checks. |
47 enum SupportsType { IsNotSupported, IsSupported, MayBeSupported }; | 45 enum SupportsType { IsNotSupported, IsSupported, MayBeSupported }; |
48 | 46 |
49 static String getMIMETypeForExtension(const String& extension); | 47 static String getMIMETypeForExtension(const String& extension); |
50 static String getWellKnownMIMETypeForExtension(const String& extension); | 48 static String getWellKnownMIMETypeForExtension(const String& extension); |
51 static String getMIMETypeForPath(const String& path); | 49 static String getMIMETypeForPath(const String& path); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // Checks to see if a mime type is suitable for being loaded as a font. | 96 // Checks to see if a mime type is suitable for being loaded as a font. |
99 static bool isSupportedFontMIMEType(const String& mimeType); | 97 static bool isSupportedFontMIMEType(const String& mimeType); |
100 | 98 |
101 // Checks to see if a mime type is suitable for being loaded as a text track. | 99 // Checks to see if a mime type is suitable for being loaded as a text track. |
102 static bool isSupportedTextTrackMIMEType(const String& mimeType); | 100 static bool isSupportedTextTrackMIMEType(const String& mimeType); |
103 }; | 101 }; |
104 | 102 |
105 } // namespace blink | 103 } // namespace blink |
106 | 104 |
107 #endif // MIMETypeRegistry_h | 105 #endif // MIMETypeRegistry_h |
OLD | NEW |