Use unique_ptr for NetworkDataTasks and references for NetworkSessionTaskClients
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jan 2016 02:25:53 +0000 (02:25 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Jan 2016 02:25:53 +0000 (02:25 +0000)
commit1d426a08b370fe88ccd591aa07d7687e72ff8fd0
tree7ca52c756cd2fa9e07542a8e6b117d7cf9c082e4
parent3592b48f3cbad9e81d09b308577f337c88487c6d
Use unique_ptr for NetworkDataTasks and references for NetworkSessionTaskClients
https://bugs.webkit.org/show_bug.cgi?id=152724

Reviewed by Andy Estes.

There is no reason to have a NetworkSessionTaskClient* instead of a
NetworkSessionTaskClient& just so we can clear it in the NetworkLoad destructor,
which immediately calls ~NetworkDataTask.
Also, NetworkDataTasks are owned only by the NetworkLoad, so there's no reason to refcount them.

* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::~NetworkLoad):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSessionTaskClient::~NetworkSessionTaskClient):
(WebKit::NetworkDataTask::client):
(WebKit::NetworkDataTask::downloadID):
(WebKit::NetworkDataTask::setDownloadID):
(WebKit::NetworkDataTask::clearClient): Deleted.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
(-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
(WebKit::NetworkSession::~NetworkSession):
(WebKit::NetworkSession::createDataTaskWithRequest):
(WebKit::NetworkSession::dataTaskForIdentifier):
(WebKit::NetworkDataTask::NetworkDataTask):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/Downloads/Download.h
Source/WebKit2/NetworkProcess/Downloads/DownloadManager.h
Source/WebKit2/NetworkProcess/NetworkLoad.cpp
Source/WebKit2/NetworkProcess/NetworkLoad.h
Source/WebKit2/NetworkProcess/NetworkSession.h
Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm