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

Unified Diff: net/base/mime_sniffer.h

Issue 12703012: Have media gallery (through native media file util) use MIME sniffer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Indentation fix. Created 7 years, 7 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 | « chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc ('k') | net/base/mime_sniffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/mime_sniffer.h
diff --git a/net/base/mime_sniffer.h b/net/base/mime_sniffer.h
index 9cdb2d709c76f185c1a096d3f3e4ddeccd96f44a..77f3833fe85e799bd5ec90cf2463d99da3bb6edd 100644
--- a/net/base/mime_sniffer.h
+++ b/net/base/mime_sniffer.h
@@ -41,6 +41,22 @@ NET_EXPORT bool SniffMimeType(const char* content, size_t content_size,
const GURL& url, const std::string& type_hint,
std::string* result);
+// Attempt to identify a MIME type from the first few bytes of content only.
+// Uses a bigger set of media file searches than |SniffMimeType()|.
+// If finds a match, fills in |result| and returns true,
+// otherwise returns false.
+//
+// The caller should understand the security ramifications of trusting
+// uncontrolled data before accepting the results of this function.
+//
+// @param content A buffer containing the bytes to sniff.
+// @param content_size The number of bytes in the |content| buffer.
+// @param result Address at which to place the sniffed mime type.
+// @return Returns true if a MIME type match was found.
+NET_EXPORT bool SniffMimeTypeFromLocalData(const char* content,
+ size_t content_size,
+ std::string* result);
+
} // namespace net
#endif // NET_BASE_MIME_SNIFFER_H__
« no previous file with comments | « chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc ('k') | net/base/mime_sniffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698