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

Unified Diff: source/i18n/uspoof_impl.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/i18n/uspoof_conf.cpp ('k') | source/i18n/usrchimp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/i18n/uspoof_impl.cpp
diff --git a/source/i18n/uspoof_impl.cpp b/source/i18n/uspoof_impl.cpp
index 9c662f8048336e70581300ba3f418c4a662ae945..e9077d3ac3414027735b4cbc8880fb92a6e9a996 100644
--- a/source/i18n/uspoof_impl.cpp
+++ b/source/i18n/uspoof_impl.cpp
@@ -1,6 +1,6 @@
/*
**********************************************************************
-* Copyright (C) 2008-2014, International Business Machines
+* Copyright (C) 2008-2015, International Business Machines
* Corporation and others. All Rights Reserved.
**********************************************************************
*/
@@ -28,12 +28,11 @@ U_NAMESPACE_BEGIN
UOBJECT_DEFINE_RTTI_IMPLEMENTATION(SpoofImpl)
SpoofImpl::SpoofImpl(SpoofData *data, UErrorCode &status) :
- fMagic(0), fChecks(USPOOF_ALL_CHECKS), fSpoofData(NULL), fAllowedCharsSet(NULL) ,
+ fMagic(0), fChecks(USPOOF_ALL_CHECKS), fSpoofData(data), fAllowedCharsSet(NULL) ,
fAllowedLocales(NULL), fCachedIdentifierInfo(NULL) {
if (U_FAILURE(status)) {
return;
}
- fSpoofData = data;
fRestrictionLevel = USPOOF_HIGHLY_RESTRICTIVE;
UnicodeSet *allowedCharsSet = new UnicodeSet(0, 0x10ffff);
@@ -500,11 +499,12 @@ spoofDataIsAcceptable(void *context,
//
// SpoofData::getDefault() - return a wrapper around the spoof data that is
-// baked into the default ICU data.
+// baked into the default ICU data.
+//
+// Called once, from the initOnce() function in uspoof_impl.cpp; the resulting
+// SpoofData is shared by all spoof checkers using the default data.
//
SpoofData *SpoofData::getDefault(UErrorCode &status) {
- // TODO: Cache it. Lazy create, keep until cleanup.
-
UDataMemory *udm = udata_openChoice(NULL, "cfu", "confusables",
spoofDataIsAcceptable,
NULL, // context, would receive dataVersion if supplied.
@@ -567,7 +567,6 @@ SpoofData::SpoofData(UErrorCode &status) {
return;
}
fDataOwned = true;
- fRefCount = 1;
// The spoof header should already be sized to be a multiple of 16 bytes.
// Just in case it's not, round it up.
« no previous file with comments | « source/i18n/uspoof_conf.cpp ('k') | source/i18n/usrchimp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698