Changeset 202888 in webkit


Ignore:
Timestamp:
Jul 6, 2016 6:32:43 PM (8 years ago)
Author:
Chris Dumez
Message:

[WK2][Cocoa] Disable ResourceResponse lazy initialization
https://bugs.webkit.org/show_bug.cgi?id=159497
<rdar://problem/27209066>

Reviewed by Alex Christensen.

Source/WebCore:

Add method to Cocoa's ResponseResponse header to disable
lazy initialization.

  • platform/network/cf/ResourceResponse.h:
  • platform/network/cocoa/ResourceResponseCocoa.mm:

(WebCore::ResourceResponse::disableLazyInitialization):

Source/WebKit2:

Disable ResourceResponse lazy initialization for WebKit2 as
we always end up initializing all the fields anyway when
sending the response to the WebContent process via IPC.

Even worse, we always do a partial lazy initialization (common
fields only) before the IPC so we always do the initialization
in 2 steps. This normally would not be an issue but the 2 steps
actually have some overlap because both call
CFHTTPMessageCopyAllHeaderFields(), which is expensive (See
<rdar://problem/26796059>) to first get the common HTTP headers,
then ALL the HTTP headers.

  • NetworkProcess/cocoa/NetworkSessionCocoa.mm:

(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r202887 r202888  
     12016-07-06  Chris Dumez  <cdumez@apple.com>
     2
     3        [WK2][Cocoa] Disable ResourceResponse lazy initialization
     4        https://bugs.webkit.org/show_bug.cgi?id=159497
     5        <rdar://problem/27209066>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Add method to Cocoa's ResponseResponse header to disable
     10        lazy initialization.
     11
     12        * platform/network/cf/ResourceResponse.h:
     13        * platform/network/cocoa/ResourceResponseCocoa.mm:
     14        (WebCore::ResourceResponse::disableLazyInitialization):
     15
    1162016-07-06  Brent Fulgham  <bfulgham@apple.com>
    217
  • trunk/Source/WebCore/platform/network/cf/ResourceResponse.h

    r201721 r202888  
    6969    }
    7070
     71#if PLATFORM(COCOA)
     72    WEBCORE_EXPORT void disableLazyInitialization();
     73#endif
     74
    7175    unsigned memoryUsage() const
    7276    {
  • trunk/Source/WebCore/platform/network/cocoa/ResourceResponseCocoa.mm

    r202121 r202888  
    6969}
    7070
     71void ResourceResponse::disableLazyInitialization()
     72{
     73    lazyInit(AllFields);
     74}
     75
    7176CertificateInfo ResourceResponse::platformCertificateInfo() const
    7277{
  • trunk/Source/WebKit2/ChangeLog

    r202884 r202888  
     12016-07-06  Chris Dumez  <cdumez@apple.com>
     2
     3        [WK2][Cocoa] Disable ResourceResponse lazy initialization
     4        https://bugs.webkit.org/show_bug.cgi?id=159497
     5        <rdar://problem/27209066>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Disable ResourceResponse lazy initialization for WebKit2 as
     10        we always end up initializing all the fields anyway when
     11        sending the response to the WebContent process via IPC.
     12
     13        Even worse, we always do a partial lazy initialization (common
     14        fields only) before the IPC so we always do the initialization
     15        in 2 steps. This normally would not be an issue but the 2 steps
     16        actually have some overlap because both call
     17        CFHTTPMessageCopyAllHeaderFields(), which is expensive (See
     18        <rdar://problem/26796059>) to first get the common HTTP headers,
     19        then ALL the HTTP headers.
     20
     21        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
     22        (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
     23
    1242016-07-06  Chelsea Pugh  <cpugh@apple.com>
    225
  • trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm

    r202834 r202888  
    246246
    247247        WebCore::ResourceResponse resourceResponse(response);
     248        // Lazy initialization is not helpful in the WebKit2 case because we always end up initializing
     249        // all the fields when sending the response to the WebContent process over IPC.
     250        resourceResponse.disableLazyInitialization();
     251
    248252        copyTimingData([dataTask _timingData], resourceResponse.resourceLoadTiming());
    249253        auto completionHandlerCopy = Block_copy(completionHandler);
Note: See TracChangeset for help on using the changeset viewer.