Disable dangling ptr check for PendingRequest::request_ (fixes #3743)

The InterceptedRequestHandlerWrapper object may be deleted (likely via
~InterceptedRequest) while the task to call
InterceptedRequestHandlerWrapper:ContinueCreateURLLoaderNetworkObserver
is still pending. That binding holds a
WeakPtr<InterceptedRequestHandlerWrapper> (which is now nullptr)
resulting in the bound std::unique_ptr<PendingRequest> being deleted
while still holding a raw_ptr<network::ResourceRequest> to the
already-deleted object. This is always safe (raw_ptr will never be
dereferenced) because of the WeakPtr check.
This commit is contained in:
Marshall Greenblatt 2024-07-17 14:35:30 -04:00
parent 4023fea237
commit 69fbadd0bc
1 changed files with 1 additions and 1 deletions

View File

@ -147,7 +147,7 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
}
const int32_t id_;
raw_ptr<network::ResourceRequest> request_;
raw_ptr<network::ResourceRequest, DisableDanglingPtrDetection> request_;
const bool request_was_redirected_;
OnBeforeRequestResultCallback callback_;
CancelRequestCallback cancel_callback_;