Title: [201880] trunk/Source
Revision
201880
Author
[email protected]
Date
2016-06-09 13:10:30 -0700 (Thu, 09 Jun 2016)

Log Message

Clean up WebSocket code
https://bugs.webkit.org/show_bug.cgi?id=158551

Reviewed by Darin Adler.

Source/WebCore:

No new tests.  There is no change in behavior.
There seems to be no reason why SocketStreamHandle should be an AuthenticationClient.

* Modules/websockets/ThreadableWebSocketChannel.h:
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
(WebCore::ThreadableWebSocketChannelClientWrapper::setSendRequestResult):
(WebCore::ThreadableWebSocketChannelClientWrapper::bufferedAmount):
(WebCore::ThreadableWebSocketChannelClientWrapper::setBufferedAmount):
(WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
(WebCore::ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmount):
(WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshake):
(WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::joinStrings):
(WebCore::saturateAdd):
(WebCore::WebSocket::send):
(WebCore::WebSocket::readyState):
(WebCore::WebSocket::bufferedAmount):
(WebCore::WebSocket::didReceiveBinaryData):
(WebCore::WebSocket::didReceiveMessageError):
(WebCore::WebSocket::didUpdateBufferedAmount):
(WebCore::WebSocket::didStartClosingHandshake):
(WebCore::WebSocket::didClose):
* Modules/websockets/WebSocket.h:
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::WebSocketChannel):
(WebCore::WebSocketChannel::~WebSocketChannel):
(WebCore::WebSocketChannel::send):
(WebCore::WebSocketChannel::bufferedAmount):
(WebCore::WebSocketChannel::resume):
(WebCore::WebSocketChannel::willOpenSocketStream):
(WebCore::WebSocketChannel::didOpenSocketStream):
(WebCore::WebSocketChannel::didCloseSocketStream):
(WebCore::WebSocketChannel::didReceiveSocketStreamData):
(WebCore::WebSocketChannel::didUpdateBufferedAmount):
(WebCore::WebSocketChannel::didFailSocketStream):
(WebCore::WebSocketChannel::didStartLoading):
(WebCore::WebSocketChannel::appendToBuffer):
(WebCore::WebSocketChannel::processBuffer):
(WebCore::WebSocketChannel::resumeTimerFired):
(WebCore::WebSocketChannel::startClosingHandshake):
(WebCore::WebSocketChannel::didReceiveAuthenticationChallenge): Deleted.
(WebCore::WebSocketChannel::didCancelAuthenticationChallenge): Deleted.
* Modules/websockets/WebSocketChannel.h:
* Modules/websockets/WebSocketChannelClient.h:
(WebCore::WebSocketChannelClient::~WebSocketChannelClient):
(WebCore::WebSocketChannelClient::didConnect):
(WebCore::WebSocketChannelClient::didReceiveMessage):
(WebCore::WebSocketChannelClient::didReceiveBinaryData):
(WebCore::WebSocketChannelClient::didReceiveMessageError):
(WebCore::WebSocketChannelClient::didUpdateBufferedAmount):
(WebCore::WebSocketChannelClient::didStartClosingHandshake):
(WebCore::WebSocketChannelClient::didClose):
(WebCore::WebSocketChannelClient::WebSocketChannelClient):
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::send):
(WebCore::WorkerThreadableWebSocketChannel::bufferedAmount):
(WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake):
(WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
(WebCore::WorkerThreadableWebSocketChannel::Bridge::bufferedAmount):
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
* platform/network/BlobData.cpp:
(WebCore::BlobData::appendData):
(WebCore::BlobData::appendFile):
* platform/network/BlobData.h:
(WebCore::BlobDataItem::BlobDataItem):
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::appendStorageItems):
(WebCore::BlobRegistryImpl::registerFileBlobURL):
(WebCore::BlobRegistryImpl::registerBlobURL):
(WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked):
(WebCore::BlobRegistryImpl::registerBlobURLForSlice):
* platform/network/BlobRegistryImpl.h:
* platform/network/SocketStreamHandleBase.cpp:
(WebCore::SocketStreamHandleBase::send):
(WebCore::SocketStreamHandleBase::disconnect):
(WebCore::SocketStreamHandleBase::sendPendingData):
* platform/network/SocketStreamHandleBase.h:
* platform/network/SocketStreamHandleClient.h:
(WebCore::SocketStreamHandleClient::~SocketStreamHandleClient):
(WebCore::SocketStreamHandleClient::willOpenSocketStream):
(WebCore::SocketStreamHandleClient::didOpenSocketStream):
(WebCore::SocketStreamHandleClient::didCloseSocketStream):
(WebCore::SocketStreamHandleClient::didReceiveSocketStreamData):
(WebCore::SocketStreamHandleClient::didUpdateBufferedAmount):
(WebCore::SocketStreamHandleClient::didFailSocketStream):
(WebCore::SocketStreamHandleClient::didReceiveAuthenticationChallenge): Deleted.
(WebCore::SocketStreamHandleClient::didCancelAuthenticationChallenge): Deleted.
* platform/network/cf/SocketStreamHandle.h:
(WebCore::SocketStreamHandle::create):
(WebCore::SocketStreamHandle::refAuthenticationClient): Deleted.
(WebCore::SocketStreamHandle::derefAuthenticationClient): Deleted.
* platform/network/cf/SocketStreamHandleCFNet.cpp:
(WebCore::SocketStreamHandle::SocketStreamHandle):
(WebCore::SocketStreamHandle::addCONNECTCredentials):
(WebCore::SocketStreamHandle::copyCFStreamDescription):
(WebCore::SocketStreamHandle::readStreamCallback):
(WebCore::SocketStreamHandle::writeStreamCallback):
(WebCore::SocketStreamHandle::reportErrorToClient):
(WebCore::SocketStreamHandle::~SocketStreamHandle):
(WebCore::SocketStreamHandle::platformClose):
(WebCore::SocketStreamHandle::port):
(WebCore::SocketStreamHandle::receivedCredential): Deleted.
(WebCore::SocketStreamHandle::receivedRequestToContinueWithoutCredential): Deleted.
(WebCore::SocketStreamHandle::receivedCancellation): Deleted.
(WebCore::SocketStreamHandle::receivedRequestToPerformDefaultHandling): Deleted.
(WebCore::SocketStreamHandle::receivedChallengeRejection): Deleted.
* platform/network/curl/ResourceHandleCurl.cpp:
* platform/network/curl/SocketStreamHandle.h:
(WebCore::SocketStreamHandle::SocketData::SocketData):
* platform/network/curl/SocketStreamHandleCurl.cpp:
(WebCore::SocketStreamHandle::platformClose):
(WebCore::SocketStreamHandle::readData):
(WebCore::SocketStreamHandle::didReceiveData):
(WebCore::SocketStreamHandle::didOpenSocket):
(WebCore::SocketStreamHandle::createCopy):
(WebCore::SocketStreamHandle::didReceiveAuthenticationChallenge): Deleted.
(WebCore::SocketStreamHandle::receivedCredential): Deleted.
(WebCore::SocketStreamHandle::receivedRequestToContinueWithoutCredential): Deleted.
(WebCore::SocketStreamHandle::receivedCancellation): Deleted.
(WebCore::SocketStreamHandle::receivedRequestToPerformDefaultHandling): Deleted.
(WebCore::SocketStreamHandle::receivedChallengeRejection): Deleted.
* platform/network/soup/SocketStreamHandle.h:
(WebCore::SocketStreamHandle::create):
* platform/network/soup/SocketStreamHandleSoup.cpp:
(WebCore::getHandleFromId):
(WebCore::deactivateHandle):
(WebCore::activateHandle):
(WebCore::SocketStreamHandle::SocketStreamHandle):
(WebCore::SocketStreamHandle::~SocketStreamHandle):
(WebCore::SocketStreamHandle::connected):
(WebCore::SocketStreamHandle::readBytes):
(WebCore::SocketStreamHandle::platformSend):
(WebCore::SocketStreamHandle::platformClose):
(WebCore::SocketStreamHandle::beginWaitingForSocketWritability):
(WebCore::SocketStreamHandle::didReceiveAuthenticationChallenge): Deleted.
(WebCore::SocketStreamHandle::receivedCredential): Deleted.
(WebCore::SocketStreamHandle::receivedRequestToContinueWithoutCredential): Deleted.
(WebCore::SocketStreamHandle::receivedCancellation): Deleted.
(WebCore::SocketStreamHandle::receivedRequestToPerformDefaultHandling): Deleted.
(WebCore::SocketStreamHandle::receivedChallengeRejection): Deleted.

Source/WebKit2:

* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerFileBlobURL):
* WebProcess/FileAPI/BlobRegistryProxy.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (201879 => 201880)


--- trunk/Source/WebCore/ChangeLog	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/ChangeLog	2016-06-09 20:10:30 UTC (rev 201880)
@@ -1,3 +1,158 @@
+2016-06-09  Alex Christensen  <[email protected]>
+
+        Clean up WebSocket code
+        https://bugs.webkit.org/show_bug.cgi?id=158551
+
+        Reviewed by Darin Adler.
+
+        No new tests.  There is no change in behavior.
+        There seems to be no reason why SocketStreamHandle should be an AuthenticationClient.
+
+        * Modules/websockets/ThreadableWebSocketChannel.h:
+        * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
+        (WebCore::ThreadableWebSocketChannelClientWrapper::setSendRequestResult):
+        (WebCore::ThreadableWebSocketChannelClientWrapper::bufferedAmount):
+        (WebCore::ThreadableWebSocketChannelClientWrapper::setBufferedAmount):
+        (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
+        (WebCore::ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmount):
+        (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshake):
+        (WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
+        * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
+        * Modules/websockets/WebSocket.cpp:
+        (WebCore::joinStrings):
+        (WebCore::saturateAdd):
+        (WebCore::WebSocket::send):
+        (WebCore::WebSocket::readyState):
+        (WebCore::WebSocket::bufferedAmount):
+        (WebCore::WebSocket::didReceiveBinaryData):
+        (WebCore::WebSocket::didReceiveMessageError):
+        (WebCore::WebSocket::didUpdateBufferedAmount):
+        (WebCore::WebSocket::didStartClosingHandshake):
+        (WebCore::WebSocket::didClose):
+        * Modules/websockets/WebSocket.h:
+        * Modules/websockets/WebSocketChannel.cpp:
+        (WebCore::WebSocketChannel::WebSocketChannel):
+        (WebCore::WebSocketChannel::~WebSocketChannel):
+        (WebCore::WebSocketChannel::send):
+        (WebCore::WebSocketChannel::bufferedAmount):
+        (WebCore::WebSocketChannel::resume):
+        (WebCore::WebSocketChannel::willOpenSocketStream):
+        (WebCore::WebSocketChannel::didOpenSocketStream):
+        (WebCore::WebSocketChannel::didCloseSocketStream):
+        (WebCore::WebSocketChannel::didReceiveSocketStreamData):
+        (WebCore::WebSocketChannel::didUpdateBufferedAmount):
+        (WebCore::WebSocketChannel::didFailSocketStream):
+        (WebCore::WebSocketChannel::didStartLoading):
+        (WebCore::WebSocketChannel::appendToBuffer):
+        (WebCore::WebSocketChannel::processBuffer):
+        (WebCore::WebSocketChannel::resumeTimerFired):
+        (WebCore::WebSocketChannel::startClosingHandshake):
+        (WebCore::WebSocketChannel::didReceiveAuthenticationChallenge): Deleted.
+        (WebCore::WebSocketChannel::didCancelAuthenticationChallenge): Deleted.
+        * Modules/websockets/WebSocketChannel.h:
+        * Modules/websockets/WebSocketChannelClient.h:
+        (WebCore::WebSocketChannelClient::~WebSocketChannelClient):
+        (WebCore::WebSocketChannelClient::didConnect):
+        (WebCore::WebSocketChannelClient::didReceiveMessage):
+        (WebCore::WebSocketChannelClient::didReceiveBinaryData):
+        (WebCore::WebSocketChannelClient::didReceiveMessageError):
+        (WebCore::WebSocketChannelClient::didUpdateBufferedAmount):
+        (WebCore::WebSocketChannelClient::didStartClosingHandshake):
+        (WebCore::WebSocketChannelClient::didClose):
+        (WebCore::WebSocketChannelClient::WebSocketChannelClient):
+        * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
+        (WebCore::WorkerThreadableWebSocketChannel::send):
+        (WebCore::WorkerThreadableWebSocketChannel::bufferedAmount):
+        (WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount):
+        (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
+        (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount):
+        (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake):
+        (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
+        (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
+        (WebCore::WorkerThreadableWebSocketChannel::Bridge::bufferedAmount):
+        * Modules/websockets/WorkerThreadableWebSocketChannel.h:
+        * platform/network/BlobData.cpp:
+        (WebCore::BlobData::appendData):
+        (WebCore::BlobData::appendFile):
+        * platform/network/BlobData.h:
+        (WebCore::BlobDataItem::BlobDataItem):
+        * platform/network/BlobRegistry.h:
+        * platform/network/BlobRegistryImpl.cpp:
+        (WebCore::BlobRegistryImpl::appendStorageItems):
+        (WebCore::BlobRegistryImpl::registerFileBlobURL):
+        (WebCore::BlobRegistryImpl::registerBlobURL):
+        (WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked):
+        (WebCore::BlobRegistryImpl::registerBlobURLForSlice):
+        * platform/network/BlobRegistryImpl.h:
+        * platform/network/SocketStreamHandleBase.cpp:
+        (WebCore::SocketStreamHandleBase::send):
+        (WebCore::SocketStreamHandleBase::disconnect):
+        (WebCore::SocketStreamHandleBase::sendPendingData):
+        * platform/network/SocketStreamHandleBase.h:
+        * platform/network/SocketStreamHandleClient.h:
+        (WebCore::SocketStreamHandleClient::~SocketStreamHandleClient):
+        (WebCore::SocketStreamHandleClient::willOpenSocketStream):
+        (WebCore::SocketStreamHandleClient::didOpenSocketStream):
+        (WebCore::SocketStreamHandleClient::didCloseSocketStream):
+        (WebCore::SocketStreamHandleClient::didReceiveSocketStreamData):
+        (WebCore::SocketStreamHandleClient::didUpdateBufferedAmount):
+        (WebCore::SocketStreamHandleClient::didFailSocketStream):
+        (WebCore::SocketStreamHandleClient::didReceiveAuthenticationChallenge): Deleted.
+        (WebCore::SocketStreamHandleClient::didCancelAuthenticationChallenge): Deleted.
+        * platform/network/cf/SocketStreamHandle.h:
+        (WebCore::SocketStreamHandle::create):
+        (WebCore::SocketStreamHandle::refAuthenticationClient): Deleted.
+        (WebCore::SocketStreamHandle::derefAuthenticationClient): Deleted.
+        * platform/network/cf/SocketStreamHandleCFNet.cpp:
+        (WebCore::SocketStreamHandle::SocketStreamHandle):
+        (WebCore::SocketStreamHandle::addCONNECTCredentials):
+        (WebCore::SocketStreamHandle::copyCFStreamDescription):
+        (WebCore::SocketStreamHandle::readStreamCallback):
+        (WebCore::SocketStreamHandle::writeStreamCallback):
+        (WebCore::SocketStreamHandle::reportErrorToClient):
+        (WebCore::SocketStreamHandle::~SocketStreamHandle):
+        (WebCore::SocketStreamHandle::platformClose):
+        (WebCore::SocketStreamHandle::port):
+        (WebCore::SocketStreamHandle::receivedCredential): Deleted.
+        (WebCore::SocketStreamHandle::receivedRequestToContinueWithoutCredential): Deleted.
+        (WebCore::SocketStreamHandle::receivedCancellation): Deleted.
+        (WebCore::SocketStreamHandle::receivedRequestToPerformDefaultHandling): Deleted.
+        (WebCore::SocketStreamHandle::receivedChallengeRejection): Deleted.
+        * platform/network/curl/ResourceHandleCurl.cpp:
+        * platform/network/curl/SocketStreamHandle.h:
+        (WebCore::SocketStreamHandle::SocketData::SocketData):
+        * platform/network/curl/SocketStreamHandleCurl.cpp:
+        (WebCore::SocketStreamHandle::platformClose):
+        (WebCore::SocketStreamHandle::readData):
+        (WebCore::SocketStreamHandle::didReceiveData):
+        (WebCore::SocketStreamHandle::didOpenSocket):
+        (WebCore::SocketStreamHandle::createCopy):
+        (WebCore::SocketStreamHandle::didReceiveAuthenticationChallenge): Deleted.
+        (WebCore::SocketStreamHandle::receivedCredential): Deleted.
+        (WebCore::SocketStreamHandle::receivedRequestToContinueWithoutCredential): Deleted.
+        (WebCore::SocketStreamHandle::receivedCancellation): Deleted.
+        (WebCore::SocketStreamHandle::receivedRequestToPerformDefaultHandling): Deleted.
+        (WebCore::SocketStreamHandle::receivedChallengeRejection): Deleted.
+        * platform/network/soup/SocketStreamHandle.h:
+        (WebCore::SocketStreamHandle::create):
+        * platform/network/soup/SocketStreamHandleSoup.cpp:
+        (WebCore::getHandleFromId):
+        (WebCore::deactivateHandle):
+        (WebCore::activateHandle):
+        (WebCore::SocketStreamHandle::SocketStreamHandle):
+        (WebCore::SocketStreamHandle::~SocketStreamHandle):
+        (WebCore::SocketStreamHandle::connected):
+        (WebCore::SocketStreamHandle::readBytes):
+        (WebCore::SocketStreamHandle::platformSend):
+        (WebCore::SocketStreamHandle::platformClose):
+        (WebCore::SocketStreamHandle::beginWaitingForSocketWritability):
+        (WebCore::SocketStreamHandle::didReceiveAuthenticationChallenge): Deleted.
+        (WebCore::SocketStreamHandle::receivedCredential): Deleted.
+        (WebCore::SocketStreamHandle::receivedRequestToContinueWithoutCredential): Deleted.
+        (WebCore::SocketStreamHandle::receivedCancellation): Deleted.
+        (WebCore::SocketStreamHandle::receivedRequestToPerformDefaultHandling): Deleted.
+        (WebCore::SocketStreamHandle::receivedChallengeRejection): Deleted.
+
 2016-06-09  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r201815.

Modified: trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.h (201879 => 201880)


--- trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.h	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannel.h	2016-06-09 20:10:30 UTC (rev 201880)
@@ -65,7 +65,7 @@
     virtual SendResult send(const String& message) = 0;
     virtual SendResult send(const JSC::ArrayBuffer&, unsigned byteOffset, unsigned byteLength) = 0;
     virtual SendResult send(Blob&) = 0;
-    virtual unsigned long bufferedAmount() const = 0;
+    virtual unsigned bufferedAmount() const = 0;
     virtual void close(int code, const String& reason) = 0;
     // Log the reason text and close the connection. Will call didClose().
     virtual void fail(const String& reason) = 0;

Modified: trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp (201879 => 201880)


--- trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp	2016-06-09 20:10:30 UTC (rev 201880)
@@ -136,12 +136,12 @@
     m_syncMethodDone = true;
 }
 
-unsigned long ThreadableWebSocketChannelClientWrapper::bufferedAmount() const
+unsigned ThreadableWebSocketChannelClientWrapper::bufferedAmount() const
 {
     return m_bufferedAmount;
 }
 
-void ThreadableWebSocketChannelClientWrapper::setBufferedAmount(unsigned long bufferedAmount)
+void ThreadableWebSocketChannelClientWrapper::setBufferedAmount(unsigned bufferedAmount)
 {
     m_bufferedAmount = bufferedAmount;
     m_syncMethodDone = true;
@@ -185,7 +185,7 @@
         processPendingTasks();
 }
 
-void ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmount(unsigned long bufferedAmount)
+void ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmount(unsigned bufferedAmount)
 {
     m_pendingTasks.append(std::make_unique<ScriptExecutionContext::Task>([this, protectedThis = Ref<ThreadableWebSocketChannelClientWrapper>(*this), bufferedAmount] (ScriptExecutionContext&) {
         if (m_client)
@@ -207,7 +207,7 @@
         processPendingTasks();
 }
 
-void ThreadableWebSocketChannelClientWrapper::didClose(unsigned long unhandledBufferedAmount, WebSocketChannelClient::ClosingHandshakeCompletionStatus closingHandshakeCompletion, unsigned short code, const String& reason)
+void ThreadableWebSocketChannelClientWrapper::didClose(unsigned unhandledBufferedAmount, WebSocketChannelClient::ClosingHandshakeCompletionStatus closingHandshakeCompletion, unsigned short code, const String& reason)
 {
     m_pendingTasks.append(std::make_unique<ScriptExecutionContext::Task>([this, protectedThis = Ref<ThreadableWebSocketChannelClientWrapper>(*this), unhandledBufferedAmount, closingHandshakeCompletion, code, reason = reason.isolatedCopy()] (ScriptExecutionContext&) {
             if (m_client)

Modified: trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.h (201879 => 201880)


--- trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.h	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/Modules/websockets/ThreadableWebSocketChannelClientWrapper.h	2016-06-09 20:10:30 UTC (rev 201880)
@@ -71,17 +71,17 @@
     ThreadableWebSocketChannel::SendResult sendRequestResult() const;
     void setSendRequestResult(ThreadableWebSocketChannel::SendResult);
 
-    unsigned long bufferedAmount() const;
-    void setBufferedAmount(unsigned long);
+    unsigned bufferedAmount() const;
+    void setBufferedAmount(unsigned);
 
     void clearClient();
 
     void didConnect();
     void didReceiveMessage(const String& message);
     void didReceiveBinaryData(Vector<uint8_t>&&);
-    void didUpdateBufferedAmount(unsigned long bufferedAmount);
+    void didUpdateBufferedAmount(unsigned bufferedAmount);
     void didStartClosingHandshake();
-    void didClose(unsigned long unhandledBufferedAmount, WebSocketChannelClient::ClosingHandshakeCompletionStatus, unsigned short code, const String& reason);
+    void didClose(unsigned unhandledBufferedAmount, WebSocketChannelClient::ClosingHandshakeCompletionStatus, unsigned short code, const String& reason);
     void didReceiveMessageError();
 
     void suspend();
@@ -101,7 +101,7 @@
     Vector<UChar> m_subprotocol;
     Vector<UChar> m_extensions;
     ThreadableWebSocketChannel::SendResult m_sendRequestResult;
-    unsigned long m_bufferedAmount;
+    unsigned m_bufferedAmount;
     bool m_suspended;
     Vector<std::unique_ptr<ScriptExecutionContext::Task>> m_pendingTasks;
 };

Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.cpp (201879 => 201880)


--- trunk/Source/WebCore/Modules/websockets/WebSocket.cpp	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.cpp	2016-06-09 20:10:30 UTC (rev 201880)
@@ -115,10 +115,10 @@
     return builder.toString();
 }
 
-static unsigned long saturateAdd(unsigned long a, unsigned long b)
+static unsigned saturateAdd(unsigned a, unsigned b)
 {
-    if (std::numeric_limits<unsigned long>::max() - a < b)
-        return std::numeric_limits<unsigned long>::max();
+    if (std::numeric_limits<unsigned>::max() - a < b)
+        return std::numeric_limits<unsigned>::max();
     return a + b;
 }
 
@@ -369,7 +369,7 @@
         return;
     }
     if (m_state == CLOSING || m_state == CLOSED) {
-        unsigned long payloadSize = static_cast<unsigned long>(binaryData.size());
+        unsigned payloadSize = static_cast<unsigned>(binaryData.size());
         m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, payloadSize);
         m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize));
         return;
@@ -419,7 +419,7 @@
     return m_state;
 }
 
-unsigned long WebSocket::bufferedAmount() const
+unsigned WebSocket::bufferedAmount() const
 {
     return saturateAdd(m_bufferedAmount, m_bufferedAmountAfterClose);
 }
@@ -566,7 +566,7 @@
 
 void WebSocket::didReceiveBinaryData(Vector<uint8_t>&& binaryData)
 {
-    LOG(Network, "WebSocket %p didReceiveBinaryData() %lu byte binary message", this, static_cast<unsigned long>(binaryData.size()));
+    LOG(Network, "WebSocket %p didReceiveBinaryData() %u byte binary message", this, static_cast<unsigned>(binaryData.size()));
     switch (m_binaryType) {
     case BinaryTypeBlob:
         // FIXME: We just received the data from NetworkProcess, and are sending it back. This is inefficient.
@@ -586,9 +586,9 @@
     dispatchOrQueueErrorEvent();
 }
 
-void WebSocket::didUpdateBufferedAmount(unsigned long bufferedAmount)
+void WebSocket::didUpdateBufferedAmount(unsigned bufferedAmount)
 {
-    LOG(Network, "WebSocket %p didUpdateBufferedAmount() New bufferedAmount is %lu", this, bufferedAmount);
+    LOG(Network, "WebSocket %p didUpdateBufferedAmount() New bufferedAmount is %u", this, bufferedAmount);
     if (m_state == CLOSED)
         return;
     m_bufferedAmount = bufferedAmount;
@@ -600,7 +600,7 @@
     m_state = CLOSING;
 }
 
-void WebSocket::didClose(unsigned long unhandledBufferedAmount, ClosingHandshakeCompletionStatus closingHandshakeCompletion, unsigned short code, const String& reason)
+void WebSocket::didClose(unsigned unhandledBufferedAmount, ClosingHandshakeCompletionStatus closingHandshakeCompletion, unsigned short code, const String& reason)
 {
     LOG(Network, "WebSocket %p didClose()", this);
     if (!m_channel)

Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.h (201879 => 201880)


--- trunk/Source/WebCore/Modules/websockets/WebSocket.h	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.h	2016-06-09 20:10:30 UTC (rev 201880)
@@ -80,7 +80,7 @@
 
     const URL& url() const;
     State readyState() const;
-    unsigned long bufferedAmount() const;
+    unsigned bufferedAmount() const;
 
     String protocol() const;
     String extensions() const;
@@ -100,9 +100,9 @@
     void didReceiveMessage(const String& message) override;
     void didReceiveBinaryData(Vector<uint8_t>&&) override;
     void didReceiveMessageError() override;
-    void didUpdateBufferedAmount(unsigned long bufferedAmount) override;
+    void didUpdateBufferedAmount(unsigned bufferedAmount) override;
     void didStartClosingHandshake() override;
-    void didClose(unsigned long unhandledBufferedAmount, ClosingHandshakeCompletionStatus, unsigned short code, const String& reason) override;
+    void didClose(unsigned unhandledBufferedAmount, ClosingHandshakeCompletionStatus, unsigned short code, const String& reason) override;
 
 private:
     explicit WebSocket(ScriptExecutionContext&);
@@ -133,8 +133,8 @@
 
     State m_state;
     URL m_url;
-    unsigned long m_bufferedAmount;
-    unsigned long m_bufferedAmountAfterClose;
+    unsigned m_bufferedAmount;
+    unsigned m_bufferedAmountAfterClose;
     BinaryType m_binaryType;
     String m_subprotocol;
     String m_extensions;

Modified: trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp (201879 => 201880)


--- trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp	2016-06-09 20:10:30 UTC (rev 201880)
@@ -68,23 +68,12 @@
     : m_document(&document)
     , m_client(&client)
     , m_resumeTimer(*this, &WebSocketChannel::resumeTimerFired)
-    , m_suspended(false)
-    , m_closing(false)
-    , m_receivedClosingHandshake(false)
     , m_closingTimer(*this, &WebSocketChannel::closingTimerFired)
-    , m_closed(false)
-    , m_shouldDiscardReceivedData(false)
-    , m_unhandledBufferedAmount(0)
-    , m_identifier(0)
-    , m_hasContinuousFrame(false)
-    , m_closeEventCode(CloseEventCodeAbnormalClosure)
-    , m_outgoingFrameQueueStatus(OutgoingFrameQueueOpen)
-    , m_blobLoaderStatus(BlobLoaderNotStarted)
 {
     if (Page* page = document.page())
         m_identifier = page->progress().createUniqueIdentifier();
 
-    LOG(Network, "WebSocketChannel %p ctor, identifier %lu", this, m_identifier);
+    LOG(Network, "WebSocketChannel %p ctor, identifier %u", this, m_identifier);
 }
 
 WebSocketChannel::~WebSocketChannel()
@@ -174,7 +163,7 @@
     return true;
 }
 
-unsigned long WebSocketChannel::bufferedAmount() const
+unsigned WebSocketChannel::bufferedAmount() const
 {
     LOG(Network, "WebSocketChannel %p bufferedAmount()", this);
     ASSERT(m_handle);
@@ -253,30 +242,30 @@
         m_resumeTimer.startOneShot(0);
 }
 
-void WebSocketChannel::willOpenSocketStream(SocketStreamHandle*)
+void WebSocketChannel::willOpenSocketStream(SocketStreamHandle&)
 {
     LOG(Network, "WebSocketChannel %p willOpenSocketStream()", this);
 }
 
-void WebSocketChannel::didOpenSocketStream(SocketStreamHandle* handle)
+void WebSocketChannel::didOpenSocketStream(SocketStreamHandle& handle)
 {
     LOG(Network, "WebSocketChannel %p didOpenSocketStream()", this);
-    ASSERT(handle == m_handle);
+    ASSERT(&handle == m_handle);
     if (!m_document)
         return;
     if (m_identifier)
         InspectorInstrumentation::willSendWebSocketHandshakeRequest(m_document, m_identifier, m_handshake->clientHandshakeRequest());
     CString handshakeMessage = m_handshake->clientHandshakeMessage();
-    if (!handle->send(handshakeMessage.data(), handshakeMessage.length()))
+    if (!handle.send(handshakeMessage.data(), handshakeMessage.length()))
         fail("Failed to send WebSocket handshake.");
 }
 
-void WebSocketChannel::didCloseSocketStream(SocketStreamHandle* handle)
+void WebSocketChannel::didCloseSocketStream(SocketStreamHandle& handle)
 {
     LOG(Network, "WebSocketChannel %p didCloseSocketStream()", this);
     if (m_identifier && m_document)
         InspectorInstrumentation::didCloseWebSocket(m_document, m_identifier);
-    ASSERT_UNUSED(handle, handle == m_handle || !m_handle);
+    ASSERT_UNUSED(handle, &handle == m_handle || !m_handle);
     m_closed = true;
     if (m_closingTimer.isActive())
         m_closingTimer.stop();
@@ -296,21 +285,21 @@
     deref();
 }
 
-void WebSocketChannel::didReceiveSocketStreamData(SocketStreamHandle* handle, const char* data, int len)
+void WebSocketChannel::didReceiveSocketStreamData(SocketStreamHandle& handle, const char* data, int len)
 {
     LOG(Network, "WebSocketChannel %p didReceiveSocketStreamData() Received %d bytes", this, len);
     Ref<WebSocketChannel> protectedThis(*this); // The client can close the channel, potentially removing the last reference.
-    ASSERT(handle == m_handle);
+    ASSERT(&handle == m_handle);
     if (!m_document) {
         return;
     }
     if (len <= 0) {
-        handle->disconnect();
+        handle.disconnect();
         return;
     }
     if (!m_client) {
         m_shouldDiscardReceivedData = true;
-        handle->disconnect();
+        handle.disconnect();
         return;
     }
     if (m_shouldDiscardReceivedData)
@@ -325,16 +314,16 @@
             break;
 }
 
-void WebSocketChannel::didUpdateBufferedAmount(SocketStreamHandle*, size_t bufferedAmount)
+void WebSocketChannel::didUpdateBufferedAmount(SocketStreamHandle&, size_t bufferedAmount)
 {
     if (m_client)
         m_client->didUpdateBufferedAmount(bufferedAmount);
 }
 
-void WebSocketChannel::didFailSocketStream(SocketStreamHandle* handle, const SocketStreamError& error)
+void WebSocketChannel::didFailSocketStream(SocketStreamHandle& handle, const SocketStreamError& error)
 {
     LOG(Network, "WebSocketChannel %p didFailSocketStream()", this);
-    ASSERT(handle == m_handle || !m_handle);
+    ASSERT(&handle == m_handle || !m_handle);
     if (m_document) {
         String message;
         if (error.isNull())
@@ -347,17 +336,9 @@
         m_document->addConsoleMessage(MessageSource::Network, MessageLevel::Error, message);
     }
     m_shouldDiscardReceivedData = true;
-    handle->disconnect();
+    handle.disconnect();
 }
 
-void WebSocketChannel::didReceiveAuthenticationChallenge(SocketStreamHandle*, const AuthenticationChallenge&)
-{
-}
-
-void WebSocketChannel::didCancelAuthenticationChallenge(SocketStreamHandle*, const AuthenticationChallenge&)
-{
-}
-
 void WebSocketChannel::didStartLoading()
 {
     LOG(Network, "WebSocketChannel %p didStartLoading()", this);
@@ -397,7 +378,7 @@
 {
     size_t newBufferSize = m_buffer.size() + len;
     if (newBufferSize < m_buffer.size()) {
-        LOG(Network, "WebSocketChannel %p appendToBuffer() Buffer overflow (%lu bytes already in receive buffer and appending %lu bytes)", this, static_cast<unsigned long>(m_buffer.size()), static_cast<unsigned long>(len));
+        LOG(Network, "WebSocketChannel %p appendToBuffer() Buffer overflow (%u bytes already in receive buffer and appending %u bytes)", this, static_cast<unsigned>(m_buffer.size()), static_cast<unsigned>(len));
         return false;
     }
     m_buffer.append(data, len);
@@ -416,7 +397,7 @@
     ASSERT(!m_suspended);
     ASSERT(m_client);
     ASSERT(!m_buffer.isEmpty());
-    LOG(Network, "WebSocketChannel %p processBuffer() Receive buffer has %lu bytes", this, static_cast<unsigned long>(m_buffer.size()));
+    LOG(Network, "WebSocketChannel %p processBuffer() Receive buffer has %u bytes", this, static_cast<unsigned>(m_buffer.size()));
 
     if (m_shouldDiscardReceivedData)
         return false;
@@ -445,7 +426,7 @@
             LOG(Network, "WebSocketChannel %p Connected", this);
             skipBuffer(headerLength);
             m_client->didConnect();
-            LOG(Network, "WebSocketChannel %p %lu bytes remaining in m_buffer", this, static_cast<unsigned long>(m_buffer.size()));
+            LOG(Network, "WebSocketChannel %p %u bytes remaining in m_buffer", this, static_cast<unsigned>(m_buffer.size()));
             return !m_buffer.isEmpty();
         }
         ASSERT(m_handshake->mode() == WebSocketHandshake::Failed);
@@ -468,7 +449,7 @@
         if (!processBuffer())
             break;
     if (!m_suspended && m_client && m_closed && m_handle)
-        didCloseSocketStream(m_handle.get());
+        didCloseSocketStream(*m_handle);
 }
 
 void WebSocketChannel::startClosingHandshake(int code, const String& reason)

Modified: trunk/Source/WebCore/Modules/websockets/WebSocketChannel.h (201879 => 201880)


--- trunk/Source/WebCore/Modules/websockets/WebSocketChannel.h	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketChannel.h	2016-06-09 20:10:30 UTC (rev 201880)
@@ -28,8 +28,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebSocketChannel_h
-#define WebSocketChannel_h
+#pragma once
 
 #if ENABLE(WEB_SOCKETS)
 
@@ -39,7 +38,6 @@
 #include "Timer.h"
 #include "WebSocketDeflateFramer.h"
 #include "WebSocketFrame.h"
-#include "WebSocketHandshake.h"
 #include <wtf/Deque.h>
 #include <wtf/Forward.h>
 #include <wtf/RefCounted.h>
@@ -54,6 +52,7 @@
 class SocketStreamHandle;
 class SocketStreamError;
 class WebSocketChannelClient;
+class WebSocketHandshake;
 
 class WebSocketChannel : public RefCounted<WebSocketChannel>, public SocketStreamHandleClient, public ThreadableWebSocketChannel, public FileReaderLoaderClient
 {
@@ -71,7 +70,7 @@
     ThreadableWebSocketChannel::SendResult send(const String& message) override;
     ThreadableWebSocketChannel::SendResult send(const JSC::ArrayBuffer&, unsigned byteOffset, unsigned byteLength) override;
     ThreadableWebSocketChannel::SendResult send(Blob&) override;
-    unsigned long bufferedAmount() const override;
+    unsigned bufferedAmount() const override;
     void close(int code, const String& reason) override; // Start closing handshake.
     void fail(const String& reason) override;
     void disconnect() override;
@@ -80,14 +79,12 @@
     void resume() override;
 
     // SocketStreamHandleClient functions.
-    void willOpenSocketStream(SocketStreamHandle*) override;
-    void didOpenSocketStream(SocketStreamHandle*) override;
-    void didCloseSocketStream(SocketStreamHandle*) override;
-    void didReceiveSocketStreamData(SocketStreamHandle*, const char*, int) override;
-    void didUpdateBufferedAmount(SocketStreamHandle*, size_t bufferedAmount) override;
-    void didFailSocketStream(SocketStreamHandle*, const SocketStreamError&) override;
-    void didReceiveAuthenticationChallenge(SocketStreamHandle*, const AuthenticationChallenge&) override;
-    void didCancelAuthenticationChallenge(SocketStreamHandle*, const AuthenticationChallenge&) override;
+    void willOpenSocketStream(SocketStreamHandle&) override;
+    void didOpenSocketStream(SocketStreamHandle&) override;
+    void didCloseSocketStream(SocketStreamHandle&) override;
+    void didReceiveSocketStreamData(SocketStreamHandle&, const char*, int) override;
+    void didUpdateBufferedAmount(SocketStreamHandle&, size_t bufferedAmount) override;
+    void didFailSocketStream(SocketStreamHandle&, const SocketStreamError&) override;
 
     enum CloseEventCode {
         CloseEventCodeNotSpecified = -1,
@@ -191,29 +188,29 @@
     Vector<char> m_buffer;
 
     Timer m_resumeTimer;
-    bool m_suspended;
-    bool m_closing;
-    bool m_receivedClosingHandshake;
+    bool m_suspended { false };
+    bool m_closing { false };
+    bool m_receivedClosingHandshake { false };
     Timer m_closingTimer;
-    bool m_closed;
-    bool m_shouldDiscardReceivedData;
-    unsigned long m_unhandledBufferedAmount;
+    bool m_closed { false };
+    bool m_shouldDiscardReceivedData { false };
+    unsigned m_unhandledBufferedAmount { 0 };
 
-    unsigned long m_identifier; // m_identifier == 0 means that we could not obtain a valid identifier.
+    unsigned m_identifier { 0 }; // m_identifier == 0 means that we could not obtain a valid identifier.
 
     // Private members only for hybi-10 protocol.
-    bool m_hasContinuousFrame;
+    bool m_hasContinuousFrame { false };
     WebSocketFrame::OpCode m_continuousFrameOpCode;
     Vector<uint8_t> m_continuousFrameData;
-    unsigned short m_closeEventCode;
+    unsigned short m_closeEventCode { CloseEventCodeAbnormalClosure };
     String m_closeEventReason;
 
     Deque<std::unique_ptr<QueuedFrame>> m_outgoingFrameQueue;
-    OutgoingFrameQueueStatus m_outgoingFrameQueueStatus;
+    OutgoingFrameQueueStatus m_outgoingFrameQueueStatus { OutgoingFrameQueueOpen };
 
     // FIXME: Load two or more Blobs simultaneously for better performance.
     std::unique_ptr<FileReaderLoader> m_blobLoader;
-    BlobLoaderStatus m_blobLoaderStatus;
+    BlobLoaderStatus m_blobLoaderStatus { BlobLoaderNotStarted };
 
     WebSocketDeflateFramer m_deflateFramer;
 };
@@ -221,5 +218,3 @@
 } // namespace WebCore
 
 #endif // ENABLE(WEB_SOCKETS)
-
-#endif // WebSocketChannel_h

Modified: trunk/Source/WebCore/Modules/websockets/WebSocketChannelClient.h (201879 => 201880)


--- trunk/Source/WebCore/Modules/websockets/WebSocketChannelClient.h	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketChannelClient.h	2016-06-09 20:10:30 UTC (rev 201880)
@@ -28,8 +28,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebSocketChannelClient_h
-#define WebSocketChannelClient_h
+#pragma once
 
 #if ENABLE(WEB_SOCKETS)
 
@@ -38,27 +37,25 @@
 
 namespace WebCore {
 
-    class WebSocketChannelClient {
-    public:
-        virtual ~WebSocketChannelClient() { }
-        virtual void didConnect() { }
-        virtual void didReceiveMessage(const String&) { }
-        virtual void didReceiveBinaryData(Vector<uint8_t>&&) { }
-        virtual void didReceiveMessageError() { }
-        virtual void didUpdateBufferedAmount(unsigned long /* bufferedAmount */) { }
-        virtual void didStartClosingHandshake() { }
-        enum ClosingHandshakeCompletionStatus {
-            ClosingHandshakeIncomplete,
-            ClosingHandshakeComplete
-        };
-        virtual void didClose(unsigned long /* unhandledBufferedAmount */, ClosingHandshakeCompletionStatus, unsigned short /* code */, const String& /* reason */) { }
-
-    protected:
-        WebSocketChannelClient() { }
+class WebSocketChannelClient {
+public:
+    virtual ~WebSocketChannelClient() { }
+    virtual void didConnect() { }
+    virtual void didReceiveMessage(const String&) { }
+    virtual void didReceiveBinaryData(Vector<uint8_t>&&) { }
+    virtual void didReceiveMessageError() { }
+    virtual void didUpdateBufferedAmount(unsigned /* bufferedAmount */) { }
+    virtual void didStartClosingHandshake() { }
+    enum ClosingHandshakeCompletionStatus {
+        ClosingHandshakeIncomplete,
+        ClosingHandshakeComplete
     };
+    virtual void didClose(unsigned /* unhandledBufferedAmount */, ClosingHandshakeCompletionStatus, unsigned short /* code */, const String& /* reason */) { }
 
+protected:
+    WebSocketChannelClient() { }
+};
+
 } // namespace WebCore
 
 #endif // ENABLE(WEB_SOCKETS)
-
-#endif // WebSocketChannelClient_h

Modified: trunk/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp (201879 => 201880)


--- trunk/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.cpp	2016-06-09 20:10:30 UTC (rev 201880)
@@ -101,7 +101,7 @@
     return m_bridge->send(binaryData);
 }
 
-unsigned long WorkerThreadableWebSocketChannel::bufferedAmount() const
+unsigned WorkerThreadableWebSocketChannel::bufferedAmount() const
 {
     if (!m_bridge)
         return 0;
@@ -206,7 +206,7 @@
     if (!m_mainWebSocketChannel)
         return;
 
-    unsigned long bufferedAmount = m_mainWebSocketChannel->bufferedAmount();
+    unsigned bufferedAmount = m_mainWebSocketChannel->bufferedAmount();
     m_loaderProxy.postTaskForModeToWorkerGlobalScope([workerClientWrapper = m_workerClientWrapper.copyRef(), bufferedAmount](ScriptExecutionContext& context) mutable {
         ASSERT_UNUSED(context, context.isWorkerGlobalScope());
         workerClientWrapper->setBufferedAmount(bufferedAmount);
@@ -288,7 +288,7 @@
     }, m_taskMode);
 }
 
-void WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount(unsigned long bufferedAmount)
+void WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount(unsigned bufferedAmount)
 {
     ASSERT(isMainThread());
 
@@ -308,7 +308,7 @@
     }, m_taskMode);
 }
 
-void WorkerThreadableWebSocketChannel::Peer::didClose(unsigned long unhandledBufferedAmount, ClosingHandshakeCompletionStatus closingHandshakeCompletion, unsigned short code, const String& reason)
+void WorkerThreadableWebSocketChannel::Peer::didClose(unsigned unhandledBufferedAmount, ClosingHandshakeCompletionStatus closingHandshakeCompletion, unsigned short code, const String& reason)
 {
     ASSERT(isMainThread());
     m_mainWebSocketChannel = nullptr;
@@ -461,7 +461,7 @@
     return m_workerClientWrapper->sendRequestResult();
 }
 
-unsigned long WorkerThreadableWebSocketChannel::Bridge::bufferedAmount()
+unsigned WorkerThreadableWebSocketChannel::Bridge::bufferedAmount()
 {
     if (!m_peer)
         return 0;

Modified: trunk/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h (201879 => 201880)


--- trunk/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/Modules/websockets/WorkerThreadableWebSocketChannel.h	2016-06-09 20:10:30 UTC (rev 201880)
@@ -66,7 +66,7 @@
     ThreadableWebSocketChannel::SendResult send(const String& message) override;
     ThreadableWebSocketChannel::SendResult send(const JSC::ArrayBuffer&, unsigned byteOffset, unsigned byteLength) override;
     ThreadableWebSocketChannel::SendResult send(Blob&) override;
-    unsigned long bufferedAmount() const override;
+    unsigned bufferedAmount() const override;
     void close(int code, const String& reason) override;
     void fail(const String& reason) override;
     void disconnect() override; // Will suppress didClose().
@@ -96,9 +96,9 @@
         void didConnect() override;
         void didReceiveMessage(const String& message) override;
         void didReceiveBinaryData(Vector<uint8_t>&&) override;
-        void didUpdateBufferedAmount(unsigned long bufferedAmount) override;
+        void didUpdateBufferedAmount(unsigned bufferedAmount) override;
         void didStartClosingHandshake() override;
-        void didClose(unsigned long unhandledBufferedAmount, ClosingHandshakeCompletionStatus, unsigned short code, const String& reason) override;
+        void didClose(unsigned unhandledBufferedAmount, ClosingHandshakeCompletionStatus, unsigned short code, const String& reason) override;
         void didReceiveMessageError() override;
 
     private:
@@ -129,7 +129,7 @@
         ThreadableWebSocketChannel::SendResult send(const String& message);
         ThreadableWebSocketChannel::SendResult send(const JSC::ArrayBuffer&, unsigned byteOffset, unsigned byteLength);
         ThreadableWebSocketChannel::SendResult send(Blob&);
-        unsigned long bufferedAmount();
+        unsigned bufferedAmount();
         void close(int code, const String& reason);
         void fail(const String& reason);
         void disconnect();

Modified: trunk/Source/WebCore/platform/network/BlobData.cpp (201879 => 201880)


--- trunk/Source/WebCore/platform/network/BlobData.cpp	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/platform/network/BlobData.cpp	2016-06-09 20:10:30 UTC (rev 201880)
@@ -75,10 +75,10 @@
     m_items.append(BlobDataItem(data, offset, length));
 }
 
-void BlobData::appendFile(PassRefPtr<BlobDataFileReference> file)
+void BlobData::appendFile(Ref<BlobDataFileReference>&& file)
 {
     file->startTrackingModifications();
-    m_items.append(BlobDataItem(file));
+    m_items.append(BlobDataItem(WTFMove(file)));
 }
 
 void BlobData::appendFile(BlobDataFileReference* file, long long offset, long long length)

Modified: trunk/Source/WebCore/platform/network/BlobData.h (201879 => 201880)


--- trunk/Source/WebCore/platform/network/BlobData.h	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/platform/network/BlobData.h	2016-06-09 20:10:30 UTC (rev 201880)
@@ -64,9 +64,9 @@
 private:
     friend class BlobData;
 
-    explicit BlobDataItem(PassRefPtr<BlobDataFileReference> file)
+    explicit BlobDataItem(Ref<BlobDataFileReference>&& file)
         : m_type(Type::File)
-        , m_file(file)
+        , m_file(WTFMove(file))
         , m_offset(0)
         , m_length(toEndOfFile)
     {
@@ -111,7 +111,7 @@
     void swapItems(BlobDataItemList&);
 
     void appendData(const ThreadSafeDataBuffer&);
-    void appendFile(PassRefPtr<BlobDataFileReference>);
+    void appendFile(Ref<BlobDataFileReference>&&);
 
 private:
     friend class BlobRegistryImpl;

Modified: trunk/Source/WebCore/platform/network/BlobRegistry.h (201879 => 201880)


--- trunk/Source/WebCore/platform/network/BlobRegistry.h	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/platform/network/BlobRegistry.h	2016-06-09 20:10:30 UTC (rev 201880)
@@ -28,8 +28,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef BlobRegistry_h
-#define BlobRegistry_h
+#pragma once
 
 #include <functional>
 #include <wtf/Forward.h>
@@ -50,7 +49,7 @@
 public:
 
     // Registers a blob URL referring to the specified file.
-    virtual void registerFileBlobURL(const URL&, RefPtr<BlobDataFileReference>&&, const String& contentType) = 0;
+    virtual void registerFileBlobURL(const URL&, Ref<BlobDataFileReference>&&, const String& contentType) = 0;
 
     // Registers a blob URL referring to the specified blob data.
     virtual void registerBlobURL(const URL&, Vector<BlobPart>, const String& contentType) = 0;
@@ -77,5 +76,3 @@
 };
 
 } // namespace WebCore
-
-#endif // BlobRegistry_h

Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp (201879 => 201880)


--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp	2016-06-09 20:10:30 UTC (rev 201880)
@@ -110,15 +110,14 @@
     ASSERT(!length);
 }
 
-void BlobRegistryImpl::registerFileBlobURL(const URL& url, RefPtr<BlobDataFileReference>&& file, const String& contentType)
+void BlobRegistryImpl::registerFileBlobURL(const URL& url, Ref<BlobDataFileReference>&& file, const String& contentType)
 {
     ASSERT(isMainThread());
     registerBlobResourceHandleConstructor();
 
-    RefPtr<BlobData> blobData = BlobData::create(contentType);
-
-    blobData->appendFile(file);
-    m_blobs.set(url.string(), blobData.release());
+    auto blobData = BlobData::create(contentType);
+    blobData->appendFile(WTFMove(file));
+    m_blobs.set(url.string(), WTFMove(blobData));
 }
 
 void BlobRegistryImpl::registerBlobURL(const URL& url, Vector<BlobPart> blobParts, const String& contentType)
@@ -171,13 +170,13 @@
         return;
     }
 
-    if (file == nullptr || file->path().isEmpty())
+    if (!file || file->path().isEmpty())
         return;
 
-    RefPtr<BlobData> backingFile = BlobData::create({ });
-    backingFile->appendFile(WTFMove(file));
+    auto backingFile = BlobData::create({ });
+    backingFile->appendFile(file.releaseNonNull());
 
-    m_blobs.set(url.string(), backingFile.release());
+    m_blobs.set(url.string(), WTFMove(backingFile));
 }
 
 void BlobRegistryImpl::registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end)

Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.h (201879 => 201880)


--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.h	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.h	2016-06-09 20:10:30 UTC (rev 201880)
@@ -57,7 +57,7 @@
 private:
     void appendStorageItems(BlobData*, const BlobDataItemList&, long long offset, long long length);
 
-    void registerFileBlobURL(const URL&, RefPtr<BlobDataFileReference>&&, const String& contentType) override;
+    void registerFileBlobURL(const URL&, Ref<BlobDataFileReference>&&, const String& contentType) override;
     void registerBlobURL(const URL&, Vector<BlobPart>, const String& contentType) override;
     void registerBlobURL(const URL&, const URL& srcURL) override;
     void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&) override;

Modified: trunk/Source/WebCore/platform/network/SocketStreamHandleBase.cpp (201879 => 201880)


--- trunk/Source/WebCore/platform/network/SocketStreamHandleBase.cpp	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/platform/network/SocketStreamHandleBase.cpp	2016-06-09 20:10:30 UTC (rev 201880)
@@ -61,7 +61,7 @@
         }
         m_buffer.append(data, length);
         if (m_client)
-            m_client->didUpdateBufferedAmount(static_cast<SocketStreamHandle*>(this), bufferedAmount());
+            m_client->didUpdateBufferedAmount(static_cast<SocketStreamHandle&>(*this), bufferedAmount());
         return true;
     }
     int bytesWritten = 0;
@@ -76,7 +76,7 @@
     if (bytesWritten < length) {
         m_buffer.append(data + bytesWritten, length - bytesWritten);
         if (m_client)
-            m_client->didUpdateBufferedAmount(static_cast<SocketStreamHandle*>(this), bufferedAmount());
+            m_client->didUpdateBufferedAmount(static_cast<SocketStreamHandle&>(*this), bufferedAmount());
     }
     return true;
 }
@@ -93,7 +93,7 @@
 
 void SocketStreamHandleBase::disconnect()
 {
-    Ref<SocketStreamHandle> protect(*static_cast<SocketStreamHandle*>(this)); // platformClose calls the client, which may make the handle get deallocated immediately.
+    Ref<SocketStreamHandle> protect(static_cast<SocketStreamHandle&>(*this)); // platformClose calls the client, which may make the handle get deallocated immediately.
 
     platformClose();
     m_state = Closed;
@@ -127,7 +127,7 @@
         m_buffer.consume(bytesWritten);
     } while (!pending && !m_buffer.isEmpty());
     if (m_client)
-        m_client->didUpdateBufferedAmount(static_cast<SocketStreamHandle*>(this), bufferedAmount());
+        m_client->didUpdateBufferedAmount(static_cast<SocketStreamHandle&>(*this), bufferedAmount());
     return true;
 }
 

Modified: trunk/Source/WebCore/platform/network/SocketStreamHandleBase.h (201879 => 201880)


--- trunk/Source/WebCore/platform/network/SocketStreamHandleBase.h	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/platform/network/SocketStreamHandleBase.h	2016-06-09 20:10:30 UTC (rev 201880)
@@ -29,11 +29,9 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef SocketStreamHandleBase_h
-#define SocketStreamHandleBase_h
+#pragma once
 
 #include "URL.h"
-
 #include <wtf/StreamBuffer.h>
 
 namespace WebCore {
@@ -69,5 +67,3 @@
     };
 
 }  // namespace WebCore
-
-#endif  // SocketStreamHandleBase_h

Modified: trunk/Source/WebCore/platform/network/SocketStreamHandleClient.h (201879 => 201880)


--- trunk/Source/WebCore/platform/network/SocketStreamHandleClient.h	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/platform/network/SocketStreamHandleClient.h	2016-06-09 20:10:30 UTC (rev 201880)
@@ -29,33 +29,24 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef SocketStreamHandleClient_h
-#define SocketStreamHandleClient_h
+#pragma once
 
 namespace WebCore {
 
-    class AuthenticationChallenge;
-    class URL;
-    class SocketStreamError;
-    class SocketStreamHandle;
+class SocketStreamError;
+class SocketStreamHandle;
 
-    class SocketStreamHandleClient {
-    public:
-        virtual ~SocketStreamHandleClient() { }
+class SocketStreamHandleClient {
+public:
+    virtual ~SocketStreamHandleClient() { }
 
-        virtual void willOpenSocketStream(SocketStreamHandle*) { }
-        virtual void didOpenSocketStream(SocketStreamHandle*) { }
-        virtual void didCloseSocketStream(SocketStreamHandle*) { }
-        virtual void didReceiveSocketStreamData(SocketStreamHandle*, const char* /*data*/, int /*length*/) { }
-        virtual void didUpdateBufferedAmount(SocketStreamHandle*, size_t /*bufferedAmount*/) { }
+    virtual void willOpenSocketStream(SocketStreamHandle&) { }
+    virtual void didOpenSocketStream(SocketStreamHandle&) { }
+    virtual void didCloseSocketStream(SocketStreamHandle&) { }
+    virtual void didReceiveSocketStreamData(SocketStreamHandle&, const char* /*data*/, int /*length*/) { }
+    virtual void didUpdateBufferedAmount(SocketStreamHandle&, size_t /*bufferedAmount*/) { }
 
-        virtual void didFailSocketStream(SocketStreamHandle*, const SocketStreamError&) { }
+    virtual void didFailSocketStream(SocketStreamHandle&, const SocketStreamError&) { }
+};
 
-        // No authentication for streams per se, but proxy may ask for credentials.
-        virtual void didReceiveAuthenticationChallenge(SocketStreamHandle*, const AuthenticationChallenge&) { }
-        virtual void didCancelAuthenticationChallenge(SocketStreamHandle*, const AuthenticationChallenge&) { }
-    };
-
-}  // namespace WebCore
-
-#endif  // SocketStreamHandleClient_h
+} // namespace WebCore

Modified: trunk/Source/WebCore/platform/network/cf/SocketStreamHandle.h (201879 => 201880)


--- trunk/Source/WebCore/platform/network/cf/SocketStreamHandle.h	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/platform/network/cf/SocketStreamHandle.h	2016-06-09 20:10:30 UTC (rev 201880)
@@ -29,10 +29,8 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef SocketStreamHandle_h
-#define SocketStreamHandle_h
+#pragma once
 
-#include "AuthenticationClient.h"
 #include "SocketStreamHandleBase.h"
 #include <wtf/RetainPtr.h>
 #include <wtf/ThreadSafeRefCounted.h>
@@ -47,15 +45,12 @@
 class ProtectionSpace;
 class SocketStreamHandleClient;
 
-class SocketStreamHandle : public ThreadSafeRefCounted<SocketStreamHandle>, public SocketStreamHandleBase, public AuthenticationClient {
+class SocketStreamHandle : public ThreadSafeRefCounted<SocketStreamHandle>, public SocketStreamHandleBase {
 public:
-    static PassRefPtr<SocketStreamHandle> create(const URL& url, SocketStreamHandleClient* client, NetworkingContext& networkingContext, bool usesEphemeralSession) { return adoptRef(new SocketStreamHandle(url, client, networkingContext, usesEphemeralSession)); }
+    static Ref<SocketStreamHandle> create(const URL& url, SocketStreamHandleClient* client, NetworkingContext& networkingContext, bool usesEphemeralSession) { return adoptRef(*new SocketStreamHandle(url, client, networkingContext, usesEphemeralSession)); }
 
     virtual ~SocketStreamHandle();
 
-    using ThreadSafeRefCounted<SocketStreamHandle>::ref;
-    using ThreadSafeRefCounted<SocketStreamHandle>::deref;
-
 private:
     virtual int platformSend(const char* data, int length);
     virtual void platformClose();
@@ -88,16 +83,6 @@
 
     bool getStoredCONNECTProxyCredentials(const ProtectionSpace&, String& login, String& password);
 
-    // No authentication for streams per se, but proxy may ask for credentials.
-    virtual void receivedCredential(const AuthenticationChallenge&, const Credential&);
-    virtual void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
-    virtual void receivedCancellation(const AuthenticationChallenge&);
-    virtual void receivedRequestToPerformDefaultHandling(const AuthenticationChallenge&);
-    virtual void receivedChallengeRejection(const AuthenticationChallenge&);
-
-    virtual void refAuthenticationClient() { ref(); }
-    virtual void derefAuthenticationClient() { deref(); }
-
     enum ConnectingSubstate { New, ExecutingPACFile, WaitingForCredentials, WaitingForConnect, Connected };
     ConnectingSubstate m_connectingSubstate;
 
@@ -117,5 +102,3 @@
 };
 
 }  // namespace WebCore
-
-#endif  // SocketStreamHandle_h

Modified: trunk/Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp (201879 => 201880)


--- trunk/Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp	2016-06-09 20:10:30 UTC (rev 201880)
@@ -87,7 +87,7 @@
     if (url.protocolIs("ws")
         && !usesEphemeralSession
         && _CFNetworkIsKnownHSTSHostWithSession(m_httpsURL.get(), nullptr)) {
-        m_client->didFailSocketStream(this, SocketStreamError(0, m_url.string(), "WebSocket connection failed because it violates HTTP Strict Transport Security."));
+        m_client->didFailSocketStream(*this, SocketStreamError(0, m_url.string(), "WebSocket connection failed because it violates HTTP Strict Transport Security."));
         return;
     }
 #endif
@@ -388,7 +388,7 @@
 
     if (!CFHTTPAuthenticationRequiresUserNameAndPassword(authentication.get())) {
         // That's all we can offer...
-        m_client->didFailSocketStream(this, SocketStreamError(0, m_url.string(), "Proxy authentication scheme is not supported for WebSockets"));
+        m_client->didFailSocketStream(*this, SocketStreamError(0, m_url.string(), "Proxy authentication scheme is not supported for WebSockets"));
         return;
     }
 
@@ -399,7 +399,7 @@
 
     if (!methodCF || !realmCF) {
         // This shouldn't happen, but on some OS versions we get incomplete authentication data, see <rdar://problem/10416316>.
-        m_client->didFailSocketStream(this, SocketStreamError(0, m_url.string(), "WebSocket proxy authentication couldn't be handled"));
+        m_client->didFailSocketStream(*this, SocketStreamError(0, m_url.string(), "WebSocket proxy authentication couldn't be handled"));
         return;
     }
 
@@ -418,7 +418,7 @@
 
         if (!proxyAuthorizationString) {
             // Fails e.g. for NTLM auth.
-            m_client->didFailSocketStream(this, SocketStreamError(0, m_url.string(), "Proxy authentication scheme is not supported for WebSockets"));
+            m_client->didFailSocketStream(*this, SocketStreamError(0, m_url.string(), "Proxy authentication scheme is not supported for WebSockets"));
             return;
         }
 
@@ -430,7 +430,7 @@
 
     // FIXME: On platforms where AuthBrokerAgent is not available, ask the client if credentials could not be found.
 
-    m_client->didFailSocketStream(this, SocketStreamError(0, m_url.string(), "Proxy credentials are not available"));
+    m_client->didFailSocketStream(*this, SocketStreamError(0, m_url.string(), "Proxy credentials are not available"));
 }
 
 CFStringRef SocketStreamHandle::copyCFStreamDescription(void* info)
@@ -505,14 +505,14 @@
                     addCONNECTCredentials(proxyResponse.get());
                     return;
                 default:
-                    m_client->didFailSocketStream(this, SocketStreamError(static_cast<int>(proxyResponseCode), m_url.string(), "Proxy connection could not be established, unexpected response code"));
+                    m_client->didFailSocketStream(*this, SocketStreamError(static_cast<int>(proxyResponseCode), m_url.string(), "Proxy connection could not be established, unexpected response code"));
                     platformClose();
                     return;
                 }
             }
             m_connectingSubstate = Connected;
             m_state = Open;
-            m_client->didOpenSocketStream(this);
+            m_client->didOpenSocketStream(*this);
         }
 
         // Not an "else if", we could have made a client call above, and it could close the connection.
@@ -533,7 +533,7 @@
         if (!length)
             return;
 
-        m_client->didReceiveSocketStreamData(this, reinterpret_cast<const char*>(ptr), length);
+        m_client->didReceiveSocketStreamData(*this, reinterpret_cast<const char*>(ptr), length);
 
         return;
     }
@@ -583,7 +583,7 @@
             }
             m_connectingSubstate = Connected;
             m_state = Open;
-            m_client->didOpenSocketStream(this);
+            m_client->didOpenSocketStream(*this);
         }
 
         // Not an "else if", we could have made a client call above, and it could close the connection.
@@ -636,7 +636,7 @@
         description = String(descriptionCF.get());
     }
 
-    m_client->didFailSocketStream(this, SocketStreamError(static_cast<int>(errorCode), m_url.string(), description));
+    m_client->didFailSocketStream(*this, SocketStreamError(static_cast<int>(errorCode), m_url.string(), description));
 }
 
 SocketStreamHandle::~SocketStreamHandle()
@@ -664,7 +664,7 @@
     ASSERT(!m_readStream == !m_writeStream);
     if (!m_readStream) {
         if (m_connectingSubstate == New || m_connectingSubstate == ExecutingPACFile)
-            m_client->didCloseSocketStream(this);
+            m_client->didCloseSocketStream(*this);
         return;
     }
 
@@ -682,29 +682,9 @@
     m_readStream = 0;
     m_writeStream = 0;
 
-    m_client->didCloseSocketStream(this);
+    m_client->didCloseSocketStream(*this);
 }
 
-void SocketStreamHandle::receivedCredential(const AuthenticationChallenge&, const Credential&)
-{
-}
-
-void SocketStreamHandle::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&)
-{
-}
-
-void SocketStreamHandle::receivedCancellation(const AuthenticationChallenge&)
-{
-}
-
-void SocketStreamHandle::receivedRequestToPerformDefaultHandling(const AuthenticationChallenge&)
-{
-}
-
-void SocketStreamHandle::receivedChallengeRejection(const AuthenticationChallenge&)
-{
-}
-
 unsigned short SocketStreamHandle::port() const
 {
     if (unsigned short urlPort = m_url.port())

Modified: trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp (201879 => 201880)


--- trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/platform/network/curl/ResourceHandleCurl.cpp	2016-06-09 20:10:30 UTC (rev 201880)
@@ -40,11 +40,6 @@
 #include "ResourceHandleManager.h"
 #include "SSLHandle.h"
 
-#if PLATFORM(WIN) && USE(CF)
-#include <wtf/PassRefPtr.h>
-#include <wtf/RetainPtr.h>
-#endif
-
 namespace WebCore {
 
 class WebCoreSynchronousLoader : public ResourceHandleClient {

Modified: trunk/Source/WebCore/platform/network/curl/SocketStreamHandle.h (201879 => 201880)


--- trunk/Source/WebCore/platform/network/curl/SocketStreamHandle.h	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/platform/network/curl/SocketStreamHandle.h	2016-06-09 20:10:30 UTC (rev 201880)
@@ -29,8 +29,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef SocketStreamHandle_h
-#define SocketStreamHandle_h
+#pragma once
 
 #include "SocketStreamHandleBase.h"
 
@@ -47,8 +46,6 @@
 
 namespace WebCore {
 
-class AuthenticationChallenge;
-class Credential;
 class NetworkingContext;
 class SocketStreamHandleClient;
 
@@ -76,14 +73,6 @@
 
     static std::unique_ptr<char[]> createCopy(const char* data, int length);
 
-    // No authentication for streams per se, but proxy may ask for credentials.
-    void didReceiveAuthenticationChallenge(const AuthenticationChallenge&);
-    void receivedCredential(const AuthenticationChallenge&, const Credential&);
-    void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
-    void receivedCancellation(const AuthenticationChallenge&);
-    void receivedRequestToPerformDefaultHandling(const AuthenticationChallenge&);
-    void receivedChallengeRejection(const AuthenticationChallenge&);
-
     struct SocketData {
         SocketData(std::unique_ptr<char[]>&& source, int length)
         {
@@ -111,5 +100,3 @@
 };
 
 } // namespace WebCore
-
-#endif // SocketStreamHandle_h

Modified: trunk/Source/WebCore/platform/network/curl/SocketStreamHandleCurl.cpp (201879 => 201880)


--- trunk/Source/WebCore/platform/network/curl/SocketStreamHandleCurl.cpp	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/platform/network/curl/SocketStreamHandleCurl.cpp	2016-06-09 20:10:30 UTC (rev 201880)
@@ -35,7 +35,6 @@
 #if USE(CURL)
 
 #include "Logging.h"
-#include "NotImplemented.h"
 #include "SocketStreamHandleClient.h"
 #include "URL.h"
 #include <wtf/MainThread.h>
@@ -82,7 +81,7 @@
     stopThread();
 
     if (m_client)
-        m_client->didCloseSocketStream(this);
+        m_client->didCloseSocketStream(*this);
 }
 
 bool SocketStreamHandle::readData(CURL* curlHandle)
@@ -258,7 +257,7 @@
     for (auto& socketData : receiveData) {
         if (socketData.size > 0) {
             if (m_client && state() == Open)
-                m_client->didReceiveSocketStreamData(this, socketData.data.get(), socketData.size);
+                m_client->didReceiveSocketStreamData(*this, socketData.data.get(), socketData.size);
         } else
             platformClose();
     }
@@ -271,7 +270,7 @@
     m_state = Open;
 
     if (m_client)
-        m_client->didOpenSocketStream(this);
+        m_client->didOpenSocketStream(*this);
 }
 
 std::unique_ptr<char[]> SocketStreamHandle::createCopy(const char* data, int length)
@@ -282,36 +281,6 @@
     return WTFMove(copy);
 }
 
-void SocketStreamHandle::didReceiveAuthenticationChallenge(const AuthenticationChallenge&)
-{
-    notImplemented();
-}
-
-void SocketStreamHandle::receivedCredential(const AuthenticationChallenge&, const Credential&)
-{
-    notImplemented();
-}
-
-void SocketStreamHandle::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&)
-{
-    notImplemented();
-}
-
-void SocketStreamHandle::receivedCancellation(const AuthenticationChallenge&)
-{
-    notImplemented();
-}
-
-void SocketStreamHandle::receivedRequestToPerformDefaultHandling(const AuthenticationChallenge&)
-{
-    notImplemented();
-}
-
-void SocketStreamHandle::receivedChallengeRejection(const AuthenticationChallenge&)
-{
-    notImplemented();
-}
-
 } // namespace WebCore
 
 #endif

Modified: trunk/Source/WebCore/platform/network/soup/SocketStreamHandle.h (201879 => 201880)


--- trunk/Source/WebCore/platform/network/soup/SocketStreamHandle.h	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/platform/network/soup/SocketStreamHandle.h	2016-06-09 20:10:30 UTC (rev 201880)
@@ -43,15 +43,13 @@
 
 namespace WebCore {
 
-    class AuthenticationChallenge;
-    class Credential;
     class NetworkingContext;
     class SocketStreamHandleClient;
 
     class SocketStreamHandle : public RefCounted<SocketStreamHandle>, public SocketStreamHandleBase {
     public:
-        static PassRefPtr<SocketStreamHandle> create(const URL& url, SocketStreamHandleClient* client, NetworkingContext&, bool) { return adoptRef(new SocketStreamHandle(url, client)); }
-        static PassRefPtr<SocketStreamHandle> create(GSocketConnection* socketConnection, SocketStreamHandleClient* client) { return adoptRef(new SocketStreamHandle(socketConnection, client)); }
+        static Ref<SocketStreamHandle> create(const URL& url, SocketStreamHandleClient* client, NetworkingContext&, bool) { return adoptRef(*new SocketStreamHandle(url, client)); }
+        static Ref<SocketStreamHandle> create(GSocketConnection* socketConnection, SocketStreamHandleClient* client) { return adoptRef(*new SocketStreamHandle(socketConnection, client)); }
 
         virtual ~SocketStreamHandle();
         void connected(GSocketConnection*, GError*);
@@ -74,14 +72,6 @@
         SocketStreamHandle(const URL&, SocketStreamHandleClient*);
         SocketStreamHandle(GSocketConnection*, SocketStreamHandleClient*);
 
-        // No authentication for streams per se, but proxy may ask for credentials.
-        void didReceiveAuthenticationChallenge(const AuthenticationChallenge&);
-        void receivedCredential(const AuthenticationChallenge&, const Credential&);
-        void receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&);
-        void receivedCancellation(const AuthenticationChallenge&);
-        void receivedRequestToPerformDefaultHandling(const AuthenticationChallenge&);
-        void receivedChallengeRejection(const AuthenticationChallenge&);
-
         void beginWaitingForSocketWritability();
         void stopWaitingForSocketWritability();
     };

Modified: trunk/Source/WebCore/platform/network/soup/SocketStreamHandleSoup.cpp (201879 => 201880)


--- trunk/Source/WebCore/platform/network/soup/SocketStreamHandleSoup.cpp	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebCore/platform/network/soup/SocketStreamHandleSoup.cpp	2016-06-09 20:10:30 UTC (rev 201880)
@@ -36,7 +36,6 @@
 
 #include "URL.h"
 #include "Logging.h"
-#include "NotImplemented.h"
 #include "SocketStreamError.h"
 #include "SocketStreamHandleClient.h"
 
@@ -68,17 +67,17 @@
     return gActiveHandles.get(id);
 }
 
-static void deactivateHandle(SocketStreamHandle* handle)
+static void deactivateHandle(SocketStreamHandle& handle)
 {
-    gActiveHandles.remove(handle->id());
+    gActiveHandles.remove(handle.id());
 }
 
-static void* activateHandle(SocketStreamHandle* handle)
+static void* activateHandle(SocketStreamHandle& handle)
 {
     // The first id cannot be 0, because it conflicts with the HashMap emptyValue.
     static gint currentHandleId = 1;
     void* id = GINT_TO_POINTER(currentHandleId++);
-    gActiveHandles.set(id, handle);
+    gActiveHandles.set(id, &handle);
     return id;
 }
 
@@ -88,7 +87,7 @@
     LOG(Network, "SocketStreamHandle %p new client %p", this, m_client);
     unsigned int port = url.hasPort() ? url.port() : (url.protocolIs("wss") ? 443 : 80);
 
-    m_id = activateHandle(this);
+    m_id = activateHandle(*this);
     GRefPtr<GSocketClient> socketClient = adoptGRef(g_socket_client_new());
     if (url.protocolIs("wss"))
         g_socket_client_set_tls(socketClient.get(), TRUE);
@@ -100,7 +99,7 @@
     : SocketStreamHandleBase(URL(), client)
 {
     LOG(Network, "SocketStreamHandle %p new client %p", this, m_client);
-    m_id = activateHandle(this);
+    m_id = activateHandle(*this);
     connected(socketConnection, 0);
 }
 
@@ -108,14 +107,14 @@
 {
     LOG(Network, "SocketStreamHandle %p delete", this);
     // If for some reason we were destroyed without closing, ensure that we are deactivated.
-    deactivateHandle(this);
-    setClient(0);
+    deactivateHandle(*this);
+    setClient(nullptr);
 }
 
 void SocketStreamHandle::connected(GSocketConnection* socketConnection, GError* error)
 {
     if (error) {
-        m_client->didFailSocketStream(this, SocketStreamError(error->code, error->message));
+        m_client->didFailSocketStream(*this, SocketStreamError(error->code, error->message));
         return;
     }
 
@@ -128,13 +127,13 @@
         reinterpret_cast<GAsyncReadyCallback>(readReadyCallback), m_id);
 
     m_state = Open;
-    m_client->didOpenSocketStream(this);
+    m_client->didOpenSocketStream(*this);
 }
 
 void SocketStreamHandle::readBytes(signed long bytesRead, GError* error)
 {
     if (error) {
-        m_client->didFailSocketStream(this, SocketStreamError(error->code, error->message));
+        m_client->didFailSocketStream(*this, SocketStreamError(error->code, error->message));
         return;
     }
 
@@ -144,8 +143,8 @@
     }
 
     // The client can close the handle, potentially removing the last reference.
-    RefPtr<SocketStreamHandle> protectedThis(this); 
-    m_client->didReceiveSocketStreamData(this, m_readBuffer.get(), bytesRead);
+    Ref<SocketStreamHandle> protectedThis(*this); 
+    m_client->didReceiveSocketStreamData(*this, m_readBuffer.get(), bytesRead);
     if (m_inputStream) // The client may have closed the connection.
         g_input_stream_read_async(m_inputStream.get(), m_readBuffer.get(), READ_BUFFER_SIZE, G_PRIORITY_DEFAULT, 0,
             reinterpret_cast<GAsyncReadyCallback>(readReadyCallback), m_id);
@@ -174,7 +173,7 @@
         if (g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK))
             beginWaitingForSocketWritability();
         else
-            m_client->didFailSocketStream(this, SocketStreamError(error->code, error->message));
+            m_client->didFailSocketStream(*this, SocketStreamError(error->code, error->message));
         return 0;
     }
 
@@ -190,14 +189,14 @@
 {
     LOG(Network, "SocketStreamHandle %p platformClose", this);
     // We remove this handle from the active handles list first, to disable all callbacks.
-    deactivateHandle(this);
+    deactivateHandle(*this);
     stopWaitingForSocketWritability();
 
     if (m_socketConnection) {
         GUniqueOutPtr<GError> error;
         g_io_stream_close(G_IO_STREAM(m_socketConnection.get()), 0, &error.outPtr());
         if (error)
-            m_client->didFailSocketStream(this, SocketStreamError(error->code, error->message));
+            m_client->didFailSocketStream(*this, SocketStreamError(error->code, error->message));
         m_socketConnection = 0;
     }
 
@@ -205,39 +204,9 @@
     m_inputStream = 0;
     m_readBuffer = nullptr;
 
-    m_client->didCloseSocketStream(this);
+    m_client->didCloseSocketStream(*this);
 }
 
-void SocketStreamHandle::didReceiveAuthenticationChallenge(const AuthenticationChallenge&)
-{
-    notImplemented();
-}
-
-void SocketStreamHandle::receivedCredential(const AuthenticationChallenge&, const Credential&)
-{
-    notImplemented();
-}
-
-void SocketStreamHandle::receivedRequestToContinueWithoutCredential(const AuthenticationChallenge&)
-{
-    notImplemented();
-}
-
-void SocketStreamHandle::receivedCancellation(const AuthenticationChallenge&)
-{
-    notImplemented();
-}
-
-void SocketStreamHandle::receivedRequestToPerformDefaultHandling(const AuthenticationChallenge&)
-{
-    notImplemented();
-}
-
-void SocketStreamHandle::receivedChallengeRejection(const AuthenticationChallenge&)
-{
-    notImplemented();
-}
-
 void SocketStreamHandle::beginWaitingForSocketWritability()
 {
     if (m_writeReadySource) // Already waiting.

Modified: trunk/Source/WebKit2/ChangeLog (201879 => 201880)


--- trunk/Source/WebKit2/ChangeLog	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebKit2/ChangeLog	2016-06-09 20:10:30 UTC (rev 201880)
@@ -1,3 +1,14 @@
+2016-06-09  Alex Christensen  <[email protected]>
+
+        Clean up WebSocket code
+        https://bugs.webkit.org/show_bug.cgi?id=158551
+
+        Reviewed by Darin Adler.
+
+        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
+        (WebKit::BlobRegistryProxy::registerFileBlobURL):
+        * WebProcess/FileAPI/BlobRegistryProxy.h:
+
 2016-06-09  David Kilzer  <[email protected]>
 
         Update properties for UIWKTextInteractionAssistant

Modified: trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp (201879 => 201880)


--- trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.cpp	2016-06-09 20:10:30 UTC (rev 201880)
@@ -36,7 +36,7 @@
 
 namespace WebKit {
 
-void BlobRegistryProxy::registerFileBlobURL(const WebCore::URL& url, RefPtr<BlobDataFileReference>&& file, const String& contentType)
+void BlobRegistryProxy::registerFileBlobURL(const WebCore::URL& url, Ref<BlobDataFileReference>&& file, const String& contentType)
 {
     SandboxExtension::Handle extensionHandle;
 

Modified: trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h (201879 => 201880)


--- trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h	2016-06-09 20:09:21 UTC (rev 201879)
+++ trunk/Source/WebKit2/WebProcess/FileAPI/BlobRegistryProxy.h	2016-06-09 20:10:30 UTC (rev 201880)
@@ -32,7 +32,7 @@
 
 class BlobRegistryProxy final : public WebCore::BlobRegistry {
 public:
-    void registerFileBlobURL(const WebCore::URL&, RefPtr<WebCore::BlobDataFileReference>&&, const String& contentType) override;
+    void registerFileBlobURL(const WebCore::URL&, Ref<WebCore::BlobDataFileReference>&&, const String& contentType) override;
     void registerBlobURL(const WebCore::URL&, Vector<WebCore::BlobPart>, const String& contentType) override;
     void registerBlobURL(const WebCore::URL&, const WebCore::URL& srcURL) override;
     void registerBlobURLOptionallyFileBacked(const WebCore::URL&, const WebCore::URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&&) override;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to