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 #include "base/i18n/icu_util.h" | 5 #include "base/i18n/icu_util.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
10 #include <windows.h> | 10 #include <windows.h> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 #if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE | 44 #if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE |
45 #define ICU_UTIL_DATA_FILE_NAME "icudt" U_ICU_VERSION_SHORT "l.dat" | 45 #define ICU_UTIL_DATA_FILE_NAME "icudt" U_ICU_VERSION_SHORT "l.dat" |
46 #elif ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_SHARED | 46 #elif ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_SHARED |
47 #define ICU_UTIL_DATA_SYMBOL "icudt" U_ICU_VERSION_SHORT "_dat" | 47 #define ICU_UTIL_DATA_SYMBOL "icudt" U_ICU_VERSION_SHORT "_dat" |
48 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
49 #define ICU_UTIL_DATA_SHARED_MODULE_NAME "icudt.dll" | 49 #define ICU_UTIL_DATA_SHARED_MODULE_NAME "icudt.dll" |
50 #endif | 50 #endif |
51 #endif | 51 #endif |
52 | 52 |
| 53 using base::FilePath; |
| 54 |
53 namespace icu_util { | 55 namespace icu_util { |
54 | 56 |
55 bool Initialize() { | 57 bool Initialize() { |
56 #ifndef NDEBUG | 58 #ifndef NDEBUG |
57 // Assert that we are not called more than once. Even though calling this | 59 // Assert that we are not called more than once. Even though calling this |
58 // function isn't harmful (ICU can handle it), being called twice probably | 60 // function isn't harmful (ICU can handle it), being called twice probably |
59 // indicates a programming error. | 61 // indicates a programming error. |
60 static bool called_once = false; | 62 static bool called_once = false; |
61 DCHECK(!called_once); | 63 DCHECK(!called_once); |
62 called_once = true; | 64 called_once = true; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 } | 126 } |
125 } | 127 } |
126 UErrorCode err = U_ZERO_ERROR; | 128 UErrorCode err = U_ZERO_ERROR; |
127 udata_setCommonData(const_cast<uint8*>(mapped_file.data()), &err); | 129 udata_setCommonData(const_cast<uint8*>(mapped_file.data()), &err); |
128 return err == U_ZERO_ERROR; | 130 return err == U_ZERO_ERROR; |
129 #endif // OS check | 131 #endif // OS check |
130 #endif | 132 #endif |
131 } | 133 } |
132 | 134 |
133 } // namespace icu_util | 135 } // namespace icu_util |
OLD | NEW |