| 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..2d3b77d8a7222ebcb4cd8ac7723efe4a9ac0b0c0 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_android.cc
|
| +++ b/content/browser/renderer_host/render_widget_host_view_android.cc
|
| @@ -496,8 +496,7 @@ RenderWidgetHostViewAndroid::~RenderWidgetHostViewAndroid() {
|
| if (content_view_core_)
|
| content_view_core_->RemoveObserver(this);
|
| SetContentViewCore(NULL);
|
| - if (ime_adapter_android_)
|
| - ime_adapter_android_ = nullptr;
|
| + DCHECK(!ime_adapter_android_);
|
| DCHECK(ack_callbacks_.empty());
|
| DCHECK(!delegated_frame_host_);
|
| }
|
| @@ -508,6 +507,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) {
|
| @@ -1019,6 +1031,9 @@ void RenderWidgetHostViewAndroid::Destroy() {
|
| if (GetTextInputManager() && GetTextInputManager()->HasObserver(this))
|
| GetTextInputManager()->RemoveObserver(this);
|
|
|
| + for (auto* observer : destruction_observers_)
|
| + observer->RenderWidgetHostViewDestroyed(this);
|
| +
|
| delete this;
|
| }
|
|
|
|
|