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

Unified Diff: content/browser/web_contents/web_contents_impl.h

Issue 14651029: content: Remove usage of NOTIFICATION_WEB_CONTENTS_DESTROYED from content (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybots Created 7 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/browser/web_contents/web_contents_impl.h
diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
index 3cca07487c98c5e09723e3630a978d4b3b8c66b7..ab71d598eecf85bc1a36f7a4b02377faab46585c 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -504,6 +504,8 @@ class CONTENT_EXPORT WebContentsImpl
// TODO(brettw) TestWebContents shouldn't exist!
friend class TestWebContents;
+ class DestructionObserver;
+
// See WebContents::Create for a description of these parameters.
WebContentsImpl(BrowserContext* browser_context,
WebContentsImpl* opener);
@@ -516,7 +518,15 @@ class CONTENT_EXPORT WebContentsImpl
void RemoveObserver(WebContentsObserver* observer);
// Clears this tab's opener if it has been closed.
- void OnWebContentsDestroyed(WebContents* web_contents);
+ void OnWebContentsDestroyed(WebContentsImpl* web_contents);
+
+ // Creats and adds to the map a destruction observer watching |web_contents|.
Avi (use Gerrit) 2013/05/15 19:22:20 typo
Paweł Hajdan Jr. 2013/05/21 18:59:15 Done.
+ // No-op if such an observer already exists.
+ void AddDestructionObserver(WebContentsImpl* web_contents);
+
+ // Deletes and removes from the map a destruction observer
+ // watching |web_contents|. No-op if there is no such observer.
+ void RemoveDestructionObserver(WebContentsImpl* web_contents);
// Callback function when showing JS dialogs.
void OnDialogClosed(RenderViewHost* rvh,
@@ -738,6 +748,9 @@ class CONTENT_EXPORT WebContentsImpl
typedef std::map<int, RenderWidgetHostView*> PendingWidgetViews;
PendingWidgetViews pending_widget_views_;
+ typedef std::map<WebContentsImpl*, DestructionObserver*> DestructionObservers;
+ DestructionObservers destruction_observers_;
+
// A list of observers notified when page state changes. Weak references.
// This MUST be listed above render_manager_ since at destruction time the
// latter might cause RenderViewHost's destructor to call us and we might use
« no previous file with comments | « content/browser/web_contents/interstitial_page_impl.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698