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

Unified Diff: third_party/WebKit/Source/core/loader/MixedContentChecker.cpp

Issue 2849403002: Use const ref for LocalFrame::LocalFrameRoot and FrameTree::Top (Closed)
Patch Set: fix compile and dchecks Created 3 years, 8 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: third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
diff --git a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
index 9375c6289fa21c53f49de617dfcad4e6bd40acd1..2cdfed8f5575e1c831273d16757d78c74e333708 100644
--- a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
+++ b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
@@ -140,23 +140,23 @@ const char* RequestContextName(WebURLRequest::RequestContext context) {
} // namespace
-static void MeasureStricterVersionOfIsMixedContent(Frame* frame,
+static void MeasureStricterVersionOfIsMixedContent(Frame& frame,
const KURL& url) {
// We're currently only checking for mixed content in `https://*` contexts.
// What about other "secure" contexts the SchemeRegistry knows about? We'll
// use this method to measure the occurrence of non-webby mixed content to
// make sure we're not breaking the world without realizing it.
- SecurityOrigin* origin = frame->GetSecurityContext()->GetSecurityOrigin();
+ SecurityOrigin* origin = frame.GetSecurityContext()->GetSecurityOrigin();
if (MixedContentChecker::IsMixedContent(origin, url)) {
if (origin->Protocol() != "https") {
UseCounter::Count(
- frame,
+ &frame,
UseCounter::kMixedContentInNonHTTPSFrameThatRestrictsMixedContent);
}
} else if (!SecurityOrigin::IsSecure(url) &&
SchemeRegistry::ShouldTreatURLSchemeAsSecure(origin->Protocol())) {
UseCounter::Count(
- frame,
+ &frame,
UseCounter::kMixedContentInSecureFrameThatDoesNotRestrictMixedContent);
}
}
@@ -202,13 +202,12 @@ Frame* MixedContentChecker::InWhichFrameIsContentMixed(
return nullptr;
// Check the top frame first.
- if (Frame* top = frame->Tree().Top()) {
- MeasureStricterVersionOfIsMixedContent(top, url);
- if (IsMixedContent(top->GetSecurityContext()->GetSecurityOrigin(), url))
- return top;
- }
+ Frame& top = frame->Tree().Top();
+ MeasureStricterVersionOfIsMixedContent(top, url);
+ if (IsMixedContent(top.GetSecurityContext()->GetSecurityOrigin(), url))
+ return ⊤
- MeasureStricterVersionOfIsMixedContent(frame, url);
+ MeasureStricterVersionOfIsMixedContent(*frame, url);
if (IsMixedContent(frame->GetSecurityContext()->GetSecurityOrigin(), url))
return frame;
« no previous file with comments | « third_party/WebKit/Source/core/layout/TextAutosizer.cpp ('k') | third_party/WebKit/Source/core/page/ChromeClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698