Changeset 257505 in webkit
- Timestamp:
- Feb 26, 2020 1:12:54 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r257502 r257505 1 2020-02-26 Keith Rollin <krollin@apple.com> 2 3 Add logging to help diagnose redirect issue 4 https://bugs.webkit.org/show_bug.cgi?id=207916 5 <rdar://problem/59567875> 6 7 Reviewed by Chris Dumez. 8 9 We're seeing an issue where communication between the WebContent 10 process and the Network process seems to come to a stop between 11 NetworkResourceLoader::continueWillSendRedirectedRequest and 12 NetworkResourceLoader::continueWillSendRequest. We do see a 13 WebResourceLoader::willSendRequest log line between those two 14 NetworkResourceLoader logging lines, but nothing else. Add a bunch of 15 logging in this area to help determine what's happening. 16 17 No new tests -- no new or changed functionality. 18 19 * loader/PolicyChecker.cpp: 20 (WebCore::PolicyChecker::checkNavigationPolicy): 21 * loader/ResourceLoader.cpp: 22 (WebCore::ResourceLoader::loadDataURL): 23 (WebCore::ResourceLoader::willSendRequestInternal): 24 (WebCore::ResourceLoader::didFinishLoading): 25 (WebCore::ResourceLoader::didFail): 26 (WebCore::ResourceLoader::willSendRequestAsync): 27 (WebCore::ResourceLoader::wasBlocked): 28 (WebCore::ResourceLoader::cannotShowURL): 29 * loader/SubresourceLoader.cpp: 30 (WebCore::SubresourceLoader::init): 31 (WebCore::SubresourceLoader::willSendRequestInternal): 32 (WebCore::SubresourceLoader::didReceiveResponse): 33 (WebCore::SubresourceLoader::didFinishLoading): 34 (WebCore::SubresourceLoader::didFail): 35 (WebCore::SubresourceLoader::willCancel): 36 * loader/cache/CachedRawResource.cpp: 37 (WebCore::CachedRawResource::redirectReceived): 38 * loader/cache/CachedResource.cpp: 39 (WebCore::CachedResource::redirectReceived): 40 * loader/cache/CachedResourceLoader.cpp: 41 (WebCore::CachedResourceLoader::canRequestAfterRedirection const): 42 1 43 2020-02-26 Daniel Bates <dabates@apple.com> 2 44 -
trunk/Source/WebCore/loader/PolicyChecker.cpp
r254930 r257505 54 54 #endif 55 55 56 #define IS_ALLOWED (m_frame.page() ? m_frame.page()->sessionID().isAlwaysOnLoggingAllowed() : false) 57 #define PAGE_ID (m_frame.loader().client().pageID().valueOr(PageIdentifier()).toUInt64()) 58 #define FRAME_ID (m_frame.loader().client().frameID().valueOr(FrameIdentifier()).toUInt64()) 59 #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(IS_ALLOWED, Loading, "%p - [pageID=%" PRIu64 ", frameID=%" PRIu64 "] PolicyChecker::" fmt, this, PAGE_ID, FRAME_ID, ##__VA_ARGS__) 60 56 61 namespace WebCore { 57 62 … … 129 134 // This avoids confusion on the part of the client. 130 135 if (equalIgnoringHeaderFields(request, loader->lastCheckedRequest()) || (!request.isNull() && request.url().isEmpty())) { 136 if (!request.isNull() && request.url().isEmpty()) 137 RELEASE_LOG_IF_ALLOWED("checkNavigationPolicy: continuing because the URL is empty"); 138 else 139 RELEASE_LOG_IF_ALLOWED("checkNavigationPolicy: continuing because the URL is the same as the last request"); 131 140 function(ResourceRequest(request), { }, NavigationPolicyDecision::ContinueLoad); 132 141 loader->setLastCheckedRequest(WTFMove(request)); … … 144 153 if (isBackForwardLoadType(m_loadType)) 145 154 m_loadType = FrameLoadType::Reload; 155 if (shouldContinue) 156 RELEASE_LOG_IF_ALLOWED("checkNavigationPolicy: continuing because we have valid substitute data"); 157 else 158 RELEASE_LOG_IF_ALLOWED("checkNavigationPolicy: not continuing with substitute data because the content filter told us not to"); 159 146 160 function(WTFMove(request), { }, shouldContinue ? NavigationPolicyDecision::ContinueLoad : NavigationPolicyDecision::IgnoreLoad); 147 161 return; … … 154 168 m_frame.ownerElement()->dispatchEvent(Event::create(eventNames().loadEvent, Event::CanBubble::No, Event::IsCancelable::No)); 155 169 } 170 RELEASE_LOG_IF_ALLOWED("checkNavigationPolicy: ignoring because disallowed by content security policy"); 156 171 function(WTFMove(request), { }, NavigationPolicyDecision::IgnoreLoad); 157 172 return; … … 162 177 #if USE(QUICK_LOOK) 163 178 // Always allow QuickLook-generated URLs based on the protocol scheme. 164 if (!request.isNull() && isQuickLookPreviewURL(request.url())) 179 if (!request.isNull() && isQuickLookPreviewURL(request.url())) { 180 RELEASE_LOG_IF_ALLOWED("checkNavigationPolicy: continuing because quicklook-generated URL"); 165 181 return function(WTFMove(request), makeWeakPtr(formState.get()), NavigationPolicyDecision::ContinueLoad); 182 } 166 183 #endif 167 184 … … 173 190 frame->loader().reload(); 174 191 }); 192 RELEASE_LOG_IF_ALLOWED("checkNavigationPolicy: ignoring because ContentFilterUnblockHandler can handle the request"); 175 193 return function({ }, nullptr, NavigationPolicyDecision::IgnoreLoad); 176 194 } … … 187 205 String suggestedFilename = action.downloadAttribute().isEmpty() ? nullAtom() : action.downloadAttribute(); 188 206 FramePolicyFunction decisionHandler = [this, function = WTFMove(function), request = ResourceRequest(request), formState = WTFMove(formState), suggestedFilename = WTFMove(suggestedFilename), 189 blobURLLifetimeExtension = WTFMove(blobURLLifetimeExtension), requestIdentifier] (PolicyAction policyAction, PolicyCheckIdentifier responseIdentifier) mutable { 190 if (!responseIdentifier.isValidFor(requestIdentifier)) 207 blobURLLifetimeExtension = WTFMove(blobURLLifetimeExtension), requestIdentifier, isInitialEmptyDocumentLoad] (PolicyAction policyAction, PolicyCheckIdentifier responseIdentifier) mutable { 208 if (!responseIdentifier.isValidFor(requestIdentifier)) { 209 RELEASE_LOG_IF_ALLOWED("checkNavigationPolicy: ignoring because response is not valid for request"); 191 210 return function({ }, nullptr, NavigationPolicyDecision::IgnoreLoad); 211 } 192 212 193 213 m_delegateIsDecidingNavigationPolicy = false; … … 199 219 FALLTHROUGH; 200 220 case PolicyAction::Ignore: 221 RELEASE_LOG_IF_ALLOWED("checkNavigationPolicy: ignoring because policyAction from dispatchDecidePolicyForNavigationAction is Ignore"); 201 222 return function({ }, nullptr, NavigationPolicyDecision::IgnoreLoad); 202 223 case PolicyAction::StopAllLoads: 224 RELEASE_LOG_IF_ALLOWED("checkNavigationPolicy: stopping because policyAction from dispatchDecidePolicyForNavigationAction is StopAllLoads"); 203 225 function({ }, nullptr, NavigationPolicyDecision::StopAllLoads); 204 226 return; … … 206 228 if (!m_frame.loader().client().canHandleRequest(request)) { 207 229 handleUnimplementablePolicy(m_frame.loader().client().cannotShowURLError(request)); 230 RELEASE_LOG_IF_ALLOWED("checkNavigationPolicy: ignoring because frame loader client can't handle the request"); 208 231 return function({ }, { }, NavigationPolicyDecision::IgnoreLoad); 209 232 } 233 if (isInitialEmptyDocumentLoad) 234 RELEASE_LOG_IF_ALLOWED("checkNavigationPolicy: continuing because this is an initial empty document"); 235 else 236 RELEASE_LOG_IF_ALLOWED("checkNavigationPolicy: continuing because this policyAction from dispatchDecidePolicyForNavigationAction is Use"); 210 237 return function(WTFMove(request), makeWeakPtr(formState.get()), NavigationPolicyDecision::ContinueLoad); 211 238 } … … 276 303 277 304 } // namespace WebCore 305 306 #undef IS_ALLOWED 307 #undef PAGE_ID 308 #undef FRAME_ID 309 #undef RELEASE_LOG_IF_ALLOWED -
trunk/Source/WebCore/loader/ResourceLoader.cpp
r256583 r257505 65 65 66 66 #undef RELEASE_LOG_IF_ALLOWED 67 #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Network, "%p - ResourceLoader::" fmt, this, ##__VA_ARGS__)67 #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), Network, "%p - [frame=%p, frameLoader=%p, resourceID=%lu] ResourceLoader::" fmt, this, frame(), frameLoader(), identifier(), ##__VA_ARGS__) 68 68 69 69 namespace WebCore { … … 273 273 return; 274 274 if (!decodeResult) { 275 RELEASE_LOG_IF_ALLOWED("loadDataURL: decoding of data failed (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());275 RELEASE_LOG_IF_ALLOWED("loadDataURL: decoding of data failed"); 276 276 protectedThis->didFail(ResourceError(errorDomainWebKitInternal, 0, url, "Data URL decoding failed")); 277 277 return; … … 372 372 ContentExtensions::applyResultsToRequest(WTFMove(results), page, request); 373 373 if (blockedLoad) { 374 RELEASE_LOG_IF_ALLOWED("willSendRequest internal: resource load canceled because of content blocker (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());374 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: resource load canceled because of content blocker"); 375 375 didFail(blockedByContentBlockerError()); 376 376 completionHandler({ }); … … 382 382 383 383 if (request.isNull()) { 384 RELEASE_LOG_IF_ALLOWED("willSendRequest internal: resource load canceled because of empty request (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());384 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: resource load canceled because of empty request"); 385 385 didFail(cannotShowURLError()); 386 386 completionHandler({ }); … … 395 395 // If this ResourceLoader was stopped as a result of assignIdentifierToInitialRequest, bail out 396 396 if (m_reachedTerminalState) { 397 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: resource load reached terminal state after calling assignIdentifierToInitialRequest()"); 397 398 completionHandler(WTFMove(request)); 398 399 return; … … 430 431 } 431 432 } 433 434 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: calling completion handler"); 432 435 completionHandler(WTFMove(request)); 433 436 } … … 540 543 void ResourceLoader::didFinishLoading(const NetworkLoadMetrics& networkLoadMetrics) 541 544 { 542 RELEASE_LOG_IF_ALLOWED("didFinishLoading: (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());545 RELEASE_LOG_IF_ALLOWED("didFinishLoading:"); 543 546 544 547 didFinishLoadingOnePart(networkLoadMetrics); … … 568 571 void ResourceLoader::didFail(const ResourceError& error) 569 572 { 570 RELEASE_LOG_IF_ALLOWED("didFail: (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());573 RELEASE_LOG_IF_ALLOWED("didFail:"); 571 574 572 575 if (wasCancelled()) … … 670 673 RefPtr<ResourceHandle> protectedHandle(handle); 671 674 if (documentLoader()->applicationCacheHost().maybeLoadFallbackForRedirect(this, request, redirectResponse)) { 672 RELEASE_LOG_IF_ALLOWED("willSendRequestAsync: exiting early because maybeLoadFallbackForRedirect returned false (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());675 RELEASE_LOG_IF_ALLOWED("willSendRequestAsync: exiting early because maybeLoadFallbackForRedirect returned false"); 673 676 completionHandler(WTFMove(request)); 674 677 return; … … 716 719 void ResourceLoader::wasBlocked(ResourceHandle*) 717 720 { 718 RELEASE_LOG_IF_ALLOWED("wasBlocked: resource load canceled because of content blocker (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());721 RELEASE_LOG_IF_ALLOWED("wasBlocked: resource load canceled because of content blocker"); 719 722 didFail(blockedError()); 720 723 } … … 722 725 void ResourceLoader::cannotShowURL(ResourceHandle*) 723 726 { 724 RELEASE_LOG_IF_ALLOWED("wasBlocked: resource load canceled because of invalid URL (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());727 RELEASE_LOG_IF_ALLOWED("wasBlocked: resource load canceled because of invalid URL"); 725 728 didFail(cannotShowURLError()); 726 729 } -
trunk/Source/WebCore/loader/SubresourceLoader.cpp
r256632 r257505 71 71 #undef RELEASE_LOG_IF_ALLOWED 72 72 #undef RELEASE_LOG_ERROR_IF_ALLOWED 73 #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), ResourceLoading, "%p - SubresourceLoader::" fmt, this, ##__VA_ARGS__)74 #define RELEASE_LOG_ERROR_IF_ALLOWED(fmt, ...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), ResourceLoading, "%p - SubresourceLoader::" fmt, this, ##__VA_ARGS__)73 #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(isAlwaysOnLoggingAllowed(), ResourceLoading, "%p - [frame=%p, frameLoader=%p, resourceID=%lu] SubresourceLoader::" fmt, this, frame(), frameLoader(), identifier(), ##__VA_ARGS__) 74 #define RELEASE_LOG_ERROR_IF_ALLOWED(fmt, ...) RELEASE_LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), ResourceLoading, "%p - [frame=%p, frameLoader=%p, resourceID=%lu] SubresourceLoader::" fmt, this, frame(), frameLoader(), identifier(), ##__VA_ARGS__) 75 75 76 76 namespace WebCore { … … 167 167 if (!m_documentLoader) { 168 168 ASSERT_NOT_REACHED(); 169 RELEASE_LOG_ERROR (ResourceLoading, "SubresourceLoader::init: resource load canceled because document loader is null (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());169 RELEASE_LOG_ERROR_IF_ALLOWED("init: resource load canceled because document loader is null"); 170 170 return completionHandler(false); 171 171 } … … 190 190 191 191 if (!newRequest.url().isValid()) { 192 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: resource load canceled because new request is invalid"); 192 193 cancel(cannotShowURLError()); 193 194 return completionHandler(WTFMove(newRequest)); … … 201 202 202 203 auto continueWillSendRequest = [this, protectedThis = makeRef(*this), redirectResponse] (CompletionHandler<void(ResourceRequest&&)>&& completionHandler, ResourceRequest&& newRequest) mutable { 203 if (newRequest.isNull() || reachedTerminalState()) 204 if (newRequest.isNull() || reachedTerminalState()) { 205 if (newRequest.isNull()) 206 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: resource load canceled because new request is NULL (1)"); 207 else 208 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: resource load canceled because reached terminal state"); 204 209 return completionHandler(WTFMove(newRequest)); 210 } 205 211 206 212 ResourceLoader::willSendRequestInternal(WTFMove(newRequest), redirectResponse, [this, protectedThis = WTFMove(protectedThis), completionHandler = WTFMove(completionHandler), redirectResponse] (ResourceRequest&& request) mutable { … … 209 215 210 216 if (request.isNull()) { 217 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: resource load canceled because request is NULL (2)"); 211 218 cancel(); 212 219 return completionHandler(WTFMove(request)); … … 215 222 if (m_resource->type() == CachedResource::Type::MainResource && !redirectResponse.isNull()) 216 223 m_documentLoader->willContinueMainResourceLoadAfterRedirect(request); 224 225 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: resource load finished; calling completion handler"); 217 226 completionHandler(WTFMove(request)); 218 227 }); … … 228 237 m_frame->document()->addConsoleMessage(MessageSource::Security, MessageLevel::Error, error.localizedDescription()); 229 238 230 RELEASE_LOG_IF_ALLOWED("willSendRequest internal: resource load canceled because not allowed to follow a redirect (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());239 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: resource load canceled because not allowed to follow a redirect"); 231 240 232 241 cancel(error); … … 239 248 m_resource->responseReceived(opaqueRedirectedResponse); 240 249 if (reachedTerminalState()) { 241 RELEASE_LOG_IF_ALLOWED("willSendRequest internal: reached terminal state (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());250 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: reached terminal state"); 242 251 return completionHandler(WTFMove(newRequest)); 243 252 } 244 253 245 RELEASE_LOG_IF_ALLOWED("willSendRequest internal: resource load completed (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());254 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: resource load completed"); 246 255 247 256 NetworkLoadMetrics emptyMetrics; … … 249 258 return completionHandler(WTFMove(newRequest)); 250 259 } else if (m_redirectCount++ >= options().maxRedirectCount) { 251 RELEASE_LOG_IF_ALLOWED("willSendRequest internal: resource load canceled because too many redirects (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());260 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: resource load canceled because too many redirects"); 252 261 cancel(ResourceError(String(), 0, request().url(), "Too many redirections"_s, ResourceError::Type::General)); 253 262 return completionHandler(WTFMove(newRequest)); … … 266 275 267 276 if (!m_documentLoader->cachedResourceLoader().updateRequestAfterRedirection(m_resource->type(), newRequest, options())) { 268 RELEASE_LOG_IF_ALLOWED("willSendRequest internal: resource load canceled because something about updateRequestAfterRedirection (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());277 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: resource load canceled because CachedResourceLoader::updateRequestAfterRedirection (really CachedResourceLoader::canRequestAfterRedirection) said no"); 269 278 cancel(); 270 279 return completionHandler(WTFMove(newRequest)); … … 276 285 if (m_frame && m_frame->document()) 277 286 m_frame->document()->addConsoleMessage(MessageSource::Security, MessageLevel::Error, errorMessage); 278 RELEASE_LOG_IF_ALLOWED("willSendRequest internal: resource load canceled because crosss-origin redirection denied by CORS policy (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());287 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: resource load canceled because crosss-origin redirection denied by CORS policy"); 279 288 cancel(ResourceError(String(), 0, request().url(), errorMessage, ResourceError::Type::AccessControl)); 280 289 return completionHandler(WTFMove(newRequest)); … … 282 291 283 292 if (m_resource->isImage() && m_documentLoader->cachedResourceLoader().shouldDeferImageLoad(newRequest.url())) { 284 RELEASE_LOG_IF_ALLOWED("willSendRequest internal: resource load canceled because it's an image that should be defered (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());293 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: resource load canceled because it's an image that should be defered"); 285 294 cancel(); 286 295 return completionHandler(WTFMove(newRequest)); 287 296 } 288 297 m_loadTiming.addRedirect(redirectResponse.url(), newRequest.url()); 289 m_resource->redirectReceived(WTFMove(newRequest), redirectResponse, [completionHandler = WTFMove(completionHandler), continueWillSendRequest = WTFMove(continueWillSendRequest)] (ResourceRequest&& request) mutable { 298 m_resource->redirectReceived(WTFMove(newRequest), redirectResponse, [this, protectedThis = WTFMove(protectedThis), completionHandler = WTFMove(completionHandler), continueWillSendRequest = WTFMove(continueWillSendRequest)] (ResourceRequest&& request) mutable { 299 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: resource done notifying clients"); 290 300 continueWillSendRequest(WTFMove(completionHandler), WTFMove(request)); 291 301 }); … … 293 303 } 294 304 305 RELEASE_LOG_IF_ALLOWED("willSendRequestInternal: redirect response is NULL"); 295 306 continueWillSendRequest(WTFMove(completionHandler), WTFMove(newRequest)); 296 307 } … … 352 363 auto& loader = m_documentLoader->cachedResourceLoader(); 353 364 if (!loader.allowedByContentSecurityPolicy(m_resource->type(), response.url(), options(), ContentSecurityPolicy::RedirectResponseReceived::Yes)) { 354 RELEASE_LOG_IF_ALLOWED("didReceiveResponse: canceling load because not allowed by content policy (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());365 RELEASE_LOG_IF_ALLOWED("didReceiveResponse: canceling load because not allowed by content policy"); 355 366 cancel(ResourceError({ }, 0, response.url(), { }, ResourceError::Type::General)); 356 367 return; … … 360 371 361 372 if (auto error = validateRangeRequestedFlag(request(), response)) { 362 RELEASE_LOG_IF_ALLOWED("didReceiveResponse: canceling load because receiving a range requested response for a non-range request (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());373 RELEASE_LOG_IF_ALLOWED("didReceiveResponse: canceling load because receiving a range requested response for a non-range request"); 363 374 cancel(WTFMove(*error)); 364 375 return; … … 403 414 if (m_frame && m_frame->document()) 404 415 m_frame->document()->addConsoleMessage(MessageSource::Security, MessageLevel::Error, errorDescription); 405 RELEASE_LOG_IF_ALLOWED("didReceiveResponse: canceling load because of cross origin access control (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());416 RELEASE_LOG_IF_ALLOWED("didReceiveResponse: canceling load because of cross origin access control"); 406 417 cancel(ResourceError(String(), 0, request().url(), errorDescription, ResourceError::Type::AccessControl)); 407 418 return; … … 443 454 m_requestCountTracker = WTF::nullopt; 444 455 if (!m_resource->isImage()) { 445 RELEASE_LOG_IF_ALLOWED("didReceiveResponse: canceling load because something about a multi-part non-image (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());456 RELEASE_LOG_IF_ALLOWED("didReceiveResponse: canceling load because something about a multi-part non-image"); 446 457 cancel(); 447 458 return; … … 662 673 void SubresourceLoader::didFinishLoading(const NetworkLoadMetrics& networkLoadMetrics) 663 674 { 664 RELEASE_LOG_IF_ALLOWED("didFinishLoading: (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());675 RELEASE_LOG_IF_ALLOWED("didFinishLoading:"); 665 676 666 677 #if USE(QUICK_LOOK) … … 708 719 709 720 if (wasCancelled()) { 710 RELEASE_LOG_IF_ALLOWED("didFinishLoading: was canceled (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());721 RELEASE_LOG_IF_ALLOWED("didFinishLoading: was canceled"); 711 722 return; 712 723 } … … 718 729 719 730 if (reachedTerminalState()) { 720 RELEASE_LOG_IF_ALLOWED("didFinishLoading: reached terminal state (frame = %p, frameLoader = %p, resourceID = %lu)", frame(), frameLoader(), identifier());731 RELEASE_LOG_IF_ALLOWED("didFinishLoading: reached terminal state"); 721 732 return; 722 733 } … … 726 737 void SubresourceLoader::didFail(const ResourceError& error) 727 738 { 728 RELEASE_LOG_IF_ALLOWED("didFail: ( frame = %p, frameLoader = %p, resourceID = %lu, type = %d, code = %d)", frame(), frameLoader(), identifier(), static_cast<int>(error.type()), error.errorCode());739 RELEASE_LOG_IF_ALLOWED("didFail: (type = %d, code = %d)", static_cast<int>(error.type()), error.errorCode()); 729 740 730 741 #if USE(QUICK_LOOK) … … 764 775 void SubresourceLoader::willCancel(const ResourceError& error) 765 776 { 766 RELEASE_LOG_IF_ALLOWED("willCancel: ( frame = %p, frameLoader = %p, resourceID = %lu, type = %d, code = %d)", frame(), frameLoader(), identifier(), static_cast<int>(error.type()), error.errorCode());777 RELEASE_LOG_IF_ALLOWED("willCancel: (type = %d, code = %d)", static_cast<int>(error.type()), error.errorCode()); 767 778 768 779 #if PLATFORM(IOS_FAMILY) -
trunk/Source/WebCore/loader/cache/CachedRawResource.cpp
r251105 r257505 31 31 #include "CachedResourceLoader.h" 32 32 #include "HTTPHeaderNames.h" 33 #include "Logging.h" 33 34 #include "SharedBuffer.h" 34 35 #include "SubresourceLoader.h" … … 36 37 #include <wtf/SetForScope.h> 37 38 #include <wtf/text/StringView.h> 39 40 #define RELEASE_LOG_ALWAYS(fmt, ...) RELEASE_LOG(Network, "%p - CachedRawResource::" fmt, this, ##__VA_ARGS__) 38 41 39 42 namespace WebCore { … … 205 208 void CachedRawResource::redirectReceived(ResourceRequest&& request, const ResourceResponse& response, CompletionHandler<void(ResourceRequest&&)>&& completionHandler) 206 209 { 210 RELEASE_LOG_ALWAYS("redirectReceived:"); 207 211 if (response.isNull()) 208 212 CachedResource::redirectReceived(WTFMove(request), response, WTFMove(completionHandler)); -
trunk/Source/WebCore/loader/cache/CachedResource.cpp
r257206 r257505 62 62 #endif 63 63 64 #undef RELEASE_LOG_IF_ALLOWED 65 #undef RELEASE_LOG_ALWAYS 64 66 #define RELEASE_LOG_IF_ALLOWED(fmt, ...) RELEASE_LOG_IF(cachedResourceLoader.isAlwaysOnLoggingAllowed(), Network, "%p - CachedResource::" fmt, this, ##__VA_ARGS__) 67 #define RELEASE_LOG_ALWAYS(fmt, ...) RELEASE_LOG(Network, "%p - CachedResource::" fmt, this, ##__VA_ARGS__) 65 68 66 69 namespace WebCore { … … 486 489 void CachedResource::redirectReceived(ResourceRequest&& request, const ResourceResponse& response, CompletionHandler<void(ResourceRequest&&)>&& completionHandler) 487 490 { 491 RELEASE_LOG_ALWAYS("redirectReceived:"); 492 488 493 m_requestedFromNetworkingLayer = true; 489 if (response.isNull()) 490 return completionHandler(WTFMove(request)); 491 492 updateRedirectChainStatus(m_redirectChainCacheStatus, response); 494 if (!response.isNull()) 495 updateRedirectChainStatus(m_redirectChainCacheStatus, response); 496 493 497 completionHandler(WTFMove(request)); 494 498 } -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r256786 r257505 541 541 if (document() && !document()->securityOrigin().canDisplay(url)) { 542 542 FrameLoader::reportLocalLoadFailed(frame(), url.stringCenterEllipsizedToLength()); 543 LOG(ResourceLoading, "CachedResourceLoader::requestResource URL was not allowed by SecurityOrigin::canDisplay"); 543 LOG(ResourceLoading, "CachedResourceLoader::canRequestAfterRedirection URL was not allowed by SecurityOrigin::canDisplay"); 544 RELEASE_LOG_IF_ALLOWED("canRequestAfterRedirection: URL was not allowed by SecurityOrigin::canDisplay"); 544 545 return false; 545 546 } … … 549 550 550 551 if (options.mode == FetchOptions::Mode::SameOrigin && !m_document->securityOrigin().canRequest(url)) { 552 RELEASE_LOG_IF_ALLOWED("canRequestAfterRedirection: URL was not allowed by SecurityOrigin::canRequest"); 551 553 printAccessDeniedMessage(url); 552 554 return false; 553 555 } 554 556 555 if (!allowedByContentSecurityPolicy(type, url, options, ContentSecurityPolicy::RedirectResponseReceived::Yes)) 556 return false; 557 if (!allowedByContentSecurityPolicy(type, url, options, ContentSecurityPolicy::RedirectResponseReceived::Yes)) { 558 RELEASE_LOG_IF_ALLOWED("canRequestAfterRedirection: URL was not allowed by content policy"); 559 return false; 560 } 557 561 558 562 // Last of all, check for insecure content. We do this last so that when folks block insecure content with a CSP policy, they don't get a warning. 559 563 // They'll still get a warning in the console about CSP blocking the load. 560 if (!checkInsecureContent(type, url)) 561 return false; 564 if (!checkInsecureContent(type, url)) { 565 RELEASE_LOG_IF_ALLOWED("canRequestAfterRedirection: URL was not allowed because content is insecure"); 566 return false; 567 } 562 568 563 569 return true; -
trunk/Source/WebKit/ChangeLog
r257503 r257505 1 2020-02-26 Keith Rollin <krollin@apple.com> 2 3 Add logging to help diagnose redirect issue 4 https://bugs.webkit.org/show_bug.cgi?id=207916 5 <rdar://problem/59567875> 6 7 Reviewed by Chris Dumez. 8 9 We're seeing an issue where communication between the WebContent 10 process and the Network process seems to come to a stop between 11 NetworkResourceLoader::continueWillSendRedirectedRequest and 12 NetworkResourceLoader::continueWillSendRequest. We do see a 13 WebResourceLoader::willSendRequest log line between those two 14 NetworkResourceLoader logging lines, but nothing else. Add a bunch of 15 logging in this area to help determine what's happening. 16 17 * WebProcess/Network/WebResourceLoader.cpp: 18 (WebKit::WebResourceLoader::willSendRequest): 19 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 20 (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): 21 1 22 2020-02-26 Chris Dumez <cdumez@apple.com> 2 23 -
trunk/Source/WebKit/WebProcess/Network/WebResourceLoader.cpp
r254087 r257505 115 115 } 116 116 117 RELEASE_LOG_IF_ALLOWED("willSendRequest: returning ContinueWillSendRequest"); 117 118 send(Messages::NetworkResourceLoader::ContinueWillSendRequest(request, m_coreLoader->isAllowedToAskUserForCredentials())); 118 119 }); -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r257185 r257505 809 809 WebPage* webPage = m_frame ? m_frame->page() : nullptr; 810 810 if (!webPage) { 811 WEBFRAMELOADERCLIENT_RELEASE_LOG(Network, "dispatchDecidePolicyForResponse: ignoring because there's no web page"); 811 812 function(PolicyAction::Ignore, identifier); 812 813 return; … … 814 815 815 816 if (!request.url().string()) { 817 WEBFRAMELOADERCLIENT_RELEASE_LOG(Network, "dispatchDecidePolicyForResponse: continuing because the url string is null"); 816 818 function(PolicyAction::Use, identifier); 817 819 return; … … 823 825 WKBundlePagePolicyAction policy = webPage->injectedBundlePolicyClient().decidePolicyForResponse(webPage, m_frame, response, request, userData); 824 826 if (policy == WKBundlePagePolicyActionUse) { 827 WEBFRAMELOADERCLIENT_RELEASE_LOG(Network, "dispatchDecidePolicyForResponse: continuing because injected bundle says so"); 825 828 function(PolicyAction::Use, identifier); 826 829 return; … … 836 839 uint64_t listenerID = m_frame->setUpPolicyListener(identifier, WTFMove(function), WebFrame::ForNavigationAction::No); 837 840 if (!webPage->send(Messages::WebPageProxy::DecidePolicyForResponse(m_frame->frameID(), SecurityOriginData::fromFrame(coreFrame), identifier, navigationID, response, request, 838 canShowResponse, downloadAttribute, listenerID, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())))) 841 canShowResponse, downloadAttribute, listenerID, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())))) { 842 WEBFRAMELOADERCLIENT_RELEASE_LOG(Network, "dispatchDecidePolicyForResponse: ignoring because WebPageProxy::DecidePolicyForResponse failed"); 839 843 m_frame->didReceivePolicyDecision(listenerID, PolicyDecision { identifier, NavigatingToAppBoundDomain::No, PolicyAction::Ignore, 0, { }, { } }); 844 } 840 845 } 841 846
Note: See TracChangeset
for help on using the changeset viewer.