Changeset 241641 in webkit


Ignore:
Timestamp:
Feb 15, 2019 8:57:09 PM (5 years ago)
Author:
youenn@apple.com
Message:

NetworkDataTask should check its client before calling shouldCaptureExtraNetworkLoadMetrics
https://bugs.webkit.org/show_bug.cgi?id=194732

Reviewed by Geoffrey Garen.

NetworkDataTask may be kept alive if refing it after its NetworkLoad is gone.
This might happen for instance in DownloadManager or when checking for TLS certificates.
In that case, if the NetworkLoad gets destroyed, it clears the client of the NetworkDataTask.
To ensure that NetworkDataTask does not try to use its client, add a null check.

  • NetworkProcess/NetworkDataTask.cpp:

(WebKit::NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics const):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r241635 r241641  
     12019-02-15  Youenn Fablet  <youenn@apple.com>
     2
     3        NetworkDataTask should check its client before calling shouldCaptureExtraNetworkLoadMetrics
     4        https://bugs.webkit.org/show_bug.cgi?id=194732
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        NetworkDataTask may be kept alive if refing it after its NetworkLoad is gone.
     9        This might happen for instance in DownloadManager or when checking for TLS certificates.
     10        In that case, if the NetworkLoad gets destroyed, it clears the client of the NetworkDataTask.
     11        To ensure that NetworkDataTask does not try to use its client, add a null check.
     12
     13        * NetworkProcess/NetworkDataTask.cpp:
     14        (WebKit::NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics const):
     15
    1162019-02-15  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/Source/WebKit/NetworkProcess/NetworkDataTask.cpp

    r241008 r241641  
    115115bool NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics() const
    116116{
    117     return m_client->shouldCaptureExtraNetworkLoadMetrics();
     117    return m_client ? m_client->shouldCaptureExtraNetworkLoadMetrics() : false;
    118118}
    119119
Note: See TracChangeset for help on using the changeset viewer.