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

Side by Side 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: Minor code review changes. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_BASE_MIME_SNIFFER_H__ 5 #ifndef NET_BASE_MIME_SNIFFER_H__
6 #define NET_BASE_MIME_SNIFFER_H__ 6 #define NET_BASE_MIME_SNIFFER_H__
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "net/base/net_export.h" 10 #include "net/base/net_export.h"
(...skipping 23 matching lines...) Expand all
34 // @param content A buffer containing the bytes to sniff. 34 // @param content A buffer containing the bytes to sniff.
35 // @param content_size The number of bytes in the |content| buffer. 35 // @param content_size The number of bytes in the |content| buffer.
36 // @param url The URL from which we obtained this content. 36 // @param url The URL from which we obtained this content.
37 // @param type_hint The current mime type, e.g. from the Content-Type header. 37 // @param type_hint The current mime type, e.g. from the Content-Type header.
38 // @param result Address at which to place the sniffed mime type. 38 // @param result Address at which to place the sniffed mime type.
39 // @return Returns true if we have enough content to guess the mime type. 39 // @return Returns true if we have enough content to guess the mime type.
40 NET_EXPORT bool SniffMimeType(const char* content, size_t content_size, 40 NET_EXPORT bool SniffMimeType(const char* content, size_t content_size,
41 const GURL& url, const std::string& type_hint, 41 const GURL& url, const std::string& type_hint,
42 std::string* result); 42 std::string* result);
43 43
44 // Guess a MIME type from the first few bytes of content only.
45 // Uses a bigger set of media file searches than |SniffMimeType()|.
46 // If finds a match, fills in |result| and returns true,
47 // otherwise returns false.
Ryan Sleevi 2013/05/03 19:03:24 So I realize that you plan to work with Adam to ad
abarth-chromium 2013/05/06 17:54:11 Yeah, I think it's important to pick a name for th
48 //
49 // @param content A buffer containing the bytes to sniff.
50 // @param content_size The number of bytes in the |content| buffer.
51 // @param result Address at which to place the sniffed mime type.
52 // @return Returns true if a MIME type match was found.
53 NET_EXPORT bool IdentifyExtraMimeType(const char* content,
abarth-chromium 2013/05/06 17:54:59 Maybe "SniffMimeTypeFromTrustedLocalData" would be
54 size_t content_size,
55 std::string* result);
56
44 } // namespace net 57 } // namespace net
45 58
46 #endif // NET_BASE_MIME_SNIFFER_H__ 59 #endif // NET_BASE_MIME_SNIFFER_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698