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

Side by Side Diff: net/base/mime_sniffer.h

Issue 1058003005: Mime sniffer: reduce table from 256 bytes to 4 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add plain text perf test. Created 5 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
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 bytes that are control codes that do
61 // not usually appear in plain text.
62 // @param content A buffer contains bytes that may be binary.
63 // @param size The number of bytes in the |content| buffer.
64 // @return Returns true if |content| looks like binary.
65 NET_EXPORT_PRIVATE bool LooksLikeBinary(const char* content, size_t size);
66
60 } // namespace net 67 } // namespace net
61 68
62 #endif // NET_BASE_MIME_SNIFFER_H__ 69 #endif // NET_BASE_MIME_SNIFFER_H__
OLDNEW
« no previous file with comments | « net/BUILD.gn ('k') | net/base/mime_sniffer.cc » ('j') | net/base/mime_sniffer_perftest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698