Stop sending SSLInfo from network service for subframe navigations.

Optimize to only send SSLInfo from network service on top-level requests.
Changes GetURLLoaderOptions to only set
kURLLoadOptionSendSSLInfoWithResponse when |is_main_frame| is true and
sets new default to kURLLoadOptionNone.

This also makes a change in WebContentsImpl to fetch SSLInfo only on
main frame navigations.

Bug: 787535
Change-Id: Ie4a929ba90e4c358d111e174a3c399298f22b5f3
Reviewed-on: https://chromium-review.googlesource.com/1148239
Reviewed-by: John Abd-El-Malek <[email protected]>
Reviewed-by: Charlie Harrison <[email protected]>
Commit-Queue: Livvie Lin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#581974}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 3e85c03..495000c 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4088,9 +4088,13 @@
   if (navigation_handle->IsSameDocument())
     return;
 
-  controller_.ssl_manager()->DidStartResourceResponse(
-      navigation_handle->GetURL(),
-      net::IsCertStatusError(navigation_handle->GetSSLInfo().cert_status));
+  // SSLInfo is not needed on subframe navigations since the main-frame
+  // certificate is the only one that can be inspected (using the info
+  // bubble) without refreshing the page with DevTools open.
+  if (navigation_handle->IsInMainFrame())
+    controller_.ssl_manager()->DidStartResourceResponse(
+        navigation_handle->GetURL(),
+        net::IsCertStatusError(navigation_handle->GetSSLInfo().cert_status));
 
   SetNotWaitingForResponse();
 }