Compare commits

...

2 Commits

Author SHA1 Message Date
Marshall Greenblatt 5bafd32ee1 cefclient: Allow download with --hide-controls (fixes #3742) 2024-07-17 15:07:18 -04:00
Marshall Greenblatt 9ca230c960 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.
2024-07-17 14:46:59 -04:00
2 changed files with 1 additions and 7 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_;

View File

@ -850,12 +850,6 @@ bool ClientHandler::CanDownload(CefRefPtr<CefBrowser> browser,
const CefString& request_method) {
CEF_REQUIRE_UI_THREAD();
if (!with_controls_) {
// Block the download.
LOG(INFO) << "Blocking download";
return false;
}
// Allow the download.
return true;
}