WebSocket: Rename SocketStreamHandleClient member functions
authoryutak@chromium.org <yutak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Aug 2011 07:26:41 +0000 (07:26 +0000)
committeryutak@chromium.org <yutak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 1 Aug 2011 07:26:41 +0000 (07:26 +0000)
https://bugs.webkit.org/show_bug.cgi?id=65374

Reviewed by Kent Tamura.

Source/WebCore:

Rename SocketStreamHandleClient member functions to avoid conflict of the names of
FileReaderLoaderClient functions.

No change in behavior, thus no new tests are added.

* platform/network/SocketStreamHandleClient.h:
(WebCore::SocketStreamHandleClient::didOpenSocketStream):
(WebCore::SocketStreamHandleClient::didCloseSocketStream):
(WebCore::SocketStreamHandleClient::didReceiveSocketStreamData):
(WebCore::SocketStreamHandleClient::didFailSocketStream):
* platform/network/brew/SocketStreamHandleBrew.cpp:
(WebCore::SocketStreamHandlePrivate::socketConnected):
(WebCore::SocketStreamHandlePrivate::socketReadyRead):
(WebCore::SocketStreamHandlePrivate::socketClosed):
(WebCore::SocketStreamHandlePrivate::socketError):
* platform/network/cf/SocketStreamHandleCFNet.cpp:
(WebCore::SocketStreamHandle::addCONNECTCredentials):
(WebCore::SocketStreamHandle::readStreamCallback):
(WebCore::SocketStreamHandle::writeStreamCallback):
(WebCore::SocketStreamHandle::reportErrorToClient):
(WebCore::SocketStreamHandle::platformClose):
* platform/network/qt/SocketStreamHandleQt.cpp:
(WebCore::SocketStreamHandlePrivate::socketConnected):
(WebCore::SocketStreamHandlePrivate::socketReadyRead):
(WebCore::SocketStreamHandlePrivate::socketClosedCallback):
(WebCore::SocketStreamHandlePrivate::socketErrorCallback):
* platform/network/soup/SocketStreamHandleSoup.cpp:
(WebCore::SocketStreamHandle::connected):
(WebCore::SocketStreamHandle::readBytes):
(WebCore::SocketStreamHandle::platformSend):
(WebCore::SocketStreamHandle::platformClose):
* websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didOpenSocketStream):
(WebCore::WebSocketChannel::didCloseSocketStream):
(WebCore::WebSocketChannel::didReceiveSocketStreamData):
(WebCore::WebSocketChannel::didFailSocketStream):
(WebCore::WebSocketChannel::resumeTimerFired):
* websockets/WebSocketChannel.h:

Source/WebKit/chromium:

* src/SocketStreamHandle.cpp:
(WebCore::SocketStreamHandleInternal::didOpenStream):
(WebCore::SocketStreamHandleInternal::didReceiveData):
(WebCore::SocketStreamHandleInternal::didClose):
(WebCore::SocketStreamHandleInternal::didFail):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/network/SocketStreamHandleClient.h
Source/WebCore/platform/network/brew/SocketStreamHandleBrew.cpp
Source/WebCore/platform/network/cf/SocketStreamHandleCFNet.cpp
Source/WebCore/platform/network/qt/SocketStreamHandleQt.cpp
Source/WebCore/platform/network/soup/SocketStreamHandleSoup.cpp
Source/WebCore/websockets/WebSocketChannel.cpp
Source/WebCore/websockets/WebSocketChannel.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/SocketStreamHandle.cpp

index 5edc576..26b9b84 100644 (file)
@@ -1,3 +1,49 @@
+2011-08-01  Yuta Kitamura  <yutak@chromium.org>
+
+        WebSocket: Rename SocketStreamHandleClient member functions
+        https://bugs.webkit.org/show_bug.cgi?id=65374
+
+        Reviewed by Kent Tamura.
+
+        Rename SocketStreamHandleClient member functions to avoid conflict of the names of
+        FileReaderLoaderClient functions.
+
+        No change in behavior, thus no new tests are added.
+
+        * platform/network/SocketStreamHandleClient.h:
+        (WebCore::SocketStreamHandleClient::didOpenSocketStream):
+        (WebCore::SocketStreamHandleClient::didCloseSocketStream):
+        (WebCore::SocketStreamHandleClient::didReceiveSocketStreamData):
+        (WebCore::SocketStreamHandleClient::didFailSocketStream):
+        * platform/network/brew/SocketStreamHandleBrew.cpp:
+        (WebCore::SocketStreamHandlePrivate::socketConnected):
+        (WebCore::SocketStreamHandlePrivate::socketReadyRead):
+        (WebCore::SocketStreamHandlePrivate::socketClosed):
+        (WebCore::SocketStreamHandlePrivate::socketError):
+        * platform/network/cf/SocketStreamHandleCFNet.cpp:
+        (WebCore::SocketStreamHandle::addCONNECTCredentials):
+        (WebCore::SocketStreamHandle::readStreamCallback):
+        (WebCore::SocketStreamHandle::writeStreamCallback):
+        (WebCore::SocketStreamHandle::reportErrorToClient):
+        (WebCore::SocketStreamHandle::platformClose):
+        * platform/network/qt/SocketStreamHandleQt.cpp:
+        (WebCore::SocketStreamHandlePrivate::socketConnected):
+        (WebCore::SocketStreamHandlePrivate::socketReadyRead):
+        (WebCore::SocketStreamHandlePrivate::socketClosedCallback):
+        (WebCore::SocketStreamHandlePrivate::socketErrorCallback):
+        * platform/network/soup/SocketStreamHandleSoup.cpp:
+        (WebCore::SocketStreamHandle::connected):
+        (WebCore::SocketStreamHandle::readBytes):
+        (WebCore::SocketStreamHandle::platformSend):
+        (WebCore::SocketStreamHandle::platformClose):
+        * websockets/WebSocketChannel.cpp:
+        (WebCore::WebSocketChannel::didOpenSocketStream):
+        (WebCore::WebSocketChannel::didCloseSocketStream):
+        (WebCore::WebSocketChannel::didReceiveSocketStreamData):
+        (WebCore::WebSocketChannel::didFailSocketStream):
+        (WebCore::WebSocketChannel::resumeTimerFired):
+        * websockets/WebSocketChannel.h:
+
 2011-07-31  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r92094.
index 5d97ec0..5affd33 100644 (file)
@@ -43,11 +43,11 @@ namespace WebCore {
     public:
         virtual ~SocketStreamHandleClient() { }
 
-        virtual void didOpen(SocketStreamHandle*) { }
-        virtual void didClose(SocketStreamHandle*) { }
-        virtual void didReceiveData(SocketStreamHandle*, const char* /*data*/, int /*length*/) { }
+        virtual void didOpenSocketStream(SocketStreamHandle*) { }
+        virtual void didCloseSocketStream(SocketStreamHandle*) { }
+        virtual void didReceiveSocketStreamData(SocketStreamHandle*, const char* /*data*/, int /*length*/) { }
 
-        virtual void didFail(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&) { }
index 5dc925e..0476f5e 100644 (file)
@@ -113,7 +113,7 @@ void SocketStreamHandlePrivate::socketConnected()
 {
     if (m_streamHandle && m_streamHandle->client()) {
         m_streamHandle->m_state = SocketStreamHandleBase::Open;
-        m_streamHandle->client()->didOpen(m_streamHandle);
+        m_streamHandle->client()->didOpenSocketStream(m_streamHandle);
     }
 
     ISOCKET_Readable(m_socket.get(), socketReadableCallback, this);
@@ -130,7 +130,7 @@ void SocketStreamHandlePrivate::socketReadyRead()
             return;
         }
 
-        m_streamHandle->client()->didReceiveData(m_streamHandle, buffer.data(), readSize);
+        m_streamHandle->client()->didReceiveSocketStreamData(m_streamHandle, buffer.data(), readSize);
     }
 
     ISOCKET_Readable(m_socket.get(), socketReadableCallback, this);
@@ -166,7 +166,7 @@ void SocketStreamHandlePrivate::socketClosed()
         SocketStreamHandle* streamHandle = m_streamHandle;
         m_streamHandle = 0;
         // This following call deletes _this_. Nothing should be after it.
-        streamHandle->client()->didClose(streamHandle);
+        streamHandle->client()->didCloseSocketStream(streamHandle);
     }
 }
 
@@ -177,7 +177,7 @@ void SocketStreamHandlePrivate::socketError(int error)
         SocketStreamHandle* streamHandle = m_streamHandle;
         m_streamHandle = 0;
         // This following call deletes _this_. Nothing should be after it.
-        streamHandle->client()->didClose(streamHandle);
+        streamHandle->client()->didCloseSocketStream(streamHandle);
     }
 }
 
index 5bdc1a6..a358832 100644 (file)
@@ -329,7 +329,7 @@ void SocketStreamHandle::addCONNECTCredentials(CFHTTPMessageRef proxyResponse)
 
     if (!CFHTTPAuthenticationRequiresUserNameAndPassword(authentication.get())) {
         // That's all we can offer...
-        m_client->didFail(this, SocketStreamError()); // FIXME: Provide a sensible error.
+        m_client->didFailSocketStream(this, SocketStreamError()); // FIXME: Provide a sensible error.
         return;
     }
 
@@ -354,7 +354,7 @@ void SocketStreamHandle::addCONNECTCredentials(CFHTTPMessageRef proxyResponse)
 
         if (!proxyAuthorizationString) {
             // Fails e.g. for NTLM auth.
-            m_client->didFail(this, SocketStreamError()); // FIXME: Provide a sensible error.
+            m_client->didFailSocketStream(this, SocketStreamError()); // FIXME: Provide a sensible error.
             return;
         }
 
@@ -366,7 +366,7 @@ void SocketStreamHandle::addCONNECTCredentials(CFHTTPMessageRef proxyResponse)
 
     // FIXME: Ask the client if credentials could not be found.
 
-    m_client->didFail(this, SocketStreamError()); // FIXME: Provide a sensible error.
+    m_client->didFailSocketStream(this, SocketStreamError()); // FIXME: Provide a sensible error.
 }
 
 CFStringRef SocketStreamHandle::copyCFStreamDescription(void* info)
@@ -445,7 +445,7 @@ void SocketStreamHandle::readStreamCallback(CFStreamEventType type)
             m_state = Open;
 
             RefPtr<SocketStreamHandle> protect(this); // The client can close the handle, potentially removing the last reference.
-            m_client->didOpen(this);
+            m_client->didOpenSocketStream(this);
             if (m_state == Closed)
                 break;
             // Fall through.
@@ -463,7 +463,7 @@ void SocketStreamHandle::readStreamCallback(CFStreamEventType type)
             ptr = localBuffer;
         }
 
-        m_client->didReceiveData(this, reinterpret_cast<const char*>(ptr), length);
+        m_client->didReceiveSocketStreamData(this, reinterpret_cast<const char*>(ptr), length);
 
         break;
     }
@@ -504,7 +504,7 @@ void SocketStreamHandle::writeStreamCallback(CFStreamEventType type)
             m_state = Open;
 
             RefPtr<SocketStreamHandle> protect(this); // The client can close the handle, potentially removing the last reference.
-            m_client->didOpen(this);
+            m_client->didOpenSocketStream(this);
             break;
         }
 
@@ -543,7 +543,7 @@ void SocketStreamHandle::reportErrorToClient(CFErrorRef error)
         description = String(descriptionCF.get());
     }
 
-    m_client->didFail(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()
@@ -571,7 +571,7 @@ void SocketStreamHandle::platformClose()
     ASSERT(!m_readStream == !m_writeStream);
     if (!m_readStream) {
         if (m_connectingSubstate == New || m_connectingSubstate == ExecutingPACFile)
-            m_client->didClose(this);
+            m_client->didCloseSocketStream(this);
         return;
     }
 
@@ -589,7 +589,7 @@ void SocketStreamHandle::platformClose()
     m_readStream = 0;
     m_writeStream = 0;
 
-    m_client->didClose(this);
+    m_client->didCloseSocketStream(this);
 }
 
 void SocketStreamHandle::receivedCredential(const AuthenticationChallenge&, const Credential&)
index 10550ae..2942041 100644 (file)
@@ -83,7 +83,7 @@ void SocketStreamHandlePrivate::socketConnected()
 {
     if (m_streamHandle && m_streamHandle->client()) {
         m_streamHandle->m_state = SocketStreamHandleBase::Open;
-        m_streamHandle->client()->didOpen(m_streamHandle);
+        m_streamHandle->client()->didOpenSocketStream(m_streamHandle);
     }
 }
 
@@ -91,7 +91,7 @@ void SocketStreamHandlePrivate::socketReadyRead()
 {
     if (m_streamHandle && m_streamHandle->client()) {
         QByteArray data = m_socket->read(m_socket->bytesAvailable());
-        m_streamHandle->client()->didReceiveData(m_streamHandle, data.constData(), data.size());
+        m_streamHandle->client()->didReceiveSocketStreamData(m_streamHandle, data.constData(), data.size());
     }
 }
 
@@ -132,7 +132,7 @@ void SocketStreamHandlePrivate::socketClosedCallback()
         SocketStreamHandle* streamHandle = m_streamHandle;
         m_streamHandle = 0;
         // This following call deletes _this_. Nothing should be after it.
-        streamHandle->client()->didClose(streamHandle);
+        streamHandle->client()->didCloseSocketStream(streamHandle);
     }
 }
 
@@ -143,7 +143,7 @@ void SocketStreamHandlePrivate::socketErrorCallback(int error)
         SocketStreamHandle* streamHandle = m_streamHandle;
         m_streamHandle = 0;
         // This following call deletes _this_. Nothing should be after it.
-        streamHandle->client()->didClose(streamHandle);
+        streamHandle->client()->didCloseSocketStream(streamHandle);
     }
 }
 
index 1f9d4e8..c52eff4 100644 (file)
@@ -102,7 +102,7 @@ SocketStreamHandle::~SocketStreamHandle()
 void SocketStreamHandle::connected(GSocketConnection* socketConnection, GError* error)
 {
     if (error) {
-        m_client->didFail(this, SocketStreamError(error->code));
+        m_client->didFailSocketStream(this, SocketStreamError(error->code));
         return;
     }
 
@@ -117,7 +117,7 @@ void SocketStreamHandle::connected(GSocketConnection* socketConnection, GError*
     // The client can close the handle, potentially removing the last reference.
     RefPtr<SocketStreamHandle> protect(this); 
     m_state = Open;
-    m_client->didOpen(this);
+    m_client->didOpenSocketStream(this);
     if (!m_socketConnection) // Client closed the connection.
         return;
 }
@@ -125,7 +125,7 @@ void SocketStreamHandle::connected(GSocketConnection* socketConnection, GError*
 void SocketStreamHandle::readBytes(signed long bytesRead, GError* error)
 {
     if (error) {
-        m_client->didFail(this, SocketStreamError(error->code));
+        m_client->didFailSocketStream(this, SocketStreamError(error->code));
         return;
     }
 
@@ -136,7 +136,7 @@ void SocketStreamHandle::readBytes(signed long bytesRead, GError* error)
 
     // The client can close the handle, potentially removing the last reference.
     RefPtr<SocketStreamHandle> protect(this); 
-    m_client->didReceiveData(this, m_readBuffer, bytesRead);
+    m_client->didReceiveSocketStreamData(this, m_readBuffer, bytesRead);
     if (m_inputStream) // The client may have closed the connection.
         g_input_stream_read_async(m_inputStream.get(), m_readBuffer, READ_BUFFER_SIZE, G_PRIORITY_DEFAULT, 0,
             reinterpret_cast<GAsyncReadyCallback>(readReadyCallback), m_id);
@@ -163,7 +163,7 @@ int SocketStreamHandle::platformSend(const char* data, int length)
     GOwnPtr<GError> error;
     gssize written = g_pollable_output_stream_write_nonblocking(m_outputStream.get(), data, length, 0, &error.outPtr());
     if (error && !g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK)) {
-        m_client->didFail(this, SocketStreamError(error->code)); // FIXME: Provide a sensible error.
+        m_client->didFailSocketStream(this, SocketStreamError(error->code)); // FIXME: Provide a sensible error.
         return 0;
     }
 
@@ -185,7 +185,7 @@ void SocketStreamHandle::platformClose()
         GOwnPtr<GError> error;
         g_io_stream_close(G_IO_STREAM(m_socketConnection.get()), 0, &error.outPtr());
         if (error)
-            m_client->didFail(this, SocketStreamError(error->code)); // FIXME: Provide a sensible error.
+            m_client->didFailSocketStream(this, SocketStreamError(error->code)); // FIXME: Provide a sensible error.
         m_socketConnection = 0;
     }
 
@@ -193,7 +193,7 @@ void SocketStreamHandle::platformClose()
     m_inputStream = 0;
     delete m_readBuffer;
 
-    m_client->didClose(this);
+    m_client->didCloseSocketStream(this);
 }
 
 void SocketStreamHandle::didReceiveAuthenticationChallenge(const AuthenticationChallenge&)
index c1a4074..43e4e32 100644 (file)
@@ -203,9 +203,9 @@ void WebSocketChannel::resume()
         m_resumeTimer.startOneShot(0);
 }
 
-void WebSocketChannel::didOpen(SocketStreamHandle* handle)
+void WebSocketChannel::didOpenSocketStream(SocketStreamHandle* handle)
 {
-    LOG(Network, "WebSocketChannel %p didOpen", this);
+    LOG(Network, "WebSocketChannel %p didOpenSocketStream", this);
     ASSERT(handle == m_handle);
     if (!m_context)
         return;
@@ -216,9 +216,9 @@ void WebSocketChannel::didOpen(SocketStreamHandle* handle)
         fail("Failed to send WebSocket handshake.");
 }
 
-void WebSocketChannel::didClose(SocketStreamHandle* handle)
+void WebSocketChannel::didCloseSocketStream(SocketStreamHandle* handle)
 {
-    LOG(Network, "WebSocketChannel %p didClose", this);
+    LOG(Network, "WebSocketChannel %p didCloseSocketStream", this);
     if (m_identifier && m_context)
         InspectorInstrumentation::didCloseWebSocket(m_context, m_identifier);
     ASSERT_UNUSED(handle, handle == m_handle || !m_handle);
@@ -239,9 +239,9 @@ void WebSocketChannel::didClose(SocketStreamHandle* handle)
     deref();
 }
 
-void WebSocketChannel::didReceiveData(SocketStreamHandle* handle, const char* data, int len)
+void WebSocketChannel::didReceiveSocketStreamData(SocketStreamHandle* handle, const char* data, int len)
 {
-    LOG(Network, "WebSocketChannel %p didReceiveData %d", this, len);
+    LOG(Network, "WebSocketChannel %p didReceiveSocketStreamData %d", this, len);
     RefPtr<WebSocketChannel> protect(this); // The client can close the channel, potentially removing the last reference.
     ASSERT(handle == m_handle);
     if (!m_context) {
@@ -268,9 +268,9 @@ void WebSocketChannel::didReceiveData(SocketStreamHandle* handle, const char* da
             break;
 }
 
-void WebSocketChannel::didFail(SocketStreamHandle* handle, const SocketStreamError& error)
+void WebSocketChannel::didFailSocketStream(SocketStreamHandle* handle, const SocketStreamError& error)
 {
-    LOG(Network, "WebSocketChannel %p didFail", this);
+    LOG(Network, "WebSocketChannel %p didFailSocketStream", this);
     ASSERT(handle == m_handle || !m_handle);
     if (m_context) {
         String message;
@@ -395,7 +395,7 @@ void WebSocketChannel::resumeTimerFired(Timer<WebSocketChannel>* timer)
         if (!processBuffer())
             break;
     if (!m_suspended && m_client && m_closed && m_handle)
-        didClose(m_handle.get());
+        didCloseSocketStream(m_handle.get());
 }
 
 void WebSocketChannel::startClosingHandshake()
index 655b47f..ca34e7e 100644 (file)
@@ -65,10 +65,11 @@ namespace WebCore {
         virtual void suspend();
         virtual void resume();
 
-        virtual void didOpen(SocketStreamHandle*);
-        virtual void didClose(SocketStreamHandle*);
-        virtual void didReceiveData(SocketStreamHandle*, const char*, int);
-        virtual void didFail(SocketStreamHandle*, const SocketStreamError&);
+        // SocketStreamHandleClient functions.
+        virtual void didOpenSocketStream(SocketStreamHandle*);
+        virtual void didCloseSocketStream(SocketStreamHandle*);
+        virtual void didReceiveSocketStreamData(SocketStreamHandle*, const char*, int);
+        virtual void didFailSocketStream(SocketStreamHandle*, const SocketStreamError&);
         virtual void didReceiveAuthenticationChallenge(SocketStreamHandle*, const AuthenticationChallenge&);
         virtual void didCancelAuthenticationChallenge(SocketStreamHandle*, const AuthenticationChallenge&);
 
index 718d4d3..198e076 100644 (file)
@@ -1,3 +1,16 @@
+2011-08-01  Yuta Kitamura  <yutak@chromium.org>
+
+        WebSocket: Rename SocketStreamHandleClient member functions
+        https://bugs.webkit.org/show_bug.cgi?id=65374
+
+        Reviewed by Kent Tamura.
+
+        * src/SocketStreamHandle.cpp:
+        (WebCore::SocketStreamHandleInternal::didOpenStream):
+        (WebCore::SocketStreamHandleInternal::didReceiveData):
+        (WebCore::SocketStreamHandleInternal::didClose):
+        (WebCore::SocketStreamHandleInternal::didFail):
+
 2011-07-31  Bill Budge  <bbudge@chromium.org>
 
         [Chromium] Remove the parameterless WebFrame::createAssociatedURLLoader
index 77545a1..de6b1b8 100644 (file)
@@ -130,7 +130,7 @@ void SocketStreamHandleInternal::didOpenStream(WebSocketStreamHandle* socketHand
         m_maxPendingSendAllowed = maxPendingSendAllowed;
         m_handle->m_state = SocketStreamHandleBase::Open;
         if (m_handle->m_client) {
-            m_handle->m_client->didOpen(m_handle);
+            m_handle->m_client->didOpenSocketStream(m_handle);
             return;
         }
     }
@@ -155,7 +155,7 @@ void SocketStreamHandleInternal::didReceiveData(WebSocketStreamHandle* socketHan
     if (m_handle && m_socket.get()) {
         ASSERT(socketHandle == m_socket.get());
         if (m_handle->m_client)
-            m_handle->m_client->didReceiveData(m_handle, data.data(), data.size());
+            m_handle->m_client->didReceiveSocketStreamData(m_handle, data.data(), data.size());
     }
 }
 
@@ -168,7 +168,7 @@ void SocketStreamHandleInternal::didClose(WebSocketStreamHandle* socketHandle)
         SocketStreamHandle* h = m_handle;
         m_handle = 0;
         if (h->m_client)
-            h->m_client->didClose(h);
+            h->m_client->didCloseSocketStream(h);
     }
 }
 
@@ -181,7 +181,7 @@ void SocketStreamHandleInternal::didFail(WebSocketStreamHandle* socketHandle, co
         SocketStreamHandle* h = m_handle;
         m_handle = 0;
         if (h->m_client)
-            h->m_client->didClose(h);  // didFail(h, err);
+            h->m_client->didCloseSocketStream(h); // didFail(h, err);
     }
 }