Chromium Code Reviews| Index: chrome/browser/guest_view/guest_view_base.h |
| diff --git a/chrome/browser/guest_view/guest_view_base.h b/chrome/browser/guest_view/guest_view_base.h |
| index 76ea724d5194dca28902f45f73d8d843a8814183..3fd66978d9068260e1edde1fd6bf8f4128268645 100644 |
| --- a/chrome/browser/guest_view/guest_view_base.h |
| +++ b/chrome/browser/guest_view/guest_view_base.h |
| @@ -47,7 +47,8 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate { |
| static GuestViewBase* Create(content::WebContents* guest_web_contents, |
| const std::string& embedder_extension_id, |
| - const std::string& view_type); |
| + const std::string& view_type, |
| + const base::WeakPtr<GuestViewBase>& opener); |
| static GuestViewBase* FromWebContents(content::WebContents* web_contents); |
| @@ -71,6 +72,8 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate { |
| virtual const char* GetViewType() const = 0; |
| + base::WeakPtr<GuestViewBase> AsWeakPtr(); |
| + |
| virtual void Attach(content::WebContents* embedder_web_contents, |
| const base::DictionaryValue& args); |
| @@ -106,9 +109,14 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate { |
| // Returns the embedder's process ID. |
| int embedder_render_process_id() const { return embedder_render_process_id_; } |
| + // BrowserPluginGuestDelegate implementation. |
| + virtual content::WebContents* GetOpener() const OVERRIDE; |
| + virtual void SetOpener(content::WebContents* opener) OVERRIDE; |
| + |
| protected: |
| GuestViewBase(content::WebContents* guest_web_contents, |
| - const std::string& embedder_extension_id); |
| + const std::string& embedder_extension_id, |
| + const base::WeakPtr<GuestViewBase>& opener); |
| virtual ~GuestViewBase(); |
| // Dispatches an event |event_name| to the embedder with the |event| fields. |
| @@ -133,6 +141,9 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate { |
| // the guest is attached to a particular embedder. |
| std::deque<linked_ptr<Event> > pending_events_; |
| + // Returns a WeakPtr to this GuestView. |
|
lazyboy
2014/05/01 20:06:59
1) this is a member so doc shouldn't start /w "ret
Fady Samuel
2014/05/01 21:05:28
Done.
|
| + base::WeakPtr<GuestViewBase> opener_; |
| + |
| // This is used to ensure pending tasks will not fire after this object is |
| // destroyed. |
| base::WeakPtrFactory<GuestViewBase> weak_ptr_factory_; |