Allow WebContentsImpl::FromRenderFrameHostId() to be called without UI thread

In servicification mode, this could get called by NetworkServiceClient.
An alternative change is to return nullptr in NetworkServiceClient if UI
thread is not created, and we can also do a non-validity check on frame host Id

BUG=930736

Change-Id: I9a3b85706fa5f283485e29ba5254a54341f57569
Reviewed-on: https://chromium-review.googlesource.com/c/1464351
Reviewed-by: John Abd-El-Malek <[email protected]>
Commit-Queue: Min Qin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#632447}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index e87aa15..0192275b 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -821,7 +821,8 @@
 // static
 WebContents* WebContentsImpl::FromRenderFrameHostID(int render_process_host_id,
                                                     int render_frame_host_id) {
-  DCHECK_CURRENTLY_ON(BrowserThread::UI);
+  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
+         !BrowserThread::IsThreadInitialized(BrowserThread::UI));
   RenderFrameHost* render_frame_host =
       RenderFrameHost::FromID(render_process_host_id, render_frame_host_id);
   if (!render_frame_host)