Title: [211156] trunk/Source/WebKit
Revision
211156
Author
[email protected]
Date
2017-01-25 12:02:00 -0800 (Wed, 25 Jan 2017)

Log Message

LoadWebLocalizedStrings method should be moved in correct file
https://bugs.webkit.org/show_bug.cgi?id=167393

Reviewed by Alexey Proskuryakov.

Source/WebKit/ios:

* Misc/WebUIKitSupport.mm:
(LoadWebLocalizedStringsTimerCallback): Moved from WebLocalizableStrings.mm
(LoadWebLocalizedStrings): Moved from WebLocalizableStrings.mm

Source/WebKit/mac:

* Misc/WebLocalizableStrings.h: Deleted LoadWebLocalizedStrings method.
* Misc/WebLocalizableStrings.mm:
(LoadWebLocalizedStringsTimerCallback): Deleted, moved to WebUIKitSupport.mm
(LoadWebLocalizedStrings): Deleted, moved to WebUIKitSupport.mm

Modified Paths

Diff

Modified: trunk/Source/WebKit/ios/ChangeLog (211155 => 211156)


--- trunk/Source/WebKit/ios/ChangeLog	2017-01-25 19:14:18 UTC (rev 211155)
+++ trunk/Source/WebKit/ios/ChangeLog	2017-01-25 20:02:00 UTC (rev 211156)
@@ -1,3 +1,14 @@
+2017-01-25  Aakash Jain  <[email protected]>
+
+        LoadWebLocalizedStrings method should be moved in correct file
+        https://bugs.webkit.org/show_bug.cgi?id=167393
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Misc/WebUIKitSupport.mm:
+        (LoadWebLocalizedStringsTimerCallback): Moved from WebLocalizableStrings.mm
+        (LoadWebLocalizedStrings): Moved from WebLocalizableStrings.mm
+
 2017-01-21  Darin Adler  <[email protected]>
 
         Remove PassRefPtr from "page" directory of WebCore, also deploy references

Modified: trunk/Source/WebKit/ios/Misc/WebUIKitSupport.mm (211155 => 211156)


--- trunk/Source/WebKit/ios/Misc/WebUIKitSupport.mm	2017-01-25 19:14:18 UTC (rev 211155)
+++ trunk/Source/WebKit/ios/Misc/WebUIKitSupport.mm	2017-01-25 20:02:00 UTC (rev 211156)
@@ -29,7 +29,7 @@
 
 #import "WebDatabaseManagerInternal.h"
 #import "WebKitSystemInterface.h"
-#import "WebLocalizableStrings.h"
+#import "WebLocalizableStringsInternal.h"
 #import "WebPlatformStrategies.h"
 #import "WebSystemInterface.h"
 #import "WebViewPrivate.h"
@@ -51,6 +51,23 @@
     return s_linkedOnOrAfterIOS5;
 }
 
+// See <rdar://problem/7902473> Optimize WebLocalizedString for why we do this on a background thread on a timer callback
+static void LoadWebLocalizedStringsTimerCallback(CFRunLoopTimerRef timer, void *info)
+{
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^ {
+        // We don't care if we find this string, but searching for it will load the plist and save the results.
+        // FIXME: It would be nicer to do this in a more direct way.
+        UI_STRING_KEY_INTERNAL("Typing", "Typing (Undo action name)", "Undo action name");
+    });
+}
+
+static void LoadWebLocalizedStrings()
+{
+    CFRunLoopTimerRef timer = CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent(), 0, 0, 0, &LoadWebLocalizedStringsTimerCallback, NULL);
+    CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopCommonModes);
+    CFRelease(timer);
+}
+
 void WebKitInitialize(void)
 {
     static bool webkitInitialized;

Modified: trunk/Source/WebKit/mac/ChangeLog (211155 => 211156)


--- trunk/Source/WebKit/mac/ChangeLog	2017-01-25 19:14:18 UTC (rev 211155)
+++ trunk/Source/WebKit/mac/ChangeLog	2017-01-25 20:02:00 UTC (rev 211156)
@@ -1,3 +1,15 @@
+2017-01-25  Aakash Jain  <[email protected]>
+
+        LoadWebLocalizedStrings method should be moved in correct file
+        https://bugs.webkit.org/show_bug.cgi?id=167393
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Misc/WebLocalizableStrings.h: Deleted LoadWebLocalizedStrings method.
+        * Misc/WebLocalizableStrings.mm:
+        (LoadWebLocalizedStringsTimerCallback): Deleted, moved to WebUIKitSupport.mm
+        (LoadWebLocalizedStrings): Deleted, moved to WebUIKitSupport.mm
+
 2017-01-24  Zalan Bujtas  <[email protected]>
 
         Add simple line layout toggle to MiniBrowser

Modified: trunk/Source/WebKit/mac/Misc/WebLocalizableStrings.h (211155 => 211156)


--- trunk/Source/WebKit/mac/Misc/WebLocalizableStrings.h	2017-01-25 19:14:18 UTC (rev 211155)
+++ trunk/Source/WebKit/mac/Misc/WebLocalizableStrings.h	2017-01-25 20:02:00 UTC (rev 211156)
@@ -49,10 +49,6 @@
 
 WebLocalizedStringType WebLocalizedString(WebLocalizableStringsBundle* bundle, const char* key);
 
-#if TARGET_OS_IPHONE
-void LoadWebLocalizedStrings(void); // The first WebLocalizedString call can take over 20ms unless this function is called beforehand.
-#endif
-
 #ifdef __cplusplus
 }
 #endif

Modified: trunk/Source/WebKit/mac/Misc/WebLocalizableStrings.mm (211155 => 211156)


--- trunk/Source/WebKit/mac/Misc/WebLocalizableStrings.mm	2017-01-25 19:14:18 UTC (rev 211155)
+++ trunk/Source/WebKit/mac/Misc/WebLocalizableStrings.mm	2017-01-25 20:02:00 UTC (rev 211156)
@@ -31,11 +31,6 @@
 #import <wtf/Assertions.h>
 #import <wtf/MainThread.h>
 
-#if PLATFORM(IOS)
-#import "WebLocalizableStringsInternal.h"
-#import <dispatch/dispatch.h>
-#endif
-
 WebLocalizableStringsBundle WebKitLocalizableStringsBundle = { "com.apple.WebKit", 0 };
 
 NSString *WebLocalizedString(WebLocalizableStringsBundle *stringsBundle, const char *key)
@@ -72,24 +67,3 @@
     ASSERT_WITH_MESSAGE(result != notFound, "could not find localizable string %s in bundle", key);
     return result;
 }
-
-#if PLATFORM(IOS)
-
-// See <rdar://problem/7902473> Optimize WebLocalizedString for why we do this on a background thread on a timer callback
-static void LoadWebLocalizedStringsTimerCallback(CFRunLoopTimerRef timer, void *info)
-{
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
-        // We don't care if we find this string, but searching for it will load the plist and save the results.
-        // FIXME: It would be nicer to do this in a more direct way.
-        UI_STRING_KEY_INTERNAL("Typing", "Typing (Undo action name)", "Undo action name");
-    });
-}
-
-void LoadWebLocalizedStrings(void)
-{
-    CFRunLoopTimerRef timer = CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent(), 0, 0, 0, &LoadWebLocalizedStringsTimerCallback, NULL);
-    CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopCommonModes);
-    CFRelease(timer);
-}
-
-#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to