OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 void FrameFetchContext::dispatchWillSendRequest(unsigned long identifier, Resour
ceRequest& request, const ResourceResponse& redirectResponse, const FetchInitiat
orInfo& initiatorInfo) | 243 void FrameFetchContext::dispatchWillSendRequest(unsigned long identifier, Resour
ceRequest& request, const ResourceResponse& redirectResponse, const FetchInitiat
orInfo& initiatorInfo) |
244 { | 244 { |
245 frame()->loader().applyUserAgent(request); | 245 frame()->loader().applyUserAgent(request); |
246 frame()->loader().client()->dispatchWillSendRequest(m_documentLoader, identi
fier, request, redirectResponse); | 246 frame()->loader().client()->dispatchWillSendRequest(m_documentLoader, identi
fier, request, redirectResponse); |
247 TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceSendRequest", TRACE_EVENT
_SCOPE_THREAD, "data", InspectorSendRequestEvent::data(identifier, frame(), requ
est)); | 247 TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceSendRequest", TRACE_EVENT
_SCOPE_THREAD, "data", InspectorSendRequestEvent::data(identifier, frame(), requ
est)); |
248 InspectorInstrumentation::willSendRequest(frame(), identifier, ensureLoaderF
orNotifications(), request, redirectResponse, initiatorInfo); | 248 InspectorInstrumentation::willSendRequest(frame(), identifier, ensureLoaderF
orNotifications(), request, redirectResponse, initiatorInfo); |
249 } | 249 } |
250 | 250 |
251 void FrameFetchContext::dispatchDidReceiveResponse(unsigned long identifier, con
st ResourceResponse& response, ResourceLoader* resourceLoader) | 251 void FrameFetchContext::dispatchDidReceiveResponse(unsigned long identifier, con
st ResourceResponse& response, ResourceLoader* resourceLoader) |
252 { | 252 { |
| 253 LinkLoader::CanLoadResources resourceLoadingPolicy = LinkLoader::LoadResourc
esAndPreconnect; |
253 MixedContentChecker::checkMixedPrivatePublic(frame(), response.remoteIPAddre
ss()); | 254 MixedContentChecker::checkMixedPrivatePublic(frame(), response.remoteIPAddre
ss()); |
254 LinkLoader::loadLinkFromHeader(response.httpHeaderField(HTTPNames::Link), fr
ame()->document(), NetworkHintsInterfaceImpl(), LinkLoader::DoNotLoadResources); | |
255 if (m_documentLoader == frame()->loader().provisionalDocumentLoader()) { | 255 if (m_documentLoader == frame()->loader().provisionalDocumentLoader()) { |
256 ResourceFetcher* fetcher = nullptr; | 256 ResourceFetcher* fetcher = nullptr; |
257 if (frame()->document()) | 257 if (frame()->document()) |
258 fetcher = frame()->document()->fetcher(); | 258 fetcher = frame()->document()->fetcher(); |
259 m_documentLoader->clientHintsPreferences().updateFromAcceptClientHintsHe
ader(response.httpHeaderField(HTTPNames::Accept_CH), fetcher); | 259 m_documentLoader->clientHintsPreferences().updateFromAcceptClientHintsHe
ader(response.httpHeaderField(HTTPNames::Accept_CH), fetcher); |
| 260 // When response is received with a provisional docloader, the resource
haven't committed yet, and we cannot load resources, only preconnect. |
| 261 resourceLoadingPolicy = LinkLoader::DoNotLoadResources; |
260 } | 262 } |
| 263 LinkLoader::loadLinkFromHeader(response.httpHeaderField(HTTPNames::Link), fr
ame()->document(), NetworkHintsInterfaceImpl(), resourceLoadingPolicy); |
261 | 264 |
262 if (response.hasMajorCertificateErrors() && resourceLoader) | 265 if (response.hasMajorCertificateErrors() && resourceLoader) |
263 MixedContentChecker::handleCertificateError(frame(), resourceLoader->ori
ginalRequest(), response); | 266 MixedContentChecker::handleCertificateError(frame(), resourceLoader->ori
ginalRequest(), response); |
264 | 267 |
265 frame()->loader().progress().incrementProgress(identifier, response); | 268 frame()->loader().progress().incrementProgress(identifier, response); |
266 frame()->loader().client()->dispatchDidReceiveResponse(m_documentLoader, ide
ntifier, response); | 269 frame()->loader().client()->dispatchDidReceiveResponse(m_documentLoader, ide
ntifier, response); |
267 TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceReceiveResponse", TRACE_E
VENT_SCOPE_THREAD, "data", InspectorReceiveResponseEvent::data(identifier, frame
(), response)); | 270 TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceReceiveResponse", TRACE_E
VENT_SCOPE_THREAD, "data", InspectorReceiveResponseEvent::data(identifier, frame
(), response)); |
268 DocumentLoader* documentLoader = ensureLoaderForNotifications(); | 271 DocumentLoader* documentLoader = ensureLoaderForNotifications(); |
269 InspectorInstrumentation::didReceiveResourceResponse(frame(), identifier, do
cumentLoader, response, resourceLoader); | 272 InspectorInstrumentation::didReceiveResourceResponse(frame(), identifier, do
cumentLoader, response, resourceLoader); |
270 // It is essential that inspector gets resource response BEFORE console. | 273 // It is essential that inspector gets resource response BEFORE console. |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 } | 786 } |
784 | 787 |
785 DEFINE_TRACE(FrameFetchContext) | 788 DEFINE_TRACE(FrameFetchContext) |
786 { | 789 { |
787 visitor->trace(m_document); | 790 visitor->trace(m_document); |
788 visitor->trace(m_documentLoader); | 791 visitor->trace(m_documentLoader); |
789 FetchContext::trace(visitor); | 792 FetchContext::trace(visitor); |
790 } | 793 } |
791 | 794 |
792 } // namespace blink | 795 } // namespace blink |
OLD | NEW |