Clean up NETWORK_SESSION code after r191848
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 09:16:53 +0000 (09:16 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Nov 2015 09:16:53 +0000 (09:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=150829

Patch by Alex Christensen <achristensen@webkit.org> on 2015-11-03
Reviewed by Darin Adler.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveData):
(WebKit::NetworkResourceLoader::didCompleteWithError):
* NetworkProcess/NetworkSession.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSession::NetworkSession):
(WebKit::NetworkSession::createDataTaskWithRequest):
(WebKit::NetworkSession::dataTaskForIdentifier):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191942 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp
Source/WebKit2/NetworkProcess/NetworkSession.h
Source/WebKit2/NetworkProcess/cocoa/NetworkSessionCocoa.mm

index 20e0a27..fd36033 100644 (file)
@@ -1,3 +1,19 @@
+2015-11-03  Alex Christensen  <achristensen@webkit.org>
+
+        Clean up NETWORK_SESSION code after r191848
+        https://bugs.webkit.org/show_bug.cgi?id=150829
+
+        Reviewed by Darin Adler.
+
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::didReceiveData):
+        (WebKit::NetworkResourceLoader::didCompleteWithError):
+        * NetworkProcess/NetworkSession.h:
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::NetworkSession::NetworkSession):
+        (WebKit::NetworkSession::createDataTaskWithRequest):
+        (WebKit::NetworkSession::dataTaskForIdentifier):
+
 2015-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         Unreviewed. Fix GTK+ build after r191924.
index 2c50973..776d7cc 100644 (file)
@@ -470,7 +470,8 @@ void NetworkResourceLoader::didReceiveResponse(const WebCore::ResourceResponse&
 void NetworkResourceLoader::didReceiveData(RefPtr<WebCore::SharedBuffer>&& buffer)
 {
     ASSERT(buffer);
-    sharedDidReceiveBuffer(WTF::move(buffer), buffer->size());
+    auto size = buffer->size();
+    sharedDidReceiveBuffer(WTF::move(buffer), size);
 }
 
 void NetworkResourceLoader::didCompleteWithError(const WebCore::ResourceError& error)
index 4483e5b..742a616 100644 (file)
@@ -103,7 +103,7 @@ public:
         Ephemeral
     };
 
-    RefPtr<NetworkingDataTask> createDataTaskWithRequest(const WebCore::ResourceRequest&, NetworkSessionTaskClient&);
+    Ref<NetworkingDataTask> createDataTaskWithRequest(const WebCore::ResourceRequest&, NetworkSessionTaskClient&);
 
     static Ref<NetworkSession> singleton(); // FIXME: This shouldn't actually be a singleton.
     NetworkingDataTask* dataTaskForIdentifier(uint64_t);
index b611371..7ab14a2 100644 (file)
@@ -186,10 +186,9 @@ NetworkSession::NetworkSession(Type type)
     m_session = [NSURLSession sessionWithConfiguration:configuration delegate:static_cast<id>(m_sessionDelegate.get()) delegateQueue:[NSOperationQueue mainQueue]];
 }
 
-RefPtr<NetworkingDataTask> NetworkSession::createDataTaskWithRequest(const WebCore::ResourceRequest& request, NetworkSessionTaskClient& client)
+Ref<NetworkingDataTask> NetworkSession::createDataTaskWithRequest(const WebCore::ResourceRequest& request, NetworkSessionTaskClient& client)
 {
-    RefPtr<NetworkingDataTask> task = adoptRef(new NetworkingDataTask(*this, client, [m_session dataTaskWithRequest:request.nsURLRequest(WebCore::UpdateHTTPBody)]));
-    return task;
+    return adoptRef(*new NetworkingDataTask(*this, client, [m_session dataTaskWithRequest:request.nsURLRequest(WebCore::UpdateHTTPBody)]));
 }
 
 NetworkingDataTask* NetworkSession::dataTaskForIdentifier(uint64_t taskIdentifier)