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

Unified Diff: content/browser/tab_contents/tab_contents_delegate.h

Issue 7244009: Helper functions for tracking stale TabContentsDelegate's. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Explicit constructor Created 9 years, 6 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
« no previous file with comments | « content/browser/tab_contents/tab_contents.cc ('k') | content/browser/tab_contents/tab_contents_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/tab_contents_delegate.h
diff --git a/content/browser/tab_contents/tab_contents_delegate.h b/content/browser/tab_contents/tab_contents_delegate.h
index 3ddbbf8faf6b5b75273a1256ef719d2b09ffcef7..5ba62cf0f0fd858f097316255a991964a17c5f95 100644
--- a/content/browser/tab_contents/tab_contents_delegate.h
+++ b/content/browser/tab_contents/tab_contents_delegate.h
@@ -6,6 +6,7 @@
#define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_
#pragma once
+#include <set>
#include <string>
#include "base/basictypes.h"
@@ -41,6 +42,8 @@ class TabContents;
// TabContents and to provide necessary functionality.
class TabContentsDelegate {
public:
+ TabContentsDelegate();
+
// When a main frame navigation occurs CreateMainFrameCommitDetails() is
// invoked. The |MainFrameCommitDetails| returned from
// CreateMainFrameCommitDetails() are then passed to
@@ -304,6 +307,18 @@ class TabContentsDelegate {
protected:
virtual ~TabContentsDelegate();
+
+ private:
+ friend class TabContents;
+
+ // Called when |this| becomes the TabContentsDelegate for |source|.
+ void Attach(TabContents* source);
+
+ // Called when |this| is no longer the TabContentsDelegate for |source|.
+ void Detach(TabContents* source);
+
+ // The TabContents that this is currently a delegate for.
+ std::set<TabContents*> attached_contents_;
};
#endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_
« no previous file with comments | « content/browser/tab_contents/tab_contents.cc ('k') | content/browser/tab_contents/tab_contents_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698