Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: base/i18n/icu_util.cc

Issue 2006703005: Define kInvalidPlatformFile in base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no ppapi Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/files/file.h ('k') | gin/v8_initializer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #endif 9 #endif
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // build pkg configurations, etc). 'l' stands for Little Endian. 71 // build pkg configurations, etc). 'l' stands for Little Endian.
72 // This variable is exported through the header file. 72 // This variable is exported through the header file.
73 const char kIcuDataFileName[] = "icudtl.dat"; 73 const char kIcuDataFileName[] = "icudtl.dat";
74 #if defined(OS_ANDROID) 74 #if defined(OS_ANDROID)
75 const char kAndroidAssetsIcuDataFileName[] = "assets/icudtl.dat"; 75 const char kAndroidAssetsIcuDataFileName[] = "assets/icudtl.dat";
76 #endif 76 #endif
77 77
78 // File handle intentionally never closed. Not using File here because its 78 // File handle intentionally never closed. Not using File here because its
79 // Windows implementation guards against two instances owning the same 79 // Windows implementation guards against two instances owning the same
80 // PlatformFile (which we allow since we know it is never freed). 80 // PlatformFile (which we allow since we know it is never freed).
81 const PlatformFile kInvalidPlatformFile =
82 #if defined(OS_WIN)
83 INVALID_HANDLE_VALUE;
84 #else
85 -1;
86 #endif
87 PlatformFile g_icudtl_pf = kInvalidPlatformFile; 81 PlatformFile g_icudtl_pf = kInvalidPlatformFile;
88 MemoryMappedFile* g_icudtl_mapped_file = nullptr; 82 MemoryMappedFile* g_icudtl_mapped_file = nullptr;
89 MemoryMappedFile::Region g_icudtl_region; 83 MemoryMappedFile::Region g_icudtl_region;
90 84
91 void LazyInitIcuDataFile() { 85 void LazyInitIcuDataFile() {
92 if (g_icudtl_pf != kInvalidPlatformFile) { 86 if (g_icudtl_pf != kInvalidPlatformFile) {
93 return; 87 return;
94 } 88 }
95 #if defined(OS_ANDROID) 89 #if defined(OS_ANDROID)
96 int fd = base::android::OpenApkAsset(kAndroidAssetsIcuDataFileName, 90 int fd = base::android::OpenApkAsset(kAndroidAssetsIcuDataFileName,
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 #endif // !defined(OS_NACL) 307 #endif // !defined(OS_NACL)
314 308
315 void AllowMultipleInitializeCallsForTesting() { 309 void AllowMultipleInitializeCallsForTesting() {
316 #if !defined(NDEBUG) && !defined(OS_NACL) 310 #if !defined(NDEBUG) && !defined(OS_NACL)
317 g_check_called_once = false; 311 g_check_called_once = false;
318 #endif 312 #endif
319 } 313 }
320 314
321 } // namespace i18n 315 } // namespace i18n
322 } // namespace base 316 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file.h ('k') | gin/v8_initializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698