Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 058d1da0540851ab8eb186817ce9b74c833d7219
      
https://github.com/WebKit/WebKit/commit/058d1da0540851ab8eb186817ce9b74c833d7219
  Author: Chris Dumez <[email protected]>
  Date:   2025-03-13 (Thu, 13 Mar 2025)

  Changed paths:
    M Source/WebCore/loader/DocumentLoader.cpp
    M Source/WebCore/loader/DocumentLoader.h
    M Source/WebCore/loader/mac/DocumentLoaderMac.cpp

  Log Message:
  -----------
  Crash under DocumentLoader::removePlugInStreamLoader(WebCore::ResourceLoader&)
https://bugs.webkit.org/show_bug.cgi?id=289709
rdar://146732733

Reviewed by Per Arne Vollan.

It looks like it was crashing when dereferencing `loader.identifier()`, which
is a std::optional and thus can be std::nullopt. To address the issue, I have
refactored the code so that we use a HashSet instead of a HashMap whose key
is a ResourceLoadIdentifier. Using a ResourceLoadIdentifier is risky and may
cause leaks since the ResourceLoader's ResourceLoadIdentifier gets can get
nulled out.

* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::cancelAll):
(WebCore::setAllDefersLoading):
(WebCore::DocumentLoader::addSubresourceLoader):
(WebCore::DocumentLoader::removeSubresourceLoader):
(WebCore::DocumentLoader::addPlugInStreamLoader):
(WebCore::DocumentLoader::removePlugInStreamLoader):
(WebCore::DocumentLoader::subresourceLoaderFinishedLoadingOnePart):
* Source/WebCore/loader/DocumentLoader.h:
* Source/WebCore/loader/mac/DocumentLoaderMac.cpp:
(WebCore::scheduleAll):
(WebCore::unscheduleAll):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to