Changeset 183875 in webkit


Ignore:
Timestamp:
May 6, 2015 10:31:12 AM (9 years ago)
Author:
Antti Koivisto
Message:

REGRESSION (r183467): Unable to start downloads in private browsing mode
https://bugs.webkit.org/show_bug.cgi?id=144533

Reviewed by Darin Adler.

Source/WebCore:

If willSendRequest delegate mutated the request we would lose the requester field value from the original.

No test runner support for mutating requests.

  • platform/network/cf/ResourceRequestCFNet.cpp:

(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):

This needs to keep the requester too.

  • platform/network/cocoa/ResourceRequestCocoa.mm:

(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.

Share implementations.

Source/WebKit/mac:

  • WebCoreSupport/WebFrameLoaderClient.mm:

(WebFrameLoaderClient::dispatchWillSendRequest):

Use updateFromDelegatePreservingOldProperties (like WK2) instead of doing the same thing manually.

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r183871 r183875  
     12015-05-06  Antti Koivisto  <antti@apple.com>
     2
     3        REGRESSION (r183467): Unable to start downloads in private browsing mode
     4        https://bugs.webkit.org/show_bug.cgi?id=144533
     5
     6        Reviewed by Darin Adler.
     7
     8        If willSendRequest delegate mutated the request we would lose the requester field value from the original.
     9
     10        No test runner support for mutating requests.
     11
     12        * platform/network/cf/ResourceRequestCFNet.cpp:
     13        (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
     14
     15            This needs to keep the requester too.
     16
     17        * platform/network/cocoa/ResourceRequestCocoa.mm:
     18        (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.
     19
     20            Share implementations.
     21
    1222015-05-06  Ryosuke Niwa  <rniwa@webkit.org>
    223
  • trunk/Source/WebCore/platform/network/cf/ResourceRequestCFNet.cpp

    r183563 r183875  
    228228}
    229229
    230 void ResourceRequest::updateFromDelegatePreservingOldProperties(const ResourceRequest& delegateProvidedRequest)
    231 {
    232     ResourceLoadPriority oldPriority = priority();
    233     RefPtr<FormData> oldHTTPBody = httpBody();
    234     bool isHiddenFromInspector = hiddenFromInspector();
    235 
    236     *this = delegateProvidedRequest;
    237 
    238     setPriority(oldPriority);
    239     setHTTPBody(oldHTTPBody.release());
    240     setHiddenFromInspector(isHiddenFromInspector);
    241 }
    242 
    243230void ResourceRequest::doUpdateResourceRequest()
    244231{
     
    340327#endif // USE(CFNETWORK)
    341328
     329void ResourceRequest::updateFromDelegatePreservingOldProperties(const ResourceRequest& delegateProvidedRequest)
     330{
     331    // These are things we don't want willSendRequest delegate to mutate or reset.
     332    ResourceLoadPriority oldPriority = priority();
     333    RefPtr<FormData> oldHTTPBody = httpBody();
     334    bool isHiddenFromInspector = hiddenFromInspector();
     335    auto oldRequester = requester();
     336
     337    *this = delegateProvidedRequest;
     338
     339    setPriority(oldPriority);
     340    setHTTPBody(oldHTTPBody.release());
     341    setHiddenFromInspector(isHiddenFromInspector);
     342    setRequester(oldRequester);
     343}
     344
    342345bool ResourceRequest::httpPipeliningEnabled()
    343346{
  • trunk/Source/WebCore/platform/network/cocoa/ResourceRequestCocoa.mm

    r179584 r183875  
    206206}
    207207
    208 void ResourceRequest::updateFromDelegatePreservingOldProperties(const ResourceRequest& delegateProvidedRequest)
    209 {
    210     ResourceLoadPriority oldPriority = priority();
    211     RefPtr<FormData> oldHTTPBody = httpBody();
    212     bool isHiddenFromInspector = hiddenFromInspector();
    213 
    214     *this = delegateProvidedRequest;
    215 
    216     setPriority(oldPriority);
    217     setHTTPBody(oldHTTPBody.release());
    218     setHiddenFromInspector(isHiddenFromInspector);
    219 }
    220 
    221208#if !PLATFORM(IOS)
    222209void ResourceRequest::applyWebArchiveHackForMail()
  • trunk/Source/WebKit/mac/ChangeLog

    r183871 r183875  
     12015-05-06  Antti Koivisto  <antti@apple.com>
     2
     3        REGRESSION (r183467): Unable to start downloads in private browsing mode
     4        https://bugs.webkit.org/show_bug.cgi?id=144533
     5
     6        Reviewed by Darin Adler.
     7
     8        * WebCoreSupport/WebFrameLoaderClient.mm:
     9        (WebFrameLoaderClient::dispatchWillSendRequest):
     10
     11            Use updateFromDelegatePreservingOldProperties (like WK2) instead of doing the same thing manually.
     12
    1132015-05-06  Ryosuke Niwa  <rniwa@webkit.org>
    214
  • trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

    r183467 r183875  
    362362    NSURLRequest *currentURLRequest = request.nsURLRequest(UpdateHTTPBody);
    363363    NSURLRequest *newURLRequest = currentURLRequest;
    364     ResourceLoadPriority priority = request.priority();
    365     bool isHiddenFromInspector = request.hiddenFromInspector();
    366     auto requester = request.requester();
    367364#if PLATFORM(IOS)
    368365    if (implementations->webThreadWillSendRequestFunc) {
     
    374371
    375372    if (newURLRequest != currentURLRequest)
    376         request = newURLRequest;
    377     request.setHiddenFromInspector(isHiddenFromInspector);
    378     request.setPriority(priority);
    379     request.setRequester(requester);
     373        request.updateFromDelegatePreservingOldProperties(ResourceRequest(newURLRequest));
    380374}
    381375
Note: See TracChangeset for help on using the changeset viewer.