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

Unified Diff: Source/core/fetch/ResourceFetcher.cpp

Issue 312253003: Add UseCounters for the types of mixed content we currently don't block. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index fcc979a7fda1e47a351196d734270365a62ad673..2f9a459fd2363ff5aaa2b5a1c1e8094658e53f26 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -462,8 +462,28 @@ bool ResourceFetcher::checkInsecureContent(Resource::Type type, const KURL& url,
Frame* top = f->tree().top();
if (!toLocalFrame(top)->loader().mixedContentChecker()->canDisplayInsecureContent(toLocalFrame(top)->document()->securityOrigin(), url))
return false;
- if (type == Resource::Font && MixedContentChecker::isMixedContent(toLocalFrame(top)->document()->securityOrigin(), url))
- UseCounter::count(toLocalFrame(top)->document(), UseCounter::MixedContentFont);
+ if (MixedContentChecker::isMixedContent(toLocalFrame(top)->document()->securityOrigin(), url)) {
+ switch (type) {
+ case Resource::TextTrack:
+ UseCounter::count(toLocalFrame(top)->document(), UseCounter::MixedContentTextTrack);
+ break;
+
+ case Resource::Raw:
+ UseCounter::count(toLocalFrame(top)->document(), UseCounter::MixedContentRaw);
+ break;
+
+ case Resource::Image:
+ UseCounter::count(toLocalFrame(top)->document(), UseCounter::MixedContentImage);
+ break;
+
+ case Resource::Media:
+ UseCounter::count(toLocalFrame(top)->document(), UseCounter::MixedContentMedia);
+ break;
+
+ default:
+ ASSERT_NOT_REACHED();
+ }
+ }
}
} else {
ASSERT(treatment == TreatAsAlwaysAllowedContent);
« no previous file with comments | « no previous file | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698