mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix issues with request callbacks during browser shutdown (see issue #2622).
The behavior has changed as follows with NetworkService enabled: - All pending and in-progress requests will now be aborted when the CEF context or associated browser is destroyed. The OnResourceLoadComplete callback will now also be called in this case for in-progress requests that have a handler. - The CefResourceHandler::Cancel method will now always be called when resource handling is complete, irrespective of whether handling completed successfully. - Request callbacks that arrive after the OnBeforeClose callback for the associated browser (which may happen for in-progress requests that are aborted on browser destruction) will now always have a non-nullptr CefBrowser parameter. - Allow empty parameters to CefRequest and CefResponse methods where it makes sense (e.g. resetting default response state, or clearing a referrer value). - Fixed a reference loop that was keeping CefResourceHandler objects from being destroyed if they were holding a callback reference (from ProcessRequest, ReadResponse, etc.) during CEF context or associated browser destruction. - Fixed an issue where the main frame was not detached on browser destruction which could cause a crash due to RFH use-after-free (see issue #2498). To test: All unit tests pass as expected.
This commit is contained in:
@ -99,7 +99,7 @@ class CefRequest : public virtual CefBaseRefCounted {
|
||||
// fully qualified with an HTTP or HTTPS scheme component. Any username,
|
||||
// password or ref component will be removed.
|
||||
///
|
||||
/*--cef()--*/
|
||||
/*--cef(optional_param=referrer_url)--*/
|
||||
virtual void SetReferrer(const CefString& referrer_url,
|
||||
ReferrerPolicy policy) = 0;
|
||||
|
||||
@ -154,7 +154,7 @@ class CefRequest : public virtual CefBaseRefCounted {
|
||||
// existing values will not be overwritten. The Referer value cannot be set
|
||||
// using this method.
|
||||
///
|
||||
/*--cef()--*/
|
||||
/*--cef(optional_param=value)--*/
|
||||
virtual void SetHeaderByName(const CefString& name,
|
||||
const CefString& value,
|
||||
bool overwrite) = 0;
|
||||
@ -193,7 +193,7 @@ class CefRequest : public virtual CefBaseRefCounted {
|
||||
// Set the URL to the first party for cookies used in combination with
|
||||
// CefURLRequest.
|
||||
///
|
||||
/*--cef()--*/
|
||||
/*--cef(optional_param=url)--*/
|
||||
virtual void SetFirstPartyForCookies(const CefString& url) = 0;
|
||||
|
||||
///
|
||||
|
Reference in New Issue
Block a user