Changeset 247126 in webkit


Ignore:
Timestamp:
Jul 3, 2019 6:13:08 PM (5 years ago)
Author:
Chris Dumez
Message:

StorageManager::suspend() sometimes fails to call its completion handler
https://bugs.webkit.org/show_bug.cgi?id=199482

Reviewed by Youenn Fablet.

Make sure the completion handler gets called in the early return cases.

  • NetworkProcess/WebStorage/StorageManager.cpp:

(WebKit::StorageManager::suspend):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r247125 r247126  
     12019-07-03  Chris Dumez  <cdumez@apple.com>
     2
     3        StorageManager::suspend() sometimes fails to call its completion handler
     4        https://bugs.webkit.org/show_bug.cgi?id=199482
     5
     6        Reviewed by Youenn Fablet.
     7
     8        Make sure the completion handler gets called in the early return cases.
     9
     10        * NetworkProcess/WebStorage/StorageManager.cpp:
     11        (WebKit::StorageManager::suspend):
     12
    1132019-07-03  Youenn Fablet  <youenn@apple.com>
    214
  • trunk/Source/WebKit/NetworkProcess/WebStorage/StorageManager.cpp

    r247094 r247126  
    925925void StorageManager::suspend(CompletionHandler<void()>&& completionHandler)
    926926{
     927    CompletionHandlerCallingScope completionHandlerCaller(WTFMove(completionHandler));
    927928    if (!m_localStorageDatabaseTracker)
    928929        return;
     
    933934    m_state = State::WillSuspend;
    934935
    935     m_queue->dispatch([this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)] () mutable {
     936    m_queue->dispatch([this, protectedThis = makeRef(*this), completionHandler = completionHandlerCaller.release()] () mutable {
    936937        Locker<Lock> stateLocker(m_stateLock);
    937938        ASSERT(m_state != State::Suspended);
Note: See TracChangeset for help on using the changeset viewer.