Chromium Code Reviews| Index: chrome/browser/guestview/guestview.h |
| diff --git a/chrome/browser/guestview/guestview.h b/chrome/browser/guestview/guestview.h |
| index 70dda8fa9997b407b37280f0cf1724c99cbac214..a8c2d5fcb11a9b8bec7bca3bac9fc4eaa8ed5cf6 100644 |
| --- a/chrome/browser/guestview/guestview.h |
| +++ b/chrome/browser/guestview/guestview.h |
| @@ -46,7 +46,8 @@ class GuestView : public content::BrowserPluginGuestDelegate { |
| static GuestView* Create(content::WebContents* guest_web_contents, |
| const std::string& embedder_extension_id, |
| - Type view_type); |
| + Type view_type, |
| + const base::WeakPtr<GuestView>& opener); |
| static GuestView* FromWebContents(content::WebContents* web_contents); |
| @@ -82,6 +83,8 @@ class GuestView : public content::BrowserPluginGuestDelegate { |
| virtual Type GetViewType() const; |
| + base::WeakPtr<GuestView> AsWeakPtr(); |
| + |
| // Returns a WebViewGuest if this GuestView belongs to a <webview>. |
| virtual WebViewGuest* AsWebView() = 0; |
| @@ -113,9 +116,14 @@ class GuestView : 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: |
| GuestView(content::WebContents* guest_web_contents, |
| - const std::string& embedder_extension_id); |
| + const std::string& embedder_extension_id, |
| + const base::WeakPtr<GuestView>& opener); |
| virtual ~GuestView(); |
| // Dispatches an event |event_name| to the embedder with the |event| fields. |
| @@ -140,6 +148,9 @@ class GuestView : 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/04/30 08:40:15
This is the opener web_content's guest? not the th
|
| + base::WeakPtr<GuestView> opener_; |
| + |
| // This is used to ensure pending tasks will not fire after this object is |
| // destroyed. |
| base::WeakPtrFactory<GuestView> weak_ptr_factory_; |