[webkit-changes] [WebKit/WebKit] 288e0b: BlobLoader should not pass itself to its completio...

youennf noreply at github.com
Tue Sep 17 00:18:51 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 288e0b49de4f6ba5b1c221242c1f5e859d833231
      https://github.com/WebKit/WebKit/commit/288e0b49de4f6ba5b1c221242c1f5e859d833231
  Author: Youenn Fablet <youenn at apple.com>
  Date:   2024-09-17 (Tue, 17 Sep 2024)

  Changed paths:
    M Source/WebCore/fileapi/Blob.cpp
    M Source/WebCore/fileapi/Blob.h
    M Source/WebCore/fileapi/BlobLoader.h
    M Source/WebCore/fileapi/NetworkSendQueue.cpp
    M Source/WebCore/page/ShareDataReader.cpp

  Log Message:
  -----------
  BlobLoader should not pass itself to its completion handler when cancelled
rdar://135720087
https://bugs.webkit.org/show_bug.cgi?id=279355

Reviewed by Alex Christensen.

https://commits.webkit.org/228429@main made BlobLoader call its completion handler in the cancel case.
This is notably triggered when BlobLoader is destroyed while still loading.
FormDataConsumer lambda would then be called within its destructor.

We recently introduced ref counting of FormDataConsumer which triggered refing of FormDataConsumer within its destructor, which triggers an assert.
We fix this by having BlobLoader NOT call its completion callback in the cancel case.

Covered by existing tests.

* Source/WebCore/fileapi/Blob.cpp:
(WebCore::Blob::loadBlob):
* Source/WebCore/fileapi/Blob.h:
* Source/WebCore/fileapi/BlobLoader.h:
(WebCore::BlobLoader::BlobLoader):
(WebCore::BlobLoader::cancel):
(WebCore::BlobLoader::didFinishLoading):
(WebCore::BlobLoader::didFail):
* Source/WebCore/fileapi/NetworkSendQueue.cpp:
(WebCore::NetworkSendQueue::clear):
* Source/WebCore/page/ShareDataReader.cpp:
(WebCore::ShareDataReader::cancel):

Canonical link: https://commits.webkit.org/283752@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list