Changeset 167722 in webkit


Ignore:
Timestamp:
Apr 23, 2014 2:22:53 PM (10 years ago)
Author:
akling@apple.com
Message:

[iOS] Memory pressure notification should fire on main thread.
<https://webkit.org/b/132074>

Rejig the memory pressure notification to fire on the main queue
directly instead of rerouting it manually.

Reviewed by Mark Rowe.

  • platform/cocoa/MemoryPressureHandlerCocoa.mm:

(WebCore::MemoryPressureHandler::install):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r167721 r167722  
     12014-04-23  Andreas Kling  <akling@apple.com>
     2
     3        [iOS] Memory pressure notification should fire on main thread.
     4        <https://webkit.org/b/132074>
     5
     6        Rejig the memory pressure notification to fire on the main queue
     7        directly instead of rerouting it manually.
     8
     9        Reviewed by Mark Rowe.
     10
     11        * platform/cocoa/MemoryPressureHandlerCocoa.mm:
     12        (WebCore::MemoryPressureHandler::install):
     13
    1142014-04-23  Commit Queue  <commit-queue@webkit.org>
    215
  • trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm

    r167711 r167722  
    8282    dispatch_async(dispatch_get_main_queue(), ^{
    8383#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000
    84         _cache_event_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYSTATUS, 0, DISPATCH_MEMORYSTATUS_PRESSURE_WARN, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0));
     84        _cache_event_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYSTATUS, 0, DISPATCH_MEMORYSTATUS_PRESSURE_WARN, dispatch_get_main_queue());
    8585#elif PLATFORM(MAC) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
    8686        _cache_event_source = wkCreateMemoryStatusPressureCriticalDispatchOnMainQueue();
     
    9191            dispatch_set_context(_cache_event_source, this);
    9292            dispatch_source_set_event_handler(_cache_event_source, ^{
    93                 dispatch_async(dispatch_get_main_queue(), ^{
    94                     memoryPressureHandler().respondToMemoryPressure();
    95                 });
     93                memoryPressureHandler().respondToMemoryPressure();
    9694            });
    9795            dispatch_resume(_cache_event_source);
Note: See TracChangeset for help on using the changeset viewer.