Chromium Code Reviews| 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 |