Make FindInPage be a ContextLifecycleObserver

frame_ in FindInPage might be null when GetWebPluginForFind is called,
causing a crash in crbug.com/848032. This happens when the frame had
detached but the pre-finalizer for FindInPage is not called yet, making
it possible for FindInPage to still receive mojo calls even though
the frame is null. This CL makes FindInPage observe when its document/
execution context is destroyed so that it will close its mojo binding
when that happens.

Bug: 848032
Change-Id: Ifac00128e4efeb98f73fdcb98a944164d9ca1bf1
Reviewed-on: https://chromium-review.googlesource.com/1107032
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575560}
2 files changed