Chromium Code Reviews| 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_I18N_ICU_UTIL_H_ | 5 #ifndef BASE_I18N_ICU_UTIL_H_ |
| 6 #define BASE_I18N_ICU_UTIL_H_ | 6 #define BASE_I18N_ICU_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/files/memory_mapped_file.h" | 8 #include "base/files/memory_mapped_file.h" |
| 9 #include "base/i18n/base_i18n_export.h" | 9 #include "base/i18n/base_i18n_export.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 | 11 |
| 12 namespace base { | 12 namespace base { |
| 13 namespace i18n { | 13 namespace i18n { |
| 14 | 14 |
| 15 #if !defined(OS_NACL) | 15 #if !defined(OS_NACL) |
| 16 // Call this function to load ICU's data tables for the current process. This | 16 // Call this function to load ICU's data tables for the current process. This |
| 17 // function should be called before ICU is used. | 17 // function should be called before ICU is used. |
| 18 BASE_I18N_EXPORT bool InitializeICU(); | 18 BASE_I18N_EXPORT bool InitializeICU(); |
| 19 | 19 |
| 20 // Returns a raw PlatformFile to the caller. Each call to this function returns | |
| 21 // a new file descriptor. The caller is responsible for closing this file when | |
| 22 // done with it. | |
| 23 BASE_I18N_EXPORT PlatformFile OpenIcuDataFile(); | |
|
jam
2015/11/05 19:29:03
nit: ICU for consistency with the rest of the file
| |
| 24 | |
| 20 #if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE | 25 #if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE |
| 26 #if defined(OS_ANDROID) | |
| 21 // Returns the PlatformFile and Region that was initialized by InitializeICU(). | 27 // Returns the PlatformFile and Region that was initialized by InitializeICU(). |
| 22 // Use with InitializeICUWithFileDescriptor(). | 28 // Use with InitializeICUWithFileDescriptor(). This handle can't be shared |
| 29 // within the same process. | |
| 23 BASE_I18N_EXPORT PlatformFile GetIcuDataFileHandle( | 30 BASE_I18N_EXPORT PlatformFile GetIcuDataFileHandle( |
| 24 MemoryMappedFile::Region* out_region); | 31 MemoryMappedFile::Region* out_region); |
| 32 #endif | |
| 25 | 33 |
| 26 // Android and html_viewer use a file descriptor passed by browser process to | 34 // Android and html_viewer use a file descriptor passed by browser process to |
| 27 // initialize ICU in render processes. | 35 // initialize ICU in render processes. |
| 28 BASE_I18N_EXPORT bool InitializeICUWithFileDescriptor( | 36 BASE_I18N_EXPORT bool InitializeICUWithFileDescriptor( |
| 29 PlatformFile data_fd, | 37 PlatformFile data_fd, |
| 30 const MemoryMappedFile::Region& data_region); | 38 const MemoryMappedFile::Region& data_region); |
| 31 #endif // ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE | 39 #endif // ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE |
| 32 #endif // !defined(OS_NACL) | 40 #endif // !defined(OS_NACL) |
| 33 | 41 |
| 34 // In a test binary, the call above might occur twice. | 42 // In a test binary, the call above might occur twice. |
| 35 BASE_I18N_EXPORT void AllowMultipleInitializeCallsForTesting(); | 43 BASE_I18N_EXPORT void AllowMultipleInitializeCallsForTesting(); |
| 36 | 44 |
| 37 } // namespace i18n | 45 } // namespace i18n |
| 38 } // namespace base | 46 } // namespace base |
| 39 | 47 |
| 40 #endif // BASE_I18N_ICU_UTIL_H_ | 48 #endif // BASE_I18N_ICU_UTIL_H_ |
| OLD | NEW |