Fix SSLUITest.BadCertFollowedByGoodCert with PlzNavigate.

The notifications from ResourceDispatcherHostImpl to WebContents were using a RenderFrameHost ID to find the WebContents. Switch it to using the WebContentsGetter. The only issue I ran into was that calculating the data for the LoadStateChanged callback correctly meant that it had to be done on teh UI thread (so that we can compare navigation requests with subresource requests). Since RDH has to hop to the UI thread to calculate this, there's no point to hopping back to the IO thread to call its delegate which would then hop back to the UI thread, so I changed the delegate method to be called on the UI thread.

BUG=504347

Review-Url: https://codereview.chromium.org/2327163002
Cr-Commit-Position: refs/heads/master@{#417855}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 066b0b7..683bd71 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2937,6 +2937,28 @@
                                            screen_y, operation);
 }
 
+void WebContentsImpl::LoadStateChanged(
+    const GURL& url,
+    const net::LoadStateWithParam& load_state,
+    uint64_t upload_position,
+    uint64_t upload_size) {
+  // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285
+  // is fixed.
+  tracked_objects::ScopedTracker tracking_profile1(
+      FROM_HERE_WITH_EXPLICIT_FUNCTION(
+          "466285 WebContentsImpl::LoadStateChanged::Start"));
+  load_state_ = load_state;
+  upload_position_ = upload_position;
+  upload_size_ = upload_size;
+  load_state_host_ = url_formatter::IDNToUnicode(url.host());
+  if (load_state_.state == net::LOAD_STATE_READING_RESPONSE)
+    SetNotWaitingForResponse();
+  if (IsLoading()) {
+    NotifyNavigationStateChanged(static_cast<InvalidateTypes>(
+        INVALIDATE_TYPE_LOAD | INVALIDATE_TYPE_TAB));
+  }
+}
+
 void WebContentsImpl::DidGetResourceResponseStart(
   const ResourceRequestDetails& details) {
   controller_.ssl_manager()->DidStartResourceResponse(details);
@@ -2946,14 +2968,13 @@
 }
 
 void WebContentsImpl::DidGetRedirectForResourceRequest(
-  RenderFrameHost* render_frame_host,
   const ResourceRedirectDetails& details) {
   controller_.ssl_manager()->DidReceiveResourceRedirect(details);
 
   FOR_EACH_OBSERVER(
       WebContentsObserver,
       observers_,
-      DidGetRedirectForResourceRequest(render_frame_host, details));
+      DidGetRedirectForResourceRequest(details));
 
   // TODO(avi): Remove. http://crbug.com/170921
   NotificationService::current()->Notify(
@@ -4752,28 +4773,6 @@
     delegate_->RendererResponsive(this);
 }
 
-void WebContentsImpl::LoadStateChanged(
-    const GURL& url,
-    const net::LoadStateWithParam& load_state,
-    uint64_t upload_position,
-    uint64_t upload_size) {
-  // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466285
-  // is fixed.
-  tracked_objects::ScopedTracker tracking_profile1(
-      FROM_HERE_WITH_EXPLICIT_FUNCTION(
-          "466285 WebContentsImpl::LoadStateChanged::Start"));
-  load_state_ = load_state;
-  upload_position_ = upload_position;
-  upload_size_ = upload_size;
-  load_state_host_ = url_formatter::IDNToUnicode(url.host());
-  if (load_state_.state == net::LOAD_STATE_READING_RESPONSE)
-    SetNotWaitingForResponse();
-  if (IsLoading()) {
-    NotifyNavigationStateChanged(static_cast<InvalidateTypes>(
-        INVALIDATE_TYPE_LOAD | INVALIDATE_TYPE_TAB));
-  }
-}
-
 void WebContentsImpl::BeforeUnloadFiredFromRenderManager(
     bool proceed, const base::TimeTicks& proceed_time,
     bool* proceed_to_fire_unload) {