Changeset 173501 in webkit


Ignore:
Timestamp:
Sep 10, 2014, 5:47:26 PM (11 years ago)
Author:
timothy_horton@apple.com
Message:

Call setCollectsTimingData only once, and before making any {CF,NS}URLConnections
https://bugs.webkit.org/show_bug.cgi?id=136731
<rdar://problem/18252844>

Reviewed by Simon Fraser.

  • platform/network/cf/ResourceHandleCFNet.cpp:

(WebCore::ResourceHandle::start):
Move setCollectsTimingData to before createCFURLConnection, so the first connection
has timing data associated with it.

  • platform/network/mac/ResourceHandleMac.mm:

(WebCore::ResourceHandle::createNSURLConnection):
Move setCollectsTimingData to before we create our NSURLConnection, so the first connection
has timing data associated with it.
Use setCollectsTimingData instead of the NSURLConnection SPI directly.

(WebCore::ResourceHandle::setCollectsTimingData):
Only call _setCollectsTimingData once.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r173499 r173501  
     12014-09-10  Tim Horton  <timothy_horton@apple.com>
     2
     3        Call setCollectsTimingData only once, and before making any {CF,NS}URLConnections
     4        https://bugs.webkit.org/show_bug.cgi?id=136731
     5        <rdar://problem/18252844>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * platform/network/cf/ResourceHandleCFNet.cpp:
     10        (WebCore::ResourceHandle::start):
     11        Move setCollectsTimingData to before createCFURLConnection, so the first connection
     12        has timing data associated with it.
     13
     14        * platform/network/mac/ResourceHandleMac.mm:
     15        (WebCore::ResourceHandle::createNSURLConnection):
     16        Move setCollectsTimingData to before we create our NSURLConnection, so the first connection
     17        has timing data associated with it.
     18        Use setCollectsTimingData instead of the NSURLConnection SPI directly.
     19
     20        (WebCore::ResourceHandle::setCollectsTimingData):
     21        Only call _setCollectsTimingData once.
     22
    1232014-09-10  Enrica Casucci  <enrica@apple.com>
    224
  • trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp

    r171858 r173501  
    250250    bool shouldUseCredentialStorage = !client() || client()->shouldUseCredentialStorage(this);
    251251
     252#if ENABLE(WEB_TIMING)
     253    setCollectsTimingData();
     254#endif
     255
    252256    createCFURLConnection(shouldUseCredentialStorage, d->m_shouldContentSniff, SchedulingBehavior::Asynchronous, client()->connectionProperties(this).get());
    253257
     
    256260
    257261    LOG(Network, "CFNet - Starting URL %s (handle=%p, conn=%p)", firstRequest().url().string().utf8().data(), this, d->m_connection.get());
    258    
    259 #if ENABLE(WEB_TIMING)
    260     setCollectsTimingData();
    261 #endif
    262262   
    263263    return true;
  • trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm

    r173192 r173501  
    145145#endif
    146146{
     147#if ENABLE(WEB_TIMING)
     148    setCollectsTimingData();
     149#endif
     150
    147151    // Credentials for ftp can only be passed in URL, the connection:didReceiveAuthenticationChallenge: delegate call won't be made.
    148152    if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty()) && !firstRequest().url().protocolIsInHTTPFamily()) {
     
    222226#endif
    223227    d->m_connection = adoptNS([[NSURLConnection alloc] _initWithRequest:nsRequest delegate:delegate usesCache:usesCache maxContentLength:0 startImmediately:NO connectionProperties:propertyDictionary]);
    224 #if ENABLE(WEB_TIMING)
    225     [NSURLConnection _setCollectsTimingData:YES];
    226 #endif
    227228}
    228229
     
    759760void ResourceHandle::setCollectsTimingData()
    760761{
    761     [NSURLConnection _setCollectsTimingData:YES];
     762    static dispatch_once_t onceToken;
     763    dispatch_once(&onceToken, ^{
     764        [NSURLConnection _setCollectsTimingData:YES];
     765    });
    762766}
    763767   
Note: See TracChangeset for help on using the changeset viewer.