⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 195393 in webkit


Ignore:
Timestamp:
Jan 20, 2016, 5:49:12 PM (11 years ago)
Author:
ddkilzer@apple.com
Message:

ResourceHandleCFURLConnectionDelegateWithOperationQueue delegate methods don't NULL-check m_handle->client()
<https://webkit.org/b/152675>
<rdar://problem/24034044>

Reviewed by Brent Fulgham.

  • platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:

(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray):

  • Add NULL check for m_handle->client() as is done in the WebCoreResourceHandleAsOperationQueueDelegate class in WebCoreResourceHandleAsOperationQueueDelegate.mm. (The NULL check for -connection:didReceiveResponse: is currently missing, but there are crashes there, too, that are covered by Bug 152673.)
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r195392 r195393  
     12016-01-20  David Kilzer  <ddkilzer@apple.com>
     2
     3        ResourceHandleCFURLConnectionDelegateWithOperationQueue delegate methods don't NULL-check m_handle->client()
     4        <https://webkit.org/b/152675>
     5        <rdar://problem/24034044>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
     10        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
     11        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
     12        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
     13        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
     14        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
     15        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
     16        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveDataArray):
     17        - Add NULL check for m_handle->client() as is done in the
     18          WebCoreResourceHandleAsOperationQueueDelegate class in
     19          WebCoreResourceHandleAsOperationQueueDelegate.mm.  (The NULL
     20          check for -connection:didReceiveResponse: is currently
     21          missing, but there are crashes there, too, that are covered by
     22          Bug 152673.)
     23
    1242016-01-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
    225
  • trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp

    r194380 r195393  
    134134
    135135    dispatch_async(dispatch_get_main_queue(), ^{
    136         if (!protector->hasHandle()) {
     136        if (!protector->hasHandle() || !m_handle->client()) {
    137137            continueDidReceiveResponse();
    138138            return;
     
    173173
    174174    dispatch_async(dispatch_get_main_queue(), ^{
    175         if (protector->hasHandle()) {
     175        if (protector->hasHandle() && m_handle->client()) {
    176176            LOG(Network, "CFNet - ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData(handle=%p) (%s)", m_handle, m_handle->firstRequest().url().string().utf8().data());
    177177
     
    189189    RefPtr<ResourceHandleCFURLConnectionDelegateWithOperationQueue> protector(this);
    190190    dispatch_async(dispatch_get_main_queue(), ^{
    191         if (!protector->hasHandle())
     191        if (!protector->hasHandle() || !m_handle->client())
    192192            return;
    193193
     
    205205    CFRetain(error);
    206206    dispatch_async(dispatch_get_main_queue(), ^{
    207         if (protector->hasHandle()) {
     207        if (protector->hasHandle() && m_handle->client()) {
    208208            LOG(Network, "CFNet - ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail(handle=%p) (%s)", m_handle, m_handle->firstRequest().url().string().utf8().data());
    209209
     
    222222
    223223    dispatch_async(dispatch_get_main_queue(), ^{
    224         if (!protector->hasHandle()) {
     224        if (!protector->hasHandle() || !m_handle->client()) {
    225225            continueWillCacheResponse(nullptr);
    226226            return;
     
    258258    RefPtr<ResourceHandleCFURLConnectionDelegateWithOperationQueue> protector(this);
    259259    dispatch_async(dispatch_get_main_queue(), ^{
    260         if (!protector->hasHandle())
     260        if (!protector->hasHandle() || !m_handle->client())
    261261            return;
    262262
     
    310310    CFRetain(dataArray);
    311311    dispatch_async(dispatch_get_main_queue(), ^{
    312         if (protector->hasHandle()) {
     312        if (protector->hasHandle() && m_handle->client()) {
    313313            LOG(Network, "CFNet - ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData(handle=%p) (%s)", m_handle, m_handle->firstRequest().url().string().utf8().data());
    314314
Note: See TracChangeset for help on using the changeset viewer.