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

Side by Side Diff: Source/core/loader/PingLoader.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, 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 frame->loader().fetchContext().addAdditionalRequestHeaders(frame->document() , request, FetchSubresource); 113 frame->loader().fetchContext().addAdditionalRequestHeaders(frame->document() , request, FetchSubresource);
114 frame->loader().fetchContext().setFirstPartyForCookies(request); 114 frame->loader().fetchContext().setFirstPartyForCookies(request);
115 115
116 FetchInitiatorInfo initiatorInfo; 116 FetchInitiatorInfo initiatorInfo;
117 initiatorInfo.name = FetchInitiatorTypeNames::violationreport; 117 initiatorInfo.name = FetchInitiatorTypeNames::violationreport;
118 PingLoader::start(frame, request, initiatorInfo, SecurityOrigin::create(repo rtURL)->isSameSchemeHostPort(frame->document()->securityOrigin()) ? AllowStoredC redentials : DoNotAllowStoredCredentials); 118 PingLoader::start(frame, request, initiatorInfo, SecurityOrigin::create(repo rtURL)->isSameSchemeHostPort(frame->document()->securityOrigin()) ? AllowStoredC redentials : DoNotAllowStoredCredentials);
119 } 119 }
120 120
121 void PingLoader::start(LocalFrame* frame, ResourceRequest& request, const FetchI nitiatorInfo& initiatorInfo, StoredCredentials credentialsAllowed) 121 void PingLoader::start(LocalFrame* frame, ResourceRequest& request, const FetchI nitiatorInfo& initiatorInfo, StoredCredentials credentialsAllowed)
122 { 122 {
123 if (!frame->loader().mixedContentChecker()->canRunInsecureContent(frame->doc ument()->securityOrigin(), request.url())) 123 if (!frame->loader().mixedContentChecker()->canRunInsecureContent(frame->doc ument()->securityOrigin(), request.url()))
Mike West 2014/06/30 12:24:37 The PingLoader check is here. We were previously d
124 return; 124 return;
125 Frame* top = frame->tree().top();
126 if (top != frame && !toLocalFrame(top)->loader().mixedContentChecker()->canR unInsecureContent(toLocalFrame(top)->document()->securityOrigin(), request.url() ))
127 return;
128 125
129 OwnPtr<PingLoader> pingLoader = adoptPtr(new PingLoader(frame, request, init iatorInfo, credentialsAllowed)); 126 OwnPtr<PingLoader> pingLoader = adoptPtr(new PingLoader(frame, request, init iatorInfo, credentialsAllowed));
130 127
131 // Leak the ping loader, since it will kill itself as soon as it receives a response. 128 // Leak the ping loader, since it will kill itself as soon as it receives a response.
132 PingLoader* leakedPingLoader ALLOW_UNUSED = pingLoader.leakPtr(); 129 PingLoader* leakedPingLoader ALLOW_UNUSED = pingLoader.leakPtr();
133 } 130 }
134 131
135 PingLoader::PingLoader(LocalFrame* frame, ResourceRequest& request, const FetchI nitiatorInfo& initiatorInfo, StoredCredentials credentialsAllowed) 132 PingLoader::PingLoader(LocalFrame* frame, ResourceRequest& request, const FetchI nitiatorInfo& initiatorInfo, StoredCredentials credentialsAllowed)
136 : PageLifecycleObserver(frame->page()) 133 : PageLifecycleObserver(frame->page())
137 , m_timeout(this, &PingLoader::timeout) 134 , m_timeout(this, &PingLoader::timeout)
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 { 203 {
207 if (Page* page = this->page()) { 204 if (Page* page = this->page()) {
208 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Re sourceFinish", "data", InspectorResourceFinishEvent::data(m_identifier, 0, true) ); 205 TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "Re sourceFinish", "data", InspectorResourceFinishEvent::data(m_identifier, 0, true) );
209 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Ti meline migrates to tracing. 206 // FIXME(361045): remove InspectorInstrumentation calls once DevTools Ti meline migrates to tracing.
210 InspectorInstrumentation::didFailLoading(page->deprecatedLocalMainFrame( ), m_identifier, ResourceError::cancelledError(m_url)); 207 InspectorInstrumentation::didFailLoading(page->deprecatedLocalMainFrame( ), m_identifier, ResourceError::cancelledError(m_url));
211 } 208 }
212 delete this; 209 delete this;
213 } 210 }
214 211
215 } 212 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698