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

Changeset 254604 in webkit


Ignore:
Timestamp:
Jan 15, 2020, 11:15:27 AM (7 years ago)
Author:
Alan Coon
Message:

Cherry-pick r254254. rdar://problem/58548978

WebKitTestRunner leaks objects in a top-level autoreleasePool that's never cleared
<​https://webkit.org/b/205950>
<rdar://problem/50987831>

Reviewed by Joseph Pecoraro.

Source/WebKit:

  • UIProcess/mac/WebPreferencesMac.mm: (WebKit::WebPreferences::platformInitializeStore):
  • Add an @autoreleasepool block around the contents of this method since it generates numerous autoreleased objects when run.

Tools:

  • WebKitTestRunner/ios/mainIOS.mm: (main):
  • Add an @autoreleasepool block around a line of code that generates autoreleased objects. These objects would never be released for the life of the process prior to this change.
  • WebKitTestRunner/mac/main.mm: (main):
  • Move instantiation of WTR::TestController outside of @autoreleasepool block so the pool can be drained while running tests. Prior to this change, this autoreleasePool would never be drained.

git-svn-id: ​https://svn.webkit.org/repository/webkit/trunk@254254 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-609-branch
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-609-branch/Source/WebKit/ChangeLog

    r254601 r254604  
     12020-01-14  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r254254. rdar://problem/58548978
     4
     5    WebKitTestRunner leaks objects in a top-level autoreleasePool that's never cleared
     6    <https://webkit.org/b/205950>
     7    <rdar://problem/50987831>
     8   
     9    Reviewed by Joseph Pecoraro.
     10   
     11    Source/WebKit:
     12   
     13    * UIProcess/mac/WebPreferencesMac.mm:
     14    (WebKit::WebPreferences::platformInitializeStore):
     15    - Add an @autoreleasepool block around the contents of
     16      this method since it generates numerous autoreleased
     17      objects when run.
     18   
     19    Tools:
     20   
     21    * WebKitTestRunner/ios/mainIOS.mm:
     22    (main):
     23    - Add an @autoreleasepool block around a line of code
     24      that generates autoreleased objects.  These objects
     25      would never be released for the life of the process
     26      prior to this change.
     27    * WebKitTestRunner/mac/main.mm:
     28    (main):
     29    - Move instantiation of WTR::TestController outside of
     30      @autoreleasepool block so the pool can be drained
     31      while running tests.  Prior to this change, this
     32      autoreleasePool would never be drained.
     33   
     34   
     35    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     36
     37    2020-01-09  David Kilzer  <ddkilzer@apple.com>
     38
     39            WebKitTestRunner leaks objects in a top-level autoreleasePool that's never cleared
     40            <https://webkit.org/b/205950>
     41            <rdar://problem/50987831>
     42
     43            Reviewed by Joseph Pecoraro.
     44
     45            * UIProcess/mac/WebPreferencesMac.mm:
     46            (WebKit::WebPreferences::platformInitializeStore):
     47            - Add an @autoreleasepool block around the contents of
     48              this method since it generates numerous autoreleased
     49              objects when run.
     50
    1512020-01-14  Alan Coon  <alancoon@apple.com>
    252
  • branches/safari-609-branch/Source/WebKit/UIProcess/mac/WebPreferencesMac.mm

    r247043 r254604  
    139139void WebPreferences::platformInitializeStore()
    140140{
     141    @autoreleasepool {
    141142#define INITIALIZE_DEBUG_PREFERENCE_FROM_NSUSERDEFAULTS(KeyUpper, KeyLower, TypeName, Type, DefaultValue, HumanReadableName, HumanReadableDescription) \
    142     setDebug##TypeName##ValueIfInUserDefaults(m_identifier, m_keyPrefix, m_globalDebugKeyPrefix, WebPreferencesKey::KeyLower##Key(), m_store);
    143 
    144     FOR_EACH_WEBKIT_DEBUG_PREFERENCE(INITIALIZE_DEBUG_PREFERENCE_FROM_NSUSERDEFAULTS)
     143        setDebug##TypeName##ValueIfInUserDefaults(m_identifier, m_keyPrefix, m_globalDebugKeyPrefix, WebPreferencesKey::KeyLower##Key(), m_store);
     144
     145        FOR_EACH_WEBKIT_DEBUG_PREFERENCE(INITIALIZE_DEBUG_PREFERENCE_FROM_NSUSERDEFAULTS)
    145146
    146147#undef INITIALIZE_DEBUG_PREFERENCE_FROM_NSUSERDEFAULTS
    147148
    148     if (!m_identifier)
    149         return;
     149        if (!m_identifier)
     150            return;
    150151
    151152#define INITIALIZE_PREFERENCE_FROM_NSUSERDEFAULTS(KeyUpper, KeyLower, TypeName, Type, DefaultValue, HumanReadableName, HumanReadableDescription) \
    152     Type user##KeyUpper##Value; \
    153     if (platformGet##TypeName##UserValueForKey(WebPreferencesKey::KeyLower##Key(), user##KeyUpper##Value)) \
    154         m_store.set##TypeName##ValueForKey(WebPreferencesKey::KeyLower##Key(), user##KeyUpper##Value);
    155 
    156     FOR_EACH_WEBKIT_PREFERENCE(INITIALIZE_PREFERENCE_FROM_NSUSERDEFAULTS)
     153        Type user##KeyUpper##Value; \
     154        if (platformGet##TypeName##UserValueForKey(WebPreferencesKey::KeyLower##Key(), user##KeyUpper##Value)) \
     155            m_store.set##TypeName##ValueForKey(WebPreferencesKey::KeyLower##Key(), user##KeyUpper##Value);
     156
     157        FOR_EACH_WEBKIT_PREFERENCE(INITIALIZE_PREFERENCE_FROM_NSUSERDEFAULTS)
    157158
    158159#undef INITIALIZE_PREFERENCE_FROM_NSUSERDEFAULTS
     160    }
    159161}
    160162
  • branches/safari-609-branch/Tools/ChangeLog

    r254581 r254604  
     12020-01-14  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r254254. rdar://problem/58548978
     4
     5    WebKitTestRunner leaks objects in a top-level autoreleasePool that's never cleared
     6    <https://webkit.org/b/205950>
     7    <rdar://problem/50987831>
     8   
     9    Reviewed by Joseph Pecoraro.
     10   
     11    Source/WebKit:
     12   
     13    * UIProcess/mac/WebPreferencesMac.mm:
     14    (WebKit::WebPreferences::platformInitializeStore):
     15    - Add an @autoreleasepool block around the contents of
     16      this method since it generates numerous autoreleased
     17      objects when run.
     18   
     19    Tools:
     20   
     21    * WebKitTestRunner/ios/mainIOS.mm:
     22    (main):
     23    - Add an @autoreleasepool block around a line of code
     24      that generates autoreleased objects.  These objects
     25      would never be released for the life of the process
     26      prior to this change.
     27    * WebKitTestRunner/mac/main.mm:
     28    (main):
     29    - Move instantiation of WTR::TestController outside of
     30      @autoreleasepool block so the pool can be drained
     31      while running tests.  Prior to this change, this
     32      autoreleasePool would never be drained.
     33   
     34   
     35    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254254 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     36
     37    2020-01-09  David Kilzer  <ddkilzer@apple.com>
     38
     39            WebKitTestRunner leaks objects in a top-level autoreleasePool that's never cleared
     40            <https://webkit.org/b/205950>
     41            <rdar://problem/50987831>
     42
     43            Reviewed by Joseph Pecoraro.
     44
     45            * WebKitTestRunner/ios/mainIOS.mm:
     46            (main):
     47            - Add an @autoreleasepool block around a line of code
     48              that generates autoreleased objects.  These objects
     49              would never be released for the life of the process
     50              prior to this change.
     51            * WebKitTestRunner/mac/main.mm:
     52            (main):
     53            - Move instantiation of WTR::TestController outside of
     54              @autoreleasepool block so the pool can be drained
     55              while running tests.  Prior to this change, this
     56              autoreleasePool would never be drained.
     57
    1582020-01-14  Alan Coon  <alancoon@apple.com>
    259
  • branches/safari-609-branch/Tools/WebKitTestRunner/ios/mainIOS.mm

    r244955 r254604  
    6767    _argv = argv;
    6868
    69     [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitLinkedOnOrAfterEverything"];
     69    @autoreleasepool {
     70        [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"WebKitLinkedOnOrAfterEverything"];
     71    }
    7072
    7173    UIApplicationMain(argc, (char**)argv, @"WebKitTestRunnerApp", @"WebKitTestRunnerApp");
  • branches/safari-609-branch/Tools/WebKitTestRunner/mac/main.mm

    r235837 r254604  
    6565        setDefaultsToConsistentValuesForTesting();
    6666        disableAppNapInUIProcess(); // For secondary processes, app nap is disabled using WKPreferencesSetPageVisibilityBasedProcessSuppressionEnabled().
    67         WTR::TestController controller(argc, argv);
    6867    }
     68    WTR::TestController controller(argc, argv);
    6969    return 0;
    7070}
Note: See TracChangeset for help on using the changeset viewer.