Changeset 163905 in webkit


Ignore:
Timestamp:
Feb 11, 2014 1:28:55 PM (10 years ago)
Author:
aestes@apple.com
Message:

[Mac] connection:willStopBufferingData: no longer exists in NSURLConnectionDelegate
https://bugs.webkit.org/show_bug.cgi?id=128583

Reviewed by Anders Carlsson.

The delegate method was removed in Snow Leopard.

Source/WebCore:

  • loader/ResourceLoader.cpp:
  • loader/ResourceLoader.h:
  • platform/network/ResourceHandleClient.h:
  • platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
  • platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:

Source/WebKit/mac:

  • Misc/WebDownload.mm:

Source/WebKit2:

  • NetworkProcess/NetworkResourceLoader.cpp:
  • NetworkProcess/NetworkResourceLoader.h:
Location:
trunk/Source
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r163904 r163905  
    112014-02-11  Andy Estes  <aestes@apple.com>
     2
     3        [Mac] connection:willStopBufferingData: no longer exists in NSURLConnectionDelegate
     4        https://bugs.webkit.org/show_bug.cgi?id=128583
     5
     6        Reviewed by Anders Carlsson.
     7
     8        The delegate method was removed in Snow Leopard.
     9
     10        * loader/ResourceLoader.cpp:
     11        * loader/ResourceLoader.h:
     12        * platform/network/ResourceHandleClient.h:
     13        * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
     14        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
     15
     162014-02-10  Andy Estes  <aestes@apple.com>
    217
    318        [Content Filter] Check for NULL before calling dispatch_release()
  • trunk/Source/WebCore/loader/ResourceLoader.cpp

    r163725 r163905  
    343343}
    344344
    345 void ResourceLoader::willStopBufferingData(const char* data, unsigned length)
    346 {
    347     if (m_options.dataBufferingPolicy == DoNotBufferData)
    348         return;
    349 
    350     ASSERT(!m_resourceData);
    351     m_resourceData = ResourceBuffer::create(data, length);
    352 }
    353 
    354345void ResourceLoader::didFinishLoading(double finishTime)
    355346{
  • trunk/Source/WebCore/loader/ResourceLoader.h

    r163725 r163905  
    9595    virtual void didReceiveData(const char*, unsigned, long long encodedDataLength, DataPayloadType);
    9696    virtual void didReceiveBuffer(PassRefPtr<SharedBuffer>, long long encodedDataLength, DataPayloadType);
    97     void willStopBufferingData(const char*, unsigned);
    9897    virtual void didFinishLoading(double finishTime);
    9998    virtual void didFail(const ResourceError&);
     
    121120    virtual void wasBlocked(ResourceHandle*) override;
    122121    virtual void cannotShowURL(ResourceHandle*) override;
    123 #if PLATFORM(COCOA) && !USE(CFNETWORK)
    124     virtual void willStopBufferingData(ResourceHandle*, const char* data, unsigned length) override { willStopBufferingData(data, length); }
    125 #endif
    126122    virtual bool shouldUseCredentialStorage(ResourceHandle*) override { return shouldUseCredentialStorage(); }
    127123    virtual void didReceiveAuthenticationChallenge(ResourceHandle*, const AuthenticationChallenge& challenge) override { didReceiveAuthenticationChallenge(challenge); }
  • trunk/Source/WebCore/platform/network/ResourceHandleClient.h

    r163657 r163905  
    123123#elif PLATFORM(COCOA)
    124124        virtual NSCachedURLResponse *willCacheResponse(ResourceHandle*, NSCachedURLResponse *response) { return response; }
    125         virtual void willStopBufferingData(ResourceHandle*, const char*, unsigned) { }
    126125#endif
    127126
  • trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm

    r161589 r163905  
    225225}
    226226
    227 - (void)connection:(NSURLConnection *)connection willStopBufferingData:(NSData *)data
    228 {
    229     UNUSED_PARAM(connection);
    230 
    231     LOG(Network, "Handle %p delegate connection:%p willStopBufferingData:%p", m_handle, connection, data);
    232 
    233     if (!m_handle || !m_handle->client())
    234         return;
    235     // FIXME: If we get a resource with more than 2B bytes, this code won't do the right thing.
    236     // However, with today's computers and networking speeds, this won't happen in practice.
    237     // Could be an issue with a giant local file.
    238     m_handle->client()->willStopBufferingData(m_handle, (const char*)[data bytes], static_cast<unsigned>([data length]));
    239 }
    240 
    241227- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite
    242228{
  • trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm

    r161338 r163905  
    291291}
    292292
    293 - (void)connection:(NSURLConnection *)connection willStopBufferingData:(NSData *)data
    294 {
    295     ASSERT(!isMainThread());
    296     UNUSED_PARAM(connection);
    297 
    298     LOG(Network, "Handle %p delegate connection:%p willStopBufferingData:%p", m_handle, connection, data);
    299 
    300     dispatch_async(dispatch_get_main_queue(), ^{
    301         if (!m_handle || !m_handle->client())
    302             return;
    303         // FIXME: If we get a resource with more than 2B bytes, this code won't do the right thing.
    304         // However, with today's computers and networking speeds, this won't happen in practice.
    305         // Could be an issue with a giant local file.
    306         m_handle->client()->willStopBufferingData(m_handle, (const char*)[data bytes], static_cast<unsigned>([data length]));
    307     });
    308 }
    309 
    310293- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite
    311294{
  • trunk/Source/WebKit/mac/ChangeLog

    r163883 r163905  
     12014-02-11  Andy Estes  <aestes@apple.com>
     2
     3        [Mac] connection:willStopBufferingData: no longer exists in NSURLConnectionDelegate
     4        https://bugs.webkit.org/show_bug.cgi?id=128583
     5
     6        Reviewed by Anders Carlsson.
     7
     8        The delegate method was removed in Snow Leopard.
     9
     10        * Misc/WebDownload.mm:
     11
    1122014-02-11  Alexey Proskuryakov  <ap@apple.com>
    213
  • trunk/Source/WebKit/mac/Misc/WebDownload.mm

    r161185 r163905  
    263263}
    264264
    265 - (void)connection:(NSURLConnection *)connection willStopBufferingData:(NSData *)data
    266 {
    267     // NSURLConnection calls this method even if it is not implemented.
    268     // This happens because NSURLConnection caches the results of respondsToSelector.
    269     // Those results become invalid when the delegate of NSURLConnectionDelegateProxy is changed.
    270     // This is a workaround since this problem needs to be fixed in NSURLConnectionDelegateProxy.
    271     // <rdar://problem/3913270> NSURLConnection calls unimplemented delegate method in WebDownload
    272 }
    273 
    274 @end
     265@end
  • trunk/Source/WebKit2/ChangeLog

    r163892 r163905  
     12014-02-11  Andy Estes  <aestes@apple.com>
     2
     3        [Mac] connection:willStopBufferingData: no longer exists in NSURLConnectionDelegate
     4        https://bugs.webkit.org/show_bug.cgi?id=128583
     5
     6        Reviewed by Anders Carlsson.
     7
     8        The delegate method was removed in Snow Leopard.
     9
     10        * NetworkProcess/NetworkResourceLoader.cpp:
     11        * NetworkProcess/NetworkResourceLoader.h:
     12
    1132014-02-11  Brady Eidson  <beidson@apple.com>
    214
  • trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp

    r162568 r163905  
    406406#endif
    407407
    408 #if PLATFORM(MAC) && !PLATFORM(IOS)
    409 void NetworkResourceLoader::willStopBufferingData(ResourceHandle*, const char*, unsigned)
    410 {
    411     notImplemented();
    412 }
    413 #endif // PLATFORM(MAC)
    414 
    415408} // namespace WebKit
    416409
  • trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h

    r162568 r163905  
    109109#if !PLATFORM(IOS)
    110110    virtual void willCacheResponseAsync(WebCore::ResourceHandle*, NSCachedURLResponse *) override;
    111     virtual void willStopBufferingData(WebCore::ResourceHandle*, const char*, unsigned) override;
    112111#endif
    113112#endif // PLATFORM(MAC)
Note: See TracChangeset for help on using the changeset viewer.