⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 211156 in webkit


Ignore:
Timestamp:
Jan 25, 2017, 12:02:00 PM (10 years ago)
Author:
aakash_jain@apple.com
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

Location:
trunk/Source/WebKit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ios/ChangeLog

    r211033 r211156  
     12017-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
    1122017-01-21  Darin Adler  <darin@apple.com>
    213
  • trunk/Source/WebKit/ios/Misc/WebUIKitSupport.mm

    r209907 r211156  
    3030#import "WebDatabaseManagerInternal.h"
    3131#import "WebKitSystemInterface.h"
    32 #import "WebLocalizableStrings.h"
     32#import "WebLocalizableStringsInternal.h"
    3333#import "WebPlatformStrategies.h"
    3434#import "WebSystemInterface.h"
     
    5050    static bool s_linkedOnOrAfterIOS5 = dyld_get_program_sdk_version() >= DYLD_IOS_VERSION_5_0;
    5151    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
     55static 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
     64static void LoadWebLocalizedStrings()
     65{
     66    CFRunLoopTimerRef timer = CFRunLoopTimerCreate(kCFAllocatorDefault, CFAbsoluteTimeGetCurrent(), 0, 0, 0, &LoadWebLocalizedStringsTimerCallback, NULL);
     67    CFRunLoopAddTimer(CFRunLoopGetCurrent(), timer, kCFRunLoopCommonModes);
     68    CFRelease(timer);
    5269}
    5370
  • trunk/Source/WebKit/mac/ChangeLog

    r211135 r211156  
     12017-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
    1132017-01-24  Zalan Bujtas  <zalan@apple.com>
    214
  • trunk/Source/WebKit/mac/Misc/WebLocalizableStrings.h

    r177825 r211156  
    5050WebLocalizedStringType WebLocalizedString(WebLocalizableStringsBundle* bundle, const char* key);
    5151
    52 #if TARGET_OS_IPHONE
    53 void LoadWebLocalizedStrings(void); // The first WebLocalizedString call can take over 20ms unless this function is called beforehand.
    54 #endif
    55 
    5652#ifdef __cplusplus
    5753}
  • trunk/Source/WebKit/mac/Misc/WebLocalizableStrings.mm

    r182735 r211156  
    3131#import <wtf/Assertions.h>
    3232#import <wtf/MainThread.h>
    33 
    34 #if PLATFORM(IOS)
    35 #import "WebLocalizableStringsInternal.h"
    36 #import <dispatch/dispatch.h>
    37 #endif
    3833
    3934WebLocalizableStringsBundle WebKitLocalizableStringsBundle = { "com.apple.WebKit", 0 };
     
    7368    return result;
    7469}
    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 callback
    79 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.