Chromium Code Reviews| Index: content/browser/renderer_host/render_widget_host_view_android.cc |
| diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc |
| index ad4fc6e76c61ab533c7104725f9c39d746702154..ba74e4976b68dd7b20606f266ce091f2a47a9fc6 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_android.cc |
| +++ b/content/browser/renderer_host/render_widget_host_view_android.cc |
| @@ -498,6 +498,8 @@ RenderWidgetHostViewAndroid::~RenderWidgetHostViewAndroid() { |
| SetContentViewCore(NULL); |
| if (ime_adapter_android_) |
| ime_adapter_android_ = nullptr; |
|
boliu
2017/04/13 04:29:41
this should be redundant, this should be an DCHECK
Jinsuk Kim
2017/04/13 04:44:05
Done.
|
| + for (auto* observer : destruction_observers_) |
|
boliu
2017/04/13 04:29:41
this should be called from Destroy, not here, othe
Jinsuk Kim
2017/04/13 04:44:05
Done.
|
| + observer->RenderWidgetHostViewDestroyed(this); |
| DCHECK(ack_callbacks_.empty()); |
| DCHECK(!delegated_frame_host_); |
| } |
| @@ -508,6 +510,19 @@ void RenderWidgetHostViewAndroid::Blur() { |
| overscroll_controller_->Disable(); |
| } |
| +void RenderWidgetHostViewAndroid::AddDestructionObserver( |
| + DestructionObserver* connector) { |
| + destruction_observers_.push_back(connector); |
| +} |
| + |
| +void RenderWidgetHostViewAndroid::RemoveDestructionObserver( |
| + DestructionObserver* connector) { |
| + auto it = std::find(destruction_observers_.begin(), |
| + destruction_observers_.end(), connector); |
| + DCHECK(it != destruction_observers_.end()); |
| + destruction_observers_.erase(it); |
| +} |
| + |
| bool RenderWidgetHostViewAndroid::OnMessageReceived( |
| const IPC::Message& message) { |
| if (IPC_MESSAGE_ID_CLASS(message.type()) == SyncCompositorMsgStart) { |