Corrects mojom::RouteProvider registration in ChildThreadImpl

We still have one instance where ChildThreadImpl is used without
ChannelMojo (utility processes launched by a service process),
causing a nullptr dereference in ChannelProxy when trying to add
the associated interface.

This CL replaces a DCHECK with a branch to avoid the crash, since
silently ignoring the call is safe and reasonable.

In examining this bug I also realized that ChildThreadImpl was
incorrectly adding the RouteProvider interface after Channel
connection, which is only safe to do in the browser, where the
remote endpoint hasn't been launched yet. So this CL fixes that
too, and clarifies the documentation in ipc_channel_proxy.h.

BUG=647251
[email protected]

Review-Url: https://codereview.chromium.org/2343783003
Cr-Commit-Position: refs/heads/master@{#419043}
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index 9b8ece1..22e4cc39 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -408,8 +408,8 @@
   }
   Channel::AssociatedInterfaceSupport* support =
       channel_->GetAssociatedInterfaceSupport();
-  DCHECK(support);
-  support->AddGenericAssociatedInterface(name, factory);
+  if (support)
+    support->AddGenericAssociatedInterface(name, factory);
 }
 
 void ChannelProxy::Context::SendFromThisThread(Message* message) {