Skip to content

Commit

Permalink
Disable dangling ptr check for PendingRequest::request_ (fixes #3743)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
magreenblatt committed Jul 17, 2024
1 parent 4023fea commit 69fbadd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down

0 comments on commit 69fbadd

Please sign in to comment.