Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2810)

Unified Diff: content/public/browser/web_contents_observer.h

Issue 257153003: We have a problem in the process on destroying WebContentsImpl because (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Removed what was added in https://codereview.chromium.org/239393009 Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/browser/web_contents_observer.h
diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
index 9fae539faf6e3a97c3198e6d95a3e703202a7982..de85be5a548bff75e6fcc7d60088d898930f65aa 100644
--- a/content/public/browser/web_contents_observer.h
+++ b/content/public/browser/web_contents_observer.h
@@ -293,9 +293,9 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener,
WebContents* new_web_contents) {}
// Invoked when the WebContents is being destroyed. Gives subclasses a chance
- // to cleanup. At the time this is invoked |web_contents()| returns NULL.
- // It is safe to delete 'this' from here.
- virtual void WebContentsDestroyed(WebContents* web_contents) {}
+ // to cleanup. After the whole loop over all WebContentsObservers
+ // has been finished, web_contents() returns NULL.
jam 2014/05/05 17:46:46 nit: don't indent before hitting 80 chars
zverre 2014/05/06 09:37:26 Done.
+ virtual void WebContentsDestroyed() {}
// Called when the user agent override for a WebContents has been changed.
virtual void UserAgentOverrideSet(const std::string& user_agent) {}
@@ -359,9 +359,9 @@ class CONTENT_EXPORT WebContentsObserver : public IPC::Listener,
private:
friend class WebContentsImpl;
- // Invoked from WebContentsImpl. Invokes WebContentsDestroyed and NULL out
- // |web_contents_|.
- void WebContentsImplDestroyed();
+ // Resets |web_contents_| pointer to NULL as a final step in the process
+ // of destroying the WebContents. See comments near WebContentsDestroyed.
jam 2014/05/05 17:46:46 no need to comment a simple setter, remove this wh
zverre 2014/05/06 09:37:26 Done.
+ void reset_web_contents() { web_contents_ = NULL; }
WebContentsImpl* web_contents_;

Powered by Google App Engine
This is Rietveld 408576698