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

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 1905033002: PlzNavigate: Move navigation-level mixed content checks to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@console-security-message
Patch Set: Rebase after 3 spin off CLs landed. Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index 2f43443c53e210cc7b80effedd9cced05ce55a5a..bad6f49a5b41b8dcfe1957a851377d4102ac42ea 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -2015,6 +2015,32 @@ void WebLocalFrameImpl::loadData(const WebData& data,
static_cast<HistoryLoadType>(webHistoryLoadType));
}
+void WebLocalFrameImpl::mixedContentUpdateFromBrowser(
+ const std::set<int>& features,
+ bool mixedContentWasFound,
+ const WebURL& mixedContentUrl,
+ bool mixedContentHadRedirect) {
+ // Assimilate all features detected during mixed content checks in the
+ // browser.
+ DCHECK(!features.empty() || mixedContentWasFound);
+ for (int feature : features) {
+ UseCounter::count(frame(), static_cast<UseCounter::Feature>(feature));
+ }
+
+ // Report found mixed content to the CSP policy.
+ if (mixedContentWasFound) {
+ ContentSecurityPolicy* policy =
+ frame()->securityContext()->contentSecurityPolicy();
+ if (policy) {
+ policy->reportMixedContent(
+ mixedContentUrl,
+ mixedContentHadRedirect
+ ? ResourceRequest::RedirectStatus::FollowedRedirect
+ : ResourceRequest::RedirectStatus::NoRedirect);
+ }
+ }
+}
+
bool WebLocalFrameImpl::maybeRenderFallbackContent(
const WebURLError& error) const {
DCHECK(frame());

Powered by Google App Engine
This is Rietveld 408576698