Changeset 262085 in webkit
- Timestamp:
- May 22, 2020 3:50:50 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r262078 r262085 1 2020-05-22 Chris Dumez <cdumez@apple.com> 2 3 Revoking an object URL immediately after triggering navigation causes navigation to fail 4 https://bugs.webkit.org/show_bug.cgi?id=212279 5 <rdar://problem/63553090> 6 7 Reviewed by Geoffrey Garen. 8 9 Add layout test coverage. 10 11 * fast/loader/revoke-blob-url-after-navigation-expected.txt: Added. 12 * fast/loader/revoke-blob-url-after-navigation.html: Added. 13 1 14 2020-05-22 Jason Lawrence <lawrence.j@apple.com> 2 15 -
trunk/Source/WebCore/ChangeLog
r262076 r262085 1 2020-05-22 Chris Dumez <cdumez@apple.com> 2 3 Revoking an object URL immediately after triggering navigation causes navigation to fail 4 https://bugs.webkit.org/show_bug.cgi?id=212279 5 <rdar://problem/63553090> 6 7 Reviewed by Geoffrey Garen. 8 9 When doing a policy check for a Blob URL, we clone the blob and create a new temporary Blob URL 10 that stays alive for the duration of the policy check. We made sure to update the ResourceRequest 11 URL with the new Blob URL, however, we were failing to update the DocumentLoader's request. 12 As a result, if the client responded with Policy USE, the DocumentLoader would still attempt to 13 navigate to the old Blob URL. 14 15 Test: fast/loader/revoke-blob-url-after-navigation.html 16 17 * loader/PolicyChecker.cpp: 18 (WebCore::FrameLoader::PolicyChecker::extendBlobURLLifetimeIfNecessary const): 19 (WebCore::FrameLoader::PolicyChecker::checkNavigationPolicy): 20 (WebCore::FrameLoader::PolicyChecker::checkNewWindowPolicy): 21 * loader/PolicyChecker.h: 22 1 23 2020-05-22 Simon Fraser <simon.fraser@apple.com> 2 24 -
trunk/Source/WebCore/loader/PolicyChecker.cpp
r260890 r262085 105 105 } 106 106 107 CompletionHandlerCallingScope FrameLoader::PolicyChecker::extendBlobURLLifetimeIfNecessary(ResourceRequest& request ) const107 CompletionHandlerCallingScope FrameLoader::PolicyChecker::extendBlobURLLifetimeIfNecessary(ResourceRequest& request, DocumentLoader* loader) const 108 108 { 109 109 if (!request.url().protocolIsBlob()) … … 114 114 blobRegistry().registerBlobURL(temporaryBlobURL, request.url()); 115 115 request.setURL(temporaryBlobURL); 116 if (loader) 117 loader->request().setURL(temporaryBlobURL); 116 118 return CompletionHandler<void()>([temporaryBlobURL = WTFMove(temporaryBlobURL)] { 117 119 blobRegistry().unregisterBlobURL(temporaryBlobURL); … … 198 200 m_frame.loader().clearProvisionalLoadForPolicyCheck(); 199 201 200 auto blobURLLifetimeExtension = policyDecisionMode == PolicyDecisionMode::Asynchronous ? extendBlobURLLifetimeIfNecessary(request ) : CompletionHandlerCallingScope { };202 auto blobURLLifetimeExtension = policyDecisionMode == PolicyDecisionMode::Asynchronous ? extendBlobURLLifetimeIfNecessary(request, loader) : CompletionHandlerCallingScope { }; 201 203 202 204 bool isInitialEmptyDocumentLoad = !m_frame.loader().stateMachine().committedFirstRealDocumentLoad() && request.url().protocolIsAbout() && !substituteData.isValid(); … … 256 258 return function({ }, nullptr, { }, { }, ShouldContinuePolicyCheck::No); 257 259 258 auto blobURLLifetimeExtension = extendBlobURLLifetimeIfNecessary(request );260 auto blobURLLifetimeExtension = extendBlobURLLifetimeIfNecessary(request, nullptr); 259 261 260 262 auto requestIdentifier = PolicyCheckIdentifier::create(); -
trunk/Source/WebCore/loader/PolicyChecker.h
r260890 r262085 90 90 private: 91 91 void handleUnimplementablePolicy(const ResourceError&); 92 WTF::CompletionHandlerCallingScope extendBlobURLLifetimeIfNecessary(ResourceRequest& ) const;92 WTF::CompletionHandlerCallingScope extendBlobURLLifetimeIfNecessary(ResourceRequest&, DocumentLoader*) const; 93 93 94 94 Frame& m_frame;
Note: See TracChangeset
for help on using the changeset viewer.