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

Changeset 230771 in webkit


Ignore:
Timestamp:
Apr 18, 2018, 11:55:59 AM (8 years ago)
Author:
Brent Fulgham
Message:

Avoid crash if ITP Debug mode is on, but ResourceLoadStatistics are not being used
​https://bugs.webkit.org/show_bug.cgi?id=184739
<rdar://problem/39287964>

Reviewed by David Kilzer.

If a user has the ResourceLoadStatistics logic turned off, but has the ITP Debug experimental
flag turned on, you can cause a crash.

This is because the WebsiteDataStore for the process doesn't bother creating a ResourceLoadStatisticsStore
if the statistics machinery is not running. The ITP debug flag was being blindly set without checking
if the statistics store exists or not, which can cause a crash.

  • UIProcess/WebsiteData/WebsiteDataStore.cpp:

(WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode): Check if the statistics store exists
before calling functions on it.

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r230766 r230771  
     12018-04-18  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Avoid crash if ITP Debug mode is on, but ResourceLoadStatistics are not being used
     4        https://bugs.webkit.org/show_bug.cgi?id=184739
     5        <rdar://problem/39287964>
     6
     7        Reviewed by David Kilzer.
     8
     9        If a user has the ResourceLoadStatistics logic turned off, but has the ITP Debug experimental
     10        flag turned on, you can cause a crash.
     11
     12        This is because the WebsiteDataStore for the process doesn't bother creating a ResourceLoadStatisticsStore
     13        if the statistics machinery is not running. The ITP debug flag was being blindly set without checking
     14        if the statistics store exists or not, which can cause a crash.
     15
     16        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
     17        (WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode): Check if the statistics store exists
     18        before calling functions on it.
     19
    1202018-04-18  Paul Knight  <pknight@apple.com>
    221
  • trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp

    r230219 r230771  
    14361436{
    14371437    m_resourceLoadStatisticsDebugMode = enabled;
    1438     m_resourceLoadStatistics->setResourceLoadStatisticsDebugMode(enabled);
     1438    if (m_resourceLoadStatistics)
     1439        m_resourceLoadStatistics->setResourceLoadStatisticsDebugMode(enabled);
    14391440}
    14401441
Note: See TracChangeset for help on using the changeset viewer.