| 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 BASE_NIX_MIME_UTIL_XDG_H_ | 5 #ifndef BASE_NIX_MIME_UTIL_XDG_H_ |
| 6 #define BASE_NIX_MIME_UTIL_XDG_H_ | 6 #define BASE_NIX_MIME_UTIL_XDG_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // have to exist. This means that the function does not work for directories | 23 // have to exist. This means that the function does not work for directories |
| 24 // (i.e. |filepath| is assumed to be a path to a file). | 24 // (i.e. |filepath| is assumed to be a path to a file). |
| 25 // | 25 // |
| 26 // Note that this function might need to read from disk the mime-types data | 26 // Note that this function might need to read from disk the mime-types data |
| 27 // provided by the OS. Therefore this function should not be called from | 27 // provided by the OS. Therefore this function should not be called from |
| 28 // threads that disallow IO via base::ThreadRestrictions::SetIOAllowed(false). | 28 // threads that disallow IO via base::ThreadRestrictions::SetIOAllowed(false). |
| 29 // | 29 // |
| 30 // If the mime type is unknown, this will return application/octet-stream. | 30 // If the mime type is unknown, this will return application/octet-stream. |
| 31 BASE_EXPORT std::string GetFileMimeType(const FilePath& filepath); | 31 BASE_EXPORT std::string GetFileMimeType(const FilePath& filepath); |
| 32 | 32 |
| 33 // Get the mime type for a byte vector. | |
| 34 BASE_EXPORT std::string GetDataMimeType(const std::string& data); | |
| 35 | |
| 36 } // namespace nix | 33 } // namespace nix |
| 37 } // namespace base | 34 } // namespace base |
| 38 | 35 |
| 39 #endif // BASE_NIX_MIME_UTIL_XDG_H_ | 36 #endif // BASE_NIX_MIME_UTIL_XDG_H_ |
| OLD | NEW |