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

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

Issue 348853009: Refactor mixed content checks against the top frame into MixedContentChecker. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: WSS. 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
Index: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index fbf3ebea262ee26e21c864fa3a8aac5a5c467e10..bdaabf66e9d032ebe24a6273f46fca78415f52dc 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -437,40 +437,27 @@ bool ResourceFetcher::checkInsecureContent(Resource::Type type, const KURL& url,
break;
}
}
- // FIXME: We need a way to access the top-level frame's mixedContentChecker when that frame
- // is in a different process from the current frame. Until that is done, we always allow
- // loads in remote frames.
- if (frame() && !frame()->tree().top()->isLocalFrame())
- return true;
if (treatment == TreatAsActiveContent) {
if (LocalFrame* f = frame()) {
if (!f->loader().mixedContentChecker()->canRunInsecureContent(m_document->securityOrigin(), url))
return false;
- Frame* top = f->tree().top();
- if (top != f && !toLocalFrame(top)->loader().mixedContentChecker()->canRunInsecureContent(toLocalFrame(top)->document()->securityOrigin(), url))
- return false;
}
} else if (treatment == TreatAsPassiveContent) {
if (LocalFrame* f = frame()) {
- Frame* top = f->tree().top();
- if (!toLocalFrame(top)->loader().mixedContentChecker()->canDisplayInsecureContent(toLocalFrame(top)->document()->securityOrigin(), url))
+ if (!f->loader().mixedContentChecker()->canDisplayInsecureContent(m_document->securityOrigin(), url))
return false;
- if (MixedContentChecker::isMixedContent(toLocalFrame(top)->document()->securityOrigin(), url)) {
+ if (MixedContentChecker::isMixedContent(f->document()->securityOrigin(), url) || MixedContentChecker::isMixedContent(toLocalFrame(frame()->tree().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);
+ UseCounter::count(f->document(), UseCounter::MixedContentRaw);
break;
case Resource::Image:
- UseCounter::count(toLocalFrame(top)->document(), UseCounter::MixedContentImage);
+ UseCounter::count(f->document(), UseCounter::MixedContentImage);
break;
case Resource::Media:
- UseCounter::count(toLocalFrame(top)->document(), UseCounter::MixedContentMedia);
+ UseCounter::count(f->document(), UseCounter::MixedContentMedia);
break;
default:

Powered by Google App Engine
This is Rietveld 408576698