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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 data_path = data_path.AppendASCII(ICU_UTIL_DATA_FILE_NAME); | 97 data_path = data_path.AppendASCII(ICU_UTIL_DATA_FILE_NAME); |
98 #else | 98 #else |
99 FilePath data_path = | 99 FilePath data_path = |
100 base::mac::PathForFrameworkBundleResource(CFSTR(ICU_UTIL_DATA_FILE_NAME)); | 100 base::mac::PathForFrameworkBundleResource(CFSTR(ICU_UTIL_DATA_FILE_NAME)); |
101 if (data_path.empty()) { | 101 if (data_path.empty()) { |
102 DLOG(ERROR) << ICU_UTIL_DATA_FILE_NAME << " not found in bundle"; | 102 DLOG(ERROR) << ICU_UTIL_DATA_FILE_NAME << " not found in bundle"; |
103 return false; | 103 return false; |
104 } | 104 } |
105 #endif // OS check | 105 #endif // OS check |
106 if (!mapped_file.Initialize(data_path)) { | 106 if (!mapped_file.Initialize(data_path)) { |
107 DLOG(ERROR) << "Couldn't mmap " << data_path.value(); | 107 DLOG(ERROR) << "Couldn't mmap " << data_path.AsUTF8Unsafe(); |
108 return false; | 108 return false; |
109 } | 109 } |
110 } | 110 } |
111 UErrorCode err = U_ZERO_ERROR; | 111 UErrorCode err = U_ZERO_ERROR; |
112 udata_setCommonData(const_cast<uint8*>(mapped_file.data()), &err); | 112 udata_setCommonData(const_cast<uint8*>(mapped_file.data()), &err); |
113 return err == U_ZERO_ERROR; | 113 return err == U_ZERO_ERROR; |
114 #endif | 114 #endif |
115 } | 115 } |
116 | 116 |
117 } // namespace i18n | 117 } // namespace i18n |
118 } // namespace base | 118 } // namespace base |
OLD | NEW |