Changeset 199088 in webkit


Ignore:
Timestamp:
Apr 5, 2016 6:31:13 PM (8 years ago)
Author:
Brent Fulgham
Message:

Correct applicationWillTerminate logic for ResourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=156249
<rdar://problem/25179611>

Reviewed by Andy Estes.

The applicationWillTerminate handling for ResourceLoadStatistics incorrectly
assumes that a ResourceLoadStatistics object will always be present.

  1. The termination handling for 'dataStoresWithStorageManagers' should be calling 'applicationWillTerminate' on any ResourceLoadStatistics objects attached to the dataStore.
  2. platformInitialize should null-check before attempting to dispatch.
  3. platformDestroy should null check before attempting to dispatch.
  • UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:

(WebKit::WebsiteDataStore::platformInitialize):
(WebKit::WebsiteDataStore::platformDestroy): Invoke 'applicationWillTerminate' on
m_resourceLoadStatistics if present.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r199081 r199088  
     12016-04-05  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Correct applicationWillTerminate logic for ResourceLoadStatistics
     4        https://bugs.webkit.org/show_bug.cgi?id=156249
     5        <rdar://problem/25179611>
     6
     7        Reviewed by Andy Estes.
     8
     9        The applicationWillTerminate handling for ResourceLoadStatistics incorrectly
     10        assumes that a ResourceLoadStatistics object will always be present.
     11        1. The termination handling for 'dataStoresWithStorageManagers' should be
     12           calling 'applicationWillTerminate' on any ResourceLoadStatistics
     13           objects attached to the dataStore.
     14        2. platformInitialize should null-check before attempting to dispatch.
     15        3. platformDestroy should null check before attempting to dispatch.
     16
     17        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
     18        (WebKit::WebsiteDataStore::platformInitialize):
     19        (WebKit::WebsiteDataStore::platformDestroy): Invoke 'applicationWillTerminate' on
     20        m_resourceLoadStatistics if present.
     21
    1222016-04-05  Youenn Fablet  <youenn.fablet@crf.canon.fr>
    223
  • trunk/Source/WebKit2/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm

    r197592 r199088  
    6161#endif
    6262        terminationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:notificationName object:nil queue:nil usingBlock:^(NSNotification *note) {
    63             for (auto& dataStore : dataStoresWithStorageManagers())
     63            for (auto& dataStore : dataStoresWithStorageManagers()) {
    6464                dataStore->m_storageManager->applicationWillTerminate();
    65 
    66             m_resourceLoadStatistics->applicationWillTerminate();
     65                if (dataStore->m_resourceLoadStatistics)
     66                    dataStore->m_resourceLoadStatistics->applicationWillTerminate();
     67            }
    6768        }];
    6869    }
     
    7071    ASSERT(!dataStoresWithStorageManagers().contains(this));
    7172    dataStoresWithStorageManagers().append(this);
    72     m_resourceLoadStatistics->readDataFromDiskIfNeeded();
     73    if (m_resourceLoadStatistics)
     74        m_resourceLoadStatistics->readDataFromDiskIfNeeded();
    7375}
    7476
    7577void WebsiteDataStore::platformDestroy()
    7678{
     79    if (m_resourceLoadStatistics)
     80        m_resourceLoadStatistics->applicationWillTerminate();
     81
    7782    if (!m_storageManager)
    7883        return;
Note: See TracChangeset for help on using the changeset viewer.