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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 MixedContentChecker::checkMixedPrivatePublic(frame(), response.remoteIPAddre ss()); | 253 MixedContentChecker::checkMixedPrivatePublic(frame(), response.remoteIPAddre ss()); |
254 LinkLoader::loadLinkFromHeader(response.httpHeaderField(HTTPNames::Link), fr ame()->document(), NetworkHintsInterfaceImpl(), LinkLoader::DoNotLoadResources); | |
Nate Chapin
2016/01/25 21:50:10
Maybe keep the loadLinkFromHeader() call here, and
Yoav Weiss
2016/01/25 22:12:45
Yeah. Certainly DRYer to have a single call. I'll
| |
255 if (m_documentLoader == frame()->loader().provisionalDocumentLoader()) { | 254 if (m_documentLoader == frame()->loader().provisionalDocumentLoader()) { |
255 LinkLoader::loadLinkFromHeader(response.httpHeaderField(HTTPNames::Link) , frame()->document(), NetworkHintsInterfaceImpl(), LinkLoader::DoNotLoadResourc es); | |
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 } else { | |
261 LinkLoader::loadLinkFromHeader(response.httpHeaderField(HTTPNames::Link) , frame()->document(), NetworkHintsInterfaceImpl(), LinkLoader::LoadResourcesAnd Preconnect); | |
260 } | 262 } |
261 | 263 |
262 if (response.hasMajorCertificateErrors() && resourceLoader) | 264 if (response.hasMajorCertificateErrors() && resourceLoader) |
263 MixedContentChecker::handleCertificateError(frame(), resourceLoader->ori ginalRequest(), response); | 265 MixedContentChecker::handleCertificateError(frame(), resourceLoader->ori ginalRequest(), response); |
264 | 266 |
265 frame()->loader().progress().incrementProgress(identifier, response); | 267 frame()->loader().progress().incrementProgress(identifier, response); |
266 frame()->loader().client()->dispatchDidReceiveResponse(m_documentLoader, ide ntifier, response); | 268 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)); | 269 TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceReceiveResponse", TRACE_E VENT_SCOPE_THREAD, "data", InspectorReceiveResponseEvent::data(identifier, frame (), response)); |
268 DocumentLoader* documentLoader = ensureLoaderForNotifications(); | 270 DocumentLoader* documentLoader = ensureLoaderForNotifications(); |
269 InspectorInstrumentation::didReceiveResourceResponse(frame(), identifier, do cumentLoader, response, resourceLoader); | 271 InspectorInstrumentation::didReceiveResourceResponse(frame(), identifier, do cumentLoader, response, resourceLoader); |
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
783 } | 785 } |
784 | 786 |
785 DEFINE_TRACE(FrameFetchContext) | 787 DEFINE_TRACE(FrameFetchContext) |
786 { | 788 { |
787 visitor->trace(m_document); | 789 visitor->trace(m_document); |
788 visitor->trace(m_documentLoader); | 790 visitor->trace(m_documentLoader); |
789 FetchContext::trace(visitor); | 791 FetchContext::trace(visitor); |
790 } | 792 } |
791 | 793 |
792 } // namespace blink | 794 } // namespace blink |
OLD | NEW |