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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2167773002: Preparation for removal of sending content::SSLStatus to the renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/common/frame_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 3465 matching lines...) Expand 10 before | Expand all | Expand 10 after
3476 RecordAction(base::UserMetricsAction("SSL.RanInsecureContent")); 3476 RecordAction(base::UserMetricsAction("SSL.RanInsecureContent"));
3477 if (base::EndsWith(security_origin.spec(), kDotGoogleDotCom, 3477 if (base::EndsWith(security_origin.spec(), kDotGoogleDotCom,
3478 base::CompareCase::INSENSITIVE_ASCII)) 3478 base::CompareCase::INSENSITIVE_ASCII))
3479 RecordAction(base::UserMetricsAction("SSL.RanInsecureContentGoogle")); 3479 RecordAction(base::UserMetricsAction("SSL.RanInsecureContentGoogle"));
3480 controller_.ssl_manager()->DidRunInsecureContent(security_origin); 3480 controller_.ssl_manager()->DidRunInsecureContent(security_origin);
3481 SSLManager::NotifySSLInternalStateChanged( 3481 SSLManager::NotifySSLInternalStateChanged(
3482 GetController().GetBrowserContext()); 3482 GetController().GetBrowserContext());
3483 } 3483 }
3484 3484
3485 void WebContentsImpl::OnDidDisplayContentWithCertificateErrors( 3485 void WebContentsImpl::OnDidDisplayContentWithCertificateErrors(
3486 const GURL& url, 3486 const GURL& url) {
3487 const std::string& security_info) {
3488 // Check that the main frame navigation entry has a cryptographic 3487 // Check that the main frame navigation entry has a cryptographic
3489 // scheme; the security UI is associated with the main frame rather 3488 // scheme; the security UI is associated with the main frame rather
3490 // than the subframe (if any) that actually displayed the subresource 3489 // than the subframe (if any) that actually displayed the subresource
3491 // with errors. 3490 // with errors.
3492 NavigationEntry* entry = controller_.GetLastCommittedEntry(); 3491 NavigationEntry* entry = controller_.GetLastCommittedEntry();
3493 if (!entry || !entry->GetURL().SchemeIsCryptographic()) 3492 if (!entry || !entry->GetURL().SchemeIsCryptographic())
3494 return; 3493 return;
3495 3494
3496 SSLStatus ssl;
3497 if (!DeserializeSecurityInfo(security_info, &ssl)) {
3498 bad_message::ReceivedBadMessage(
3499 GetRenderProcessHost(),
3500 bad_message::WC_CONTENT_WITH_CERT_ERRORS_BAD_SECURITY_INFO);
3501 return;
3502 }
3503
3504 displayed_insecure_content_ = true; 3495 displayed_insecure_content_ = true;
3505 SSLManager::NotifySSLInternalStateChanged( 3496 SSLManager::NotifySSLInternalStateChanged(
3506 GetController().GetBrowserContext()); 3497 GetController().GetBrowserContext());
3507 } 3498 }
3508 3499
3509 void WebContentsImpl::OnDidRunContentWithCertificateErrors( 3500 void WebContentsImpl::OnDidRunContentWithCertificateErrors(
3510 const GURL& url, 3501 const GURL& url) {
3511 const std::string& security_info) {
3512 // Check that the main frame navigation entry has a cryptographic 3502 // Check that the main frame navigation entry has a cryptographic
3513 // scheme; the security UI is associated with the main frame rather 3503 // scheme; the security UI is associated with the main frame rather
3514 // than the subframe (if any) that actually displayed the subresource 3504 // than the subframe (if any) that actually displayed the subresource
3515 // with errors. 3505 // with errors.
3516 NavigationEntry* entry = controller_.GetLastCommittedEntry(); 3506 NavigationEntry* entry = controller_.GetLastCommittedEntry();
3517 if (!entry || !entry->GetURL().SchemeIsCryptographic()) 3507 if (!entry || !entry->GetURL().SchemeIsCryptographic())
3518 return; 3508 return;
3519 3509
3520 SSLStatus ssl;
3521 if (!DeserializeSecurityInfo(security_info, &ssl)) {
3522 bad_message::ReceivedBadMessage(
3523 GetRenderProcessHost(),
3524 bad_message::WC_CONTENT_WITH_CERT_ERRORS_BAD_SECURITY_INFO);
3525 return;
3526 }
3527
3528 // TODO(estark): check that this does something reasonable for 3510 // TODO(estark): check that this does something reasonable for
3529 // about:blank and sandboxed origins. https://crbug.com/609527 3511 // about:blank and sandboxed origins. https://crbug.com/609527
3530 controller_.ssl_manager()->DidRunInsecureContent(entry->GetURL().GetOrigin()); 3512 controller_.ssl_manager()->DidRunInsecureContent(entry->GetURL().GetOrigin());
3531 SSLManager::NotifySSLInternalStateChanged( 3513 SSLManager::NotifySSLInternalStateChanged(
3532 GetController().GetBrowserContext()); 3514 GetController().GetBrowserContext());
3533 } 3515 }
3534 3516
3535 void WebContentsImpl::OnDocumentLoadedInFrame() { 3517 void WebContentsImpl::OnDocumentLoadedInFrame() {
3536 if (!HasValidFrameSource()) 3518 if (!HasValidFrameSource())
3537 return; 3519 return;
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after
5176 for (RenderViewHost* render_view_host : render_view_host_set) 5158 for (RenderViewHost* render_view_host : render_view_host_set)
5177 render_view_host->OnWebkitPreferencesChanged(); 5159 render_view_host->OnWebkitPreferencesChanged();
5178 } 5160 }
5179 5161
5180 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( 5162 void WebContentsImpl::SetJavaScriptDialogManagerForTesting(
5181 JavaScriptDialogManager* dialog_manager) { 5163 JavaScriptDialogManager* dialog_manager) {
5182 dialog_manager_ = dialog_manager; 5164 dialog_manager_ = dialog_manager;
5183 } 5165 }
5184 5166
5185 } // namespace content 5167 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/common/frame_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698