OLD | NEW |
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // uncontrolled data before accepting the results of this function. | 50 // uncontrolled data before accepting the results of this function. |
51 // | 51 // |
52 // @param content A buffer containing the bytes to sniff. | 52 // @param content A buffer containing the bytes to sniff. |
53 // @param content_size The number of bytes in the |content| buffer. | 53 // @param content_size The number of bytes in the |content| buffer. |
54 // @param result Address at which to place the sniffed mime type. | 54 // @param result Address at which to place the sniffed mime type. |
55 // @return Returns true if a MIME type match was found. | 55 // @return Returns true if a MIME type match was found. |
56 NET_EXPORT bool SniffMimeTypeFromLocalData(const char* content, | 56 NET_EXPORT bool SniffMimeTypeFromLocalData(const char* content, |
57 size_t content_size, | 57 size_t content_size, |
58 std::string* result); | 58 std::string* result); |
59 | 59 |
| 60 // Returns true if |content| contains characters that are control codes that do |
| 61 // not usually appear in plain text. |
| 62 NET_EXPORT_PRIVATE bool ContainsControlCodes(const char* content, size_t size); |
| 63 |
60 } // namespace net | 64 } // namespace net |
61 | 65 |
62 #endif // NET_BASE_MIME_SNIFFER_H__ | 66 #endif // NET_BASE_MIME_SNIFFER_H__ |
OLD | NEW |