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