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

Unified Diff: components/guest_view/renderer/guest_view_container.h

Issue 1162053003: Move BrowserPluginDelegate's lifetime mgmt out of content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync @tott Created 5 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 | « no previous file | components/guest_view/renderer/guest_view_container.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/guest_view/renderer/guest_view_container.h
diff --git a/components/guest_view/renderer/guest_view_container.h b/components/guest_view/renderer/guest_view_container.h
index 50b05cb886ab97832a4ed308c1c27c2ffff01c50..03d860f3443eaa45fa893aac0ab7ca3db5b85363 100644
--- a/components/guest_view/renderer/guest_view_container.h
+++ b/components/guest_view/renderer/guest_view_container.h
@@ -17,7 +17,6 @@ class GuestViewRequest;
class GuestViewContainer : public content::BrowserPluginDelegate {
public:
explicit GuestViewContainer(content::RenderFrame* render_frame);
- ~GuestViewContainer() override;
static GuestViewContainer* FromID(int element_instance_id);
@@ -33,6 +32,9 @@ class GuestViewContainer : public content::BrowserPluginDelegate {
// container.
bool OnMessageReceived(const IPC::Message& message);
+ // Destroys this GuestViewContainer after performing necessary cleanup.
+ void Destroy();
+
// Called when the embedding RenderFrame is destroyed.
virtual void OnRenderFrameDestroyed() {}
@@ -43,6 +45,14 @@ class GuestViewContainer : public content::BrowserPluginDelegate {
// Called to perform actions when a GuestViewContainer gets a geometry.
virtual void OnReady() {}
+ // Called to perform actions when a GuestViewContainer is about to be
+ // destroyed.
+ // Note that this should be called exactly once.
+ virtual void OnDestroy() {}
+
+ protected:
+ ~GuestViewContainer() override;
+
private:
class RenderFrameLifetimeObserver;
friend class RenderFrameLifetimeObserver;
@@ -58,12 +68,14 @@ class GuestViewContainer : public content::BrowserPluginDelegate {
// BrowserPluginDelegate implementation.
void Ready() final;
void SetElementInstanceID(int element_instance_id) final;
+ void DidDestroyElement() final;
int element_instance_id_;
content::RenderFrame* render_frame_;
scoped_ptr<RenderFrameLifetimeObserver> render_frame_lifetime_observer_;
bool ready_;
+ bool in_destruction_;
std::deque<linked_ptr<GuestViewRequest> > pending_requests_;
linked_ptr<GuestViewRequest> pending_response_;
« no previous file with comments | « no previous file | components/guest_view/renderer/guest_view_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698