Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1330)

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2352533003: [Autofill] Migrate ChromePasswordManagerClient<-->PasswordGenerationAgent IPCs to mojo. (Closed)
Patch Set: browser_tests partly Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 6fba0086fafb042e8b701137e7d0f786e313bdb7..506fdb0bcf8f02242c4c585cd1090235927a4586 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2448,13 +2448,19 @@ AssociatedInterfaceProvider*
RenderFrameImpl::GetRemoteAssociatedInterfaces() {
if (!remote_associated_interfaces_) {
ChildThreadImpl* thread = ChildThreadImpl::current();
- mojom::AssociatedInterfaceProviderAssociatedPtr remote_interfaces;
- thread->GetRemoteRouteProvider()->GetRoute(
- routing_id_,
- mojo::GetProxy(&remote_interfaces,
- thread->channel()->GetAssociatedGroup()));
- remote_associated_interfaces_.reset(new AssociatedInterfaceProviderImpl(
- std::move(remote_interfaces)));
+ if (thread) {
+ mojom::AssociatedInterfaceProviderAssociatedPtr remote_interfaces;
+ thread->GetRemoteRouteProvider()->GetRoute(
+ routing_id_, mojo::GetProxy(&remote_interfaces,
+ thread->channel()->GetAssociatedGroup()));
+ remote_associated_interfaces_.reset(
+ new AssociatedInterfaceProviderImpl(std::move(remote_interfaces)));
+ } else {
+ // In some tests the thread may be null,
+ // so set up a self-contained interface provider instead.
+ remote_associated_interfaces_.reset(
+ new AssociatedInterfaceProviderImpl());
+ }
}
return remote_associated_interfaces_.get();
}

Powered by Google App Engine
This is Rietveld 408576698