Browse Source

CommonWebContentsDelegate::DestroyWebContents => ResetManagedWebContents

deepak1556 8 years ago
parent
commit
4ab2c92418

+ 1 - 1
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,

+ 1 - 1
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();
 }
 

+ 3 - 3
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);