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 BASE_I18N_EXPORT extern const char kIcuDataFileName[]; | 15 BASE_I18N_EXPORT extern const char kIcuDataFileName[]; |
16 | 16 |
17 #if !defined(OS_NACL) | 17 #if !defined(OS_NACL) |
18 // Call this function to load ICU's data tables for the current process. This | 18 // Call this function to load ICU's data tables for the current process. This |
19 // function should be called before ICU is used. | 19 // function should be called before ICU is used. |
20 BASE_I18N_EXPORT bool InitializeICU(); | 20 BASE_I18N_EXPORT bool InitializeICU(); |
21 #endif | |
22 | 21 |
23 #if defined(OS_ANDROID) | 22 // Android and html_viewer use a file descriptor passed by browser process to |
24 // Android uses a file descriptor passed by browser process to initialize ICU | 23 // initialize ICU in render processes. |
25 // in render processes. | |
26 BASE_I18N_EXPORT bool InitializeICUWithFileDescriptor( | 24 BASE_I18N_EXPORT bool InitializeICUWithFileDescriptor( |
27 int data_fd, | 25 PlatformFile data_fd, |
28 base::MemoryMappedFile::Region data_region); | 26 MemoryMappedFile::Region data_region); |
29 #endif | 27 #endif |
30 | 28 |
31 // In a test binary, the call above might occur twice. | 29 // In a test binary, the call above might occur twice. |
32 BASE_I18N_EXPORT void AllowMultipleInitializeCallsForTesting(); | 30 BASE_I18N_EXPORT void AllowMultipleInitializeCallsForTesting(); |
33 | 31 |
34 } // namespace i18n | 32 } // namespace i18n |
35 } // namespace base | 33 } // namespace base |
36 | 34 |
37 #endif // BASE_I18N_ICU_UTIL_H_ | 35 #endif // BASE_I18N_ICU_UTIL_H_ |
OLD | NEW |