Changeset 236703 in webkit
- Timestamp:
- Oct 1, 2018, 5:21:14 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r236702 r236703 1 2018-10-01 Alex Christensen <achristensen@webkit.org> 2 3 Don't read from WebCore's bundle for IDNScriptWhiteList 4 https://bugs.webkit.org/show_bug.cgi?id=190157 5 6 Reviewed by Dan Bernstein. 7 8 No change in behavior. This increases performance by not reading from the WebCore bundle, 9 and it makes it so that URL-related functionality can be moved to a place without 10 a bundle for resources. 11 12 * Resources/IDNScriptWhiteList.txt: Removed. 13 * WebCore.xcodeproj/project.pbxproj: 14 * platform/mac/WebCoreNSURLExtras.mm: 15 (WebCore::whiteListIDNScripts): 16 (WebCore::allCharactersInIDNScriptWhiteList): 17 (WebCore::readIDNScriptWhiteListFile): Deleted. 18 1 19 2018-10-01 Alex Christensen <achristensen@webkit.org> 2 20 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r236678 r236703 2255 2255 7CC564B818BABEA6001B9652 /* TelephoneNumberDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CC564B618BABEA6001B9652 /* TelephoneNumberDetector.h */; }; 2256 2256 7CC69941191EC5F500AF2270 /* JSWebKitNamespace.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CC6993F191EC5F500AF2270 /* JSWebKitNamespace.h */; }; 2257 7CC7E3D717208C0F003C5277 /* IDNScriptWhiteList.txt in Resources */ = {isa = PBXBuildFile; fileRef = 7CC7E3D617208C0F003C5277 /* IDNScriptWhiteList.txt */; };2258 2257 7CC9722E1F93E3360004D4CF /* SettingsBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CC660991F93057800D500E9 /* SettingsBase.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2259 2258 7CCEBFC01DD8F6AB002C40B8 /* SVGLengthValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CE58D531DD7B09300128552 /* SVGLengthValue.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 9683 9682 7CC6993E191EC5F500AF2270 /* JSWebKitNamespace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitNamespace.cpp; sourceTree = "<group>"; }; 9684 9683 7CC6993F191EC5F500AF2270 /* JSWebKitNamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitNamespace.h; sourceTree = "<group>"; }; 9685 7CC7E3D617208C0F003C5277 /* IDNScriptWhiteList.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDNScriptWhiteList.txt; sourceTree = "<group>"; };9686 9684 7CD0BA021B8F79C9005CEBBE /* ActiveDOMCallbackMicrotask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActiveDOMCallbackMicrotask.cpp; sourceTree = "<group>"; }; 9687 9685 7CD0BA031B8F79C9005CEBBE /* ActiveDOMCallbackMicrotask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActiveDOMCallbackMicrotask.h; sourceTree = "<group>"; }; … … 15767 15765 A1AA9AB81D23911500FEADB3 /* ContentFilterBlockedPage.html */, 15768 15766 A11E8C001B1E28BE0003A7C7 /* copyCursor.png */, 15769 7CC7E3D617208C0F003C5277 /* IDNScriptWhiteList.txt */,15770 15767 2D9F0E1214FF1CBF00BA0FF7 /* linearSRGB.icc */, 15771 15768 BCAD1808131C7A0D00990406 /* Localizable.strings */, … … 31380 31377 A1AA9AB91D23911500FEADB3 /* ContentFilterBlockedPage.html in Resources */, 31381 31378 A11E8C051B1E28F40003A7C7 /* copyCursor.png in Resources */, 31382 7CC7E3D717208C0F003C5277 /* IDNScriptWhiteList.txt in Resources */,31383 31379 2D9F0E1314FF1CBF00BA0FF7 /* linearSRGB.icc in Resources */, 31384 31380 E59DD4B821098287003C8B47 /* ListButtonArrow.png in Resources */, -
trunk/Source/WebCore/platform/mac/WebCoreNSURLExtras.mm
r236702 r236703 248 248 } 249 249 250 static void whiteListIDNScript(const char* scriptName) 251 { 252 int32_t script = u_getPropertyValueEnum(UCHAR_SCRIPT, scriptName); 253 if (script >= 0 && script < USCRIPT_CODE_LIMIT) { 254 size_t index = script / 32; 255 uint32_t mask = 1 << (script % 32); 256 IDNScriptWhiteList[index] |= mask; 257 } 258 } 259 250 260 static BOOL readIDNScriptWhiteListFile(NSString *filename) 251 261 { … … 272 282 if (result == 1) { 273 283 // Got a word, map to script code and put it into the array. 274 int32_t script = u_getPropertyValueEnum(UCHAR_SCRIPT, word); 275 if (script >= 0 && script < USCRIPT_CODE_LIMIT) { 276 size_t index = script / 32; 277 uint32_t mask = 1 << (script % 32); 278 IDNScriptWhiteList[index] |= mask; 279 } 284 whiteListIDNScript(word); 280 285 } 281 286 } … … 295 300 return; 296 301 } 297 298 // Fall back on white list inside bundle. 299 NSBundle *bundle = [NSBundle bundleWithIdentifier:@"com.apple.WebCore"]; 300 301 if (!readIDNScriptWhiteListFile([bundle pathForResource:@"IDNScriptWhiteList" ofType:@"txt"])) 302 CRASH(); 302 const char* defaultIDNScriptWhiteList[20] = { 303 "Common", 304 "Inherited", 305 "Arabic", 306 "Armenian", 307 "Bopomofo", 308 "Canadian_Aboriginal", 309 "Devanagari", 310 "Deseret", 311 "Gujarati", 312 "Gurmukhi", 313 "Hangul", 314 "Han", 315 "Hebrew", 316 "Hiragana", 317 "Katakana_Or_Hiragana", 318 "Katakana", 319 "Latin", 320 "Tamil", 321 "Thai", 322 "Yi", 323 }; 324 for (const char* scriptName : defaultIDNScriptWhiteList) 325 whiteListIDNScript(scriptName); 303 326 }); 304 327
Note:
See TracChangeset
for help on using the changeset viewer.