cef/patch/patches/content_mojo_3123.patch
2021-07-27 19:03:09 -04:00

24 lines
982 B
Diff

diff --git content/public/browser/document_service_base.h content/public/browser/document_service_base.h
index a7d9457f7561a..3296e65dcb0f5 100644
--- content/public/browser/document_service_base.h
+++ content/public/browser/document_service_base.h
@@ -83,6 +83,8 @@ class DocumentServiceBase : public Interface, public WebContentsObserver {
void DidFinishNavigation(NavigationHandle* navigation_handle) final {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
+ if (!ShouldCloseOnFinishNavigation())
+ return;
if (!navigation_handle->HasCommitted() ||
navigation_handle->IsSameDocument() ||
@@ -96,6 +98,9 @@ class DocumentServiceBase : public Interface, public WebContentsObserver {
}
}
+ // Used for CEF bindings that outlive navigation.
+ virtual bool ShouldCloseOnFinishNavigation() const { return true; }
+
// Stops observing WebContents and delete |this|.
void Close() {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);