Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_view_android.h |
| diff --git a/content/browser/renderer_host/render_widget_host_view_android.h b/content/browser/renderer_host/render_widget_host_view_android.h |
| index cd3964b2c3a88cb611afff495b45073da8480865..17866652197465afb593ef3b95c122eb82a55160 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_android.h |
| +++ b/content/browser/renderer_host/render_widget_host_view_android.h |
| @@ -78,6 +78,19 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid |
| void Blur(); |
| + // Interface used to observe the destruction of a RenderWidgetHostViewAndroid. |
| + class DestructionObserver { |
| + public: |
| + virtual void RenderWidgetHostViewDestroyed( |
| + RenderWidgetHostViewAndroid* rwhva) = 0; |
| + |
| + protected: |
| + virtual ~DestructionObserver() {} |
| + }; |
| + |
| + void AddDestructionObserver(DestructionObserver* connector); |
| + void RemoveDestructionObserver(DestructionObserver* connector); |
| + |
| // RenderWidgetHostView implementation. |
| bool OnMessageReceived(const IPC::Message& msg) override; |
| void InitAsChild(gfx::NativeView parent_view) override; |
| @@ -404,6 +417,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAndroid |
| cc::mojom::MojoCompositorFrameSinkClient* renderer_compositor_frame_sink_ = |
| nullptr; |
| + std::list<DestructionObserver*> destruction_observers_; |
|
boliu
2017/04/14 01:10:07
nit: vector is generally more memory efficient and
Jinsuk Kim
2017/04/14 02:16:33
Done.
|
| + |
| base::WeakPtrFactory<RenderWidgetHostViewAndroid> weak_ptr_factory_; |
| DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); |