CommonWebContentsDelegate::DestroyWebContents => ResetManagedWebContents
authordeepak1556 <hop2deep@gmail.com>
Wed, 22 Mar 2017 02:00:36 +0000 (07:30 +0530)
committerdeepak1556 <hop2deep@gmail.com>
Wed, 22 Mar 2017 02:00:36 +0000 (07:30 +0530)
atom/browser/api/atom_api_web_contents.cc
atom/browser/common_web_contents_delegate.cc
atom/browser/common_web_contents_delegate.h

index 0f188d0d222e7dd61728bff052d4eec347b93406..a0100fd65c6ebe3e1b19a702b83baaf806e5d1ba 100644 (file)
@@ -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,
index 89c1e372558c3022063aec9daca47a337a554551..59ffc7dcbc08df7ada5d3ed372c992c8e1352c58 100644 (file)
@@ -183,7 +183,7 @@ void CommonWebContentsDelegate::SetOwnerWindow(
   web_contents->SetUserData(relay->key, relay);
 }
 
-void CommonWebContentsDelegate::DestroyWebContents() {
+void CommonWebContentsDelegate::ResetManagedWebContents() {
   web_contents_.reset();
 }
 
index c08f8d246cee6845d1d86486033047ef36a407a3..27209411c72b1b7bdd5c75c1feebb2c727197c59 100644 (file)
@@ -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);