Changeset 211156 in webkit
- Timestamp:
- Jan 25, 2017, 12:02:00 PM (10 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 5 edited
-
ios/ChangeLog (modified) (1 diff)
-
ios/Misc/WebUIKitSupport.mm (modified) (2 diffs)
-
mac/ChangeLog (modified) (1 diff)
-
mac/Misc/WebLocalizableStrings.h (modified) (1 diff)
-
mac/Misc/WebLocalizableStrings.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ios/ChangeLog
r211033 r211156 1 2017-01-25 Aakash Jain <aakash_jain@apple.com> 2 3 LoadWebLocalizedStrings method should be moved in correct file 4 https://bugs.webkit.org/show_bug.cgi?id=167393 5 6 Reviewed by Alexey Proskuryakov. 7 8 * Misc/WebUIKitSupport.mm: 9 (LoadWebLocalizedStringsTimerCallback): Moved from WebLocalizableStrings.mm 10 (LoadWebLocalizedStrings): Moved from WebLocalizableStrings.mm 11 1 12 2017-01-21 Darin Adler <darin@apple.com> 2 13 -
trunk/Source/WebKit/ios/Misc/WebUIKitSupport.mm
r209907 r211156 30 30 #import "WebDatabaseManagerInternal.h" 31 31 #import "WebKitSystemInterface.h" 32 #import "WebLocalizableStrings .h"32 #import "WebLocalizableStringsInternal.h" 33 33 #import "WebPlatformStrategies.h" 34 34 #import "WebSystemInterface.h" … … 50 50 static bool s_linkedOnOrAfterIOS5 = dyld_get_program_sdk_version() >= DYLD_IOS_VERSION_5_0; 51 51 return s_linkedOnOrAfterIOS5; 52 } 53 54 // See <rdar://problem/7902473> Optimize WebLocalizedString for why we do this on a background thread on a timer callback 55 static void LoadWebLocalizedStringsTimerCallback(CFRunLoopTimerRef timer, void *info) 56 { 57 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^ { 58 // We don't care if we find this string, but searching for it will load the plist and save the results. 59 // FIXME: It would be nicer to do this in a more direct way. 60 UI_STRING_KEY_INTERNAL("Typing", "Typing (Undo action name)", "Undo action name"); 61 }); 62 } 63 64 static void LoadWebLocalizedStrings() 65 { 66 CFRunLoopTimerRef timer = CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent(), 0, 0, 0, &LoadWebLocalizedStringsTimerCallback, NULL); 67 CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopCommonModes); 68 CFRelease(timer); 52 69 } 53 70 -
trunk/Source/WebKit/mac/ChangeLog
r211135 r211156 1 2017-01-25 Aakash Jain <aakash_jain@apple.com> 2 3 LoadWebLocalizedStrings method should be moved in correct file 4 https://bugs.webkit.org/show_bug.cgi?id=167393 5 6 Reviewed by Alexey Proskuryakov. 7 8 * Misc/WebLocalizableStrings.h: Deleted LoadWebLocalizedStrings method. 9 * Misc/WebLocalizableStrings.mm: 10 (LoadWebLocalizedStringsTimerCallback): Deleted, moved to WebUIKitSupport.mm 11 (LoadWebLocalizedStrings): Deleted, moved to WebUIKitSupport.mm 12 1 13 2017-01-24 Zalan Bujtas <zalan@apple.com> 2 14 -
trunk/Source/WebKit/mac/Misc/WebLocalizableStrings.h
r177825 r211156 50 50 WebLocalizedStringType WebLocalizedString(WebLocalizableStringsBundle* bundle, const char* key); 51 51 52 #if TARGET_OS_IPHONE53 void LoadWebLocalizedStrings(void); // The first WebLocalizedString call can take over 20ms unless this function is called beforehand.54 #endif55 56 52 #ifdef __cplusplus 57 53 } -
trunk/Source/WebKit/mac/Misc/WebLocalizableStrings.mm
r182735 r211156 31 31 #import <wtf/Assertions.h> 32 32 #import <wtf/MainThread.h> 33 34 #if PLATFORM(IOS)35 #import "WebLocalizableStringsInternal.h"36 #import <dispatch/dispatch.h>37 #endif38 33 39 34 WebLocalizableStringsBundle WebKitLocalizableStringsBundle = { "com.apple.WebKit", 0 }; … … 73 68 return result; 74 69 } 75 76 #if PLATFORM(IOS)77 78 // See <rdar://problem/7902473> Optimize WebLocalizedString for why we do this on a background thread on a timer callback79 static void LoadWebLocalizedStringsTimerCallback(CFRunLoopTimerRef timer, void *info)80 {81 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{82 // We don't care if we find this string, but searching for it will load the plist and save the results.83 // FIXME: It would be nicer to do this in a more direct way.84 UI_STRING_KEY_INTERNAL("Typing", "Typing (Undo action name)", "Undo action name");85 });86 }87 88 void LoadWebLocalizedStrings(void)89 {90 CFRunLoopTimerRef timer = CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent(), 0, 0, 0, &LoadWebLocalizedStringsTimerCallback, NULL);91 CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopCommonModes);92 CFRelease(timer);93 }94 95 #endif
Note:
See TracChangeset
for help on using the changeset viewer.