WebKit Bugzilla
Attachment 338805 Details for
Bug 185002
: DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185002-20180425150740.patch (text/plain), 4.28 KB, created by
Daniel Bates
on 2018-04-25 15:07:40 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2018-04-25 15:07:40 PDT
Size:
4.28 KB
patch
obsolete
>Subversion Revision: 231021 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index bd453214a9598cc254e1de90ce6948a2a829a1a7..dce7cee6a055028073c29e95230beb418653fae1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,20 @@ >+2018-04-25 Daniel Bates <dabates@apple.com> >+ >+ DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest >+ https://bugs.webkit.org/show_bug.cgi?id=185002 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ In r224852 we extracted logic from DocumentLoader::startLoadingMainResource() into a new >+ function DocumentLoader::loadMainResource() that could be shared by both DocumentLoader::startLoadingMainResource() >+ and the service worker code. As part of this extraction, DocumentLoader::loadMainResource() >+ takes a ResourceRequest by rvalue reference, but it never actually takes ownership of this >+ ResourceRequest and subsequently makes a copy of it when instantiating a CachedResourceRequest. >+ Instead we should WTFMove() the passed request into the CachedResourceRequest. >+ >+ * loader/DocumentLoader.cpp: >+ (WebCore::DocumentLoader::loadMainResource): >+ > 2018-04-25 Ryosuke Niwa <rniwa@webkit.org> > > PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank >diff --git a/Source/WebCore/loader/DocumentLoader.cpp b/Source/WebCore/loader/DocumentLoader.cpp >index 340d092a4beb22a976215efc5b3d0a760bb61916..49fc8ab4e61ce5adb4ad3d9e71f7ceb4e8ff725b 100644 >--- a/Source/WebCore/loader/DocumentLoader.cpp >+++ b/Source/WebCore/loader/DocumentLoader.cpp >@@ -1732,7 +1732,7 @@ void DocumentLoader::startLoadingMainResource(ShouldContinue shouldContinue) > void DocumentLoader::loadMainResource(ResourceRequest&& request) > { > static NeverDestroyed<ResourceLoaderOptions> mainResourceLoadOptions(SendCallbacks, SniffContent, BufferData, StoredCredentialsPolicy::Use, ClientCredentialPolicy::MayAskClientForCredentials, FetchOptions::Credentials::Include, SkipSecurityCheck, FetchOptions::Mode::Navigate, IncludeCertificateInfo, ContentSecurityPolicyImposition::SkipPolicyCheck, DefersLoadingPolicy::AllowDefersLoading, CachingPolicy::AllowCaching); >- CachedResourceRequest mainResourceRequest(ResourceRequest(request), mainResourceLoadOptions); >+ CachedResourceRequest mainResourceRequest(WTFMove(request), mainResourceLoadOptions); > if (!m_frame->isMainFrame() && m_frame->document()) { > // If we are loading the main resource of a subframe, use the cache partition of the main document. > mainResourceRequest.setDomainForCachePartition(*m_frame->document()); >@@ -1783,20 +1783,21 @@ void DocumentLoader::loadMainResource(ResourceRequest&& request) > > if (!mainResourceLoader()) { > m_identifierForLoadWithoutResourceLoader = m_frame->page()->progress().createUniqueIdentifier(); >- frameLoader()->notifier().assignIdentifierToInitialRequest(m_identifierForLoadWithoutResourceLoader, this, request); >- frameLoader()->notifier().dispatchWillSendRequest(this, m_identifierForLoadWithoutResourceLoader, request, ResourceResponse()); >+ frameLoader()->notifier().assignIdentifierToInitialRequest(m_identifierForLoadWithoutResourceLoader, this, mainResourceRequest.resourceRequest()); >+ frameLoader()->notifier().dispatchWillSendRequest(this, m_identifierForLoadWithoutResourceLoader, mainResourceRequest.resourceRequest(), ResourceResponse()); > } > > becomeMainResourceClient(); > > // A bunch of headers are set when the underlying ResourceLoader is created, and m_request needs to include those. >+ ResourceRequest updatedRequest; > if (mainResourceLoader()) >- request = mainResourceLoader()->originalRequest(); >+ updatedRequest = mainResourceLoader()->originalRequest(); > // If there was a fragment identifier on m_request, the cache will have stripped it. m_request should include > // the fragment identifier, so add that back in. >- if (equalIgnoringFragmentIdentifier(m_request.url(), request.url())) >- request.setURL(m_request.url()); >- setRequest(request); >+ if (equalIgnoringFragmentIdentifier(m_request.url(), updatedRequest.url())) >+ updatedRequest.setURL(m_request.url()); >+ setRequest(updatedRequest); > } > > void DocumentLoader::cancelPolicyCheckIfNeeded()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
youennf
:
review+
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185002
: 338805 |
338817
|
338832
|
338836
|
338839
|
338847