Changeset 218022 in webkit


Ignore:
Timestamp:
Jun 9, 2017 3:16:55 PM (7 years ago)
Author:
Chris Dumez
Message:

Make sure we protect |this| in lambdas in WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver()
https://bugs.webkit.org/show_bug.cgi?id=173174
<rdar://problem/32598919>

Reviewed by Darin Adler.

Follow-up fix to r218006, which caused a crash on the bots. We cannot WTFMove() protectedThis
here because the callback gets called several times.

  • UIProcess/WebResourceLoadStatisticsStore.cpp:

(WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r218021 r218022  
     12017-06-09  Chris Dumez  <cdumez@apple.com>
     2
     3        Make sure we protect |this| in lambdas in WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver()
     4        https://bugs.webkit.org/show_bug.cgi?id=173174
     5        <rdar://problem/32598919>
     6
     7        Reviewed by Darin Adler.
     8
     9        Follow-up fix to r218006, which caused a crash on the bots. We cannot WTFMove() protectedThis
     10        here because the callback gets called several times.
     11
     12        * UIProcess/WebResourceLoadStatisticsStore.cpp:
     13        (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
     14
    1152017-06-09  Jer Noble  <jer.noble@apple.com>
    216
  • trunk/Source/WebKit2/UIProcess/WebResourceLoadStatisticsStore.cpp

    r218006 r218022  
    186186        processStatisticsAndDataRecords();
    187187    });
    188     m_resourceLoadStatisticsStore->setWritePersistentStoreCallback([this, protectedThis = makeRef(*this)]() mutable {
    189         m_statisticsQueue->dispatch([this, protectedThis = WTFMove(protectedThis)] {
     188    m_resourceLoadStatisticsStore->setWritePersistentStoreCallback([this, protectedThis = makeRef(*this)] {
     189        m_statisticsQueue->dispatch([this, protectedThis = protectedThis.copyRef()] {
    190190            writeStoreToDisk();
    191191        });
Note: See TracChangeset for help on using the changeset viewer.