Fix <rdar://5624866> CFStringRef UI_STRING should use a cache and follow...
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Dec 2007 17:16:12 +0000 (17:16 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Dec 2007 17:16:12 +0000 (17:16 +0000)
commita9c89892b3b9b7959f9192c6ced234c863fec45b
tree809d795ff2db1670091ab6f3e77794ade2481408
parent594a5b4cba2467aecbd6f47d23036ce9574dccba
     Fix <rdar://5624866> CFStringRef UI_STRING should use a cache and follow the CF "Get" model (current uses leak)

         Added a new class, LocalizedString, that wraps a CFStringRef and a
         WebCore::String. We store one LocalizedString for each key string.

         Reviewed by Steve.

         * WebLocalizableStrings.cpp: Changed our two HashMaps to map from
         WebCore::String to LocalizedString*.
         (LocalizedString::LocalizedString):
         (LocalizedString::operator CFStringRef):
         (LocalizedString::operator LPCTSTR): Code moved here from
         localizedLPCTSTR.
         (findCachedString): Changed to return a LocalizedString*.
         (cacheString): Changed to take a LocalizedString*.
         (localizedString): Changed to return a const LocalizedString&. We
         first try to find a cached LocalizedString. If there isn't one, we
         create a new one and cache it.
         (WebLocalizedLPCTSTRUTF8): Changed to call localizedString.
         (WebLocalizedLPCTSTR): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28583 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit/win/ChangeLog
WebKit/win/WebLocalizableStrings.cpp