Make FindInPage be a ContextLifecycleObserver

frame_ in FindInPage might be null when GetWebPluginForFind is called,
causing a crash in 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
Commit-Queue: Rakina Zata Amni <>
Reviewed-by: Daniel Cheng <>
Cr-Commit-Position: refs/heads/master@{#575560}
2 files changed