Fix potential dangling PendingRequest::request_ (see #3239)

See https://magpcss.org/ceforum/viewtopic.php?f=6&t=19802 for error.
This commit is contained in:
Marshall Greenblatt 2024-06-04 14:11:57 -04:00
parent e4bb51f6f6
commit 47798d3dbf
1 changed files with 2 additions and 1 deletions

View File

@ -140,10 +140,11 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
void Run(InterceptedRequestHandlerWrapper* self) {
self->OnBeforeRequest(id_, request_, request_was_redirected_,
std::move(callback_), std::move(cancel_callback_));
request_ = nullptr;
}
const int32_t id_;
const raw_ptr<network::ResourceRequest> request_;
raw_ptr<network::ResourceRequest> request_;
const bool request_was_redirected_;
OnBeforeRequestResultCallback callback_;
CancelRequestCallback cancel_callback_;