| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UTIL_H__ | 5 #ifndef NET_BASE_MIME_UTIL_H__ | 
| 6 #define NET_BASE_MIME_UTIL_H__ | 6 #define NET_BASE_MIME_UTIL_H__ | 
| 7 | 7 | 
| 8 // This file defines MIME utility functions. All of them assume the MIME type | 8 // This file defines MIME utility functions. All of them assume the MIME type | 
| 9 // to be of the format specified by rfc2045. According to it, MIME types are | 9 // to be of the format specified by rfc2045. According to it, MIME types are | 
| 10 // case strongly insensitive except parameter values, which may or may not be | 10 // case strongly insensitive except parameter values, which may or may not be | 
| 11 // case sensitive. | 11 // case sensitive. | 
| 12 // | 12 // | 
| 13 // These utilities perform a *case-sensitive* matching for  parameter values, | 13 // These utilities perform a *case-sensitive* matching for  parameter values, | 
| 14 // which may produce some false negatives. Except that, matching is | 14 // which may produce some false negatives. Except that, matching is | 
| 15 // case-insensitive. | 15 // case-insensitive. | 
| 16 // | 16 // | 
| 17 // All constants in mime_util.cc must be written in lower case, except parameter | 17 // All constants in mime_util.cc must be written in lower case, except parameter | 
| 18 // values, which can be any case. | 18 // values, which can be any case. | 
| 19 | 19 | 
|  | 20 #include <stddef.h> | 
|  | 21 | 
| 20 #include <string> | 22 #include <string> | 
| 21 #include <vector> | 23 #include <vector> | 
| 22 | 24 | 
| 23 #include "base/files/file_path.h" | 25 #include "base/files/file_path.h" | 
| 24 #include "net/base/net_export.h" | 26 #include "net/base/net_export.h" | 
| 25 | 27 | 
| 26 namespace net { | 28 namespace net { | 
| 27 | 29 | 
| 28 // Get the mime type (if any) that is associated with the given file extension. | 30 // Get the mime type (if any) that is associated with the given file extension. | 
| 29 // Returns true if a corresponding mime type exists. | 31 // Returns true if a corresponding mime type exists. | 
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 116 }; | 118 }; | 
| 117 | 119 | 
| 118 // Finds mime type of |ext| from |mappings|. | 120 // Finds mime type of |ext| from |mappings|. | 
| 119 const char* FindMimeType(const MimeInfo* mappings, | 121 const char* FindMimeType(const MimeInfo* mappings, | 
| 120                          size_t mappings_len, | 122                          size_t mappings_len, | 
| 121                          const std::string& ext); | 123                          const std::string& ext); | 
| 122 | 124 | 
| 123 }  // namespace net | 125 }  // namespace net | 
| 124 | 126 | 
| 125 #endif  // NET_BASE_MIME_UTIL_H__ | 127 #endif  // NET_BASE_MIME_UTIL_H__ | 
| OLD | NEW | 
|---|