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

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: fix typo, rebase 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 e57d0f3a5c31821180bde0f7d2c3908d70bdb2a4..35042b11ee54da7c4631dc7762f065bb03dd44db 100644
--- a/content/browser/web_contents/web_contents_impl.h
+++ b/content/browser/web_contents/web_contents_impl.h
@@ -508,6 +508,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);
@@ -520,7 +522,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);
+
+ // Creates and adds to the map a destruction observer watching |web_contents|.
+ // 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,
@@ -743,6 +753,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