From 4ab2c9241896fc96ef3ba7f158897b92a90aa463 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Wed, 22 Mar 2017 07:30:36 +0530 Subject: [PATCH] CommonWebContentsDelegate::DestroyWebContents => ResetManagedWebContents --- atom/browser/api/atom_api_web_contents.cc | 2 +- atom/browser/common_web_contents_delegate.cc | 2 +- atom/browser/common_web_contents_delegate.h | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 0f188d0d222e..a0100fd65c6e 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -420,7 +420,7 @@ void WebContents::DestroyWebContents() { // This event is only for internal use, which is emitted when WebContents is // being destroyed. Emit("will-destroy"); - CommonWebContentsDelegate::DestroyWebContents(); + ResetManagedWebContents(); } bool WebContents::DidAddMessageToConsole(content::WebContents* source, diff --git a/atom/browser/common_web_contents_delegate.cc b/atom/browser/common_web_contents_delegate.cc index 89c1e372558c..59ffc7dcbc08 100644 --- a/atom/browser/common_web_contents_delegate.cc +++ b/atom/browser/common_web_contents_delegate.cc @@ -183,7 +183,7 @@ void CommonWebContentsDelegate::SetOwnerWindow( web_contents->SetUserData(relay->key, relay); } -void CommonWebContentsDelegate::DestroyWebContents() { +void CommonWebContentsDelegate::ResetManagedWebContents() { web_contents_.reset(); } diff --git a/atom/browser/common_web_contents_delegate.h b/atom/browser/common_web_contents_delegate.h index c08f8d246cee..27209411c72b 100644 --- a/atom/browser/common_web_contents_delegate.h +++ b/atom/browser/common_web_contents_delegate.h @@ -42,9 +42,6 @@ class CommonWebContentsDelegate void SetOwnerWindow(content::WebContents* web_contents, NativeWindow* owner_window); - // Destroy the managed InspectableWebContents object. - void DestroyWebContents(); - // Returns the WebContents managed by this delegate. content::WebContents* GetWebContents() const; @@ -114,6 +111,9 @@ class CommonWebContentsDelegate std::string* name, std::string* class_name) override; #endif + // Destroy the managed InspectableWebContents object. + void ResetManagedWebContents(); + private: // Callback for when DevToolsSaveToFile has completed. void OnDevToolsSaveToFile(const std::string& url);