Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1455)

Unified Diff: Source/web/WebSocketImpl.cpp

Issue 419973007: Decouple WebSocketChannelClient from WebSocketImpl (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/WebSocketImpl.h ('k') | Source/web/web.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebSocketImpl.cpp
diff --git a/Source/web/WebSocketImpl.cpp b/Source/web/WebSocketImpl.cpp
index ba573540a48967f577296d54eec7ee67fd8c4d54..d78b69964e511fd4b2981b35042615f68d9287b4 100644
--- a/Source/web/WebSocketImpl.cpp
+++ b/Source/web/WebSocketImpl.cpp
@@ -41,6 +41,7 @@
#include "public/platform/WebString.h"
#include "public/platform/WebURL.h"
#include "public/web/WebDocument.h"
+#include "web/WebSocketChannelClientProxy.h"
#include "wtf/ArrayBuffer.h"
#include "wtf/text/CString.h"
#include "wtf/text/WTFString.h"
@@ -51,6 +52,7 @@ namespace blink {
WebSocketImpl::WebSocketImpl(const WebDocument& document, WebSocketClient* client)
: m_client(client)
+ , m_channelProxy(WebSocketChannelClientProxy::create(this))
, m_binaryType(BinaryTypeBlob)
, m_isClosingOrClosed(false)
, m_bufferedAmount(0)
@@ -58,17 +60,15 @@ WebSocketImpl::WebSocketImpl(const WebDocument& document, WebSocketClient* clien
{
RefPtrWillBeRawPtr<Document> coreDocument = PassRefPtrWillBeRawPtr<Document>(document);
if (RuntimeEnabledFeatures::experimentalWebSocketEnabled()) {
- m_private = NewWebSocketChannelImpl::create(coreDocument.get(), this);
+ m_private = NewWebSocketChannelImpl::create(coreDocument.get(), m_channelProxy.get());
} else {
- m_private = MainThreadWebSocketChannel::create(coreDocument.get(), this);
+ m_private = MainThreadWebSocketChannel::create(coreDocument.get(), m_channelProxy.get());
}
}
WebSocketImpl::~WebSocketImpl()
{
-#if !ENABLE(OILPAN)
m_private->disconnect();
-#endif
}
WebSocket::BinaryType WebSocketImpl::binaryType() const
@@ -201,7 +201,7 @@ void WebSocketImpl::didStartClosingHandshake()
m_client->didStartClosingHandshake();
}
-void WebSocketImpl::didClose(ClosingHandshakeCompletionStatus status, unsigned short code, const String& reason)
+void WebSocketImpl::didClose(WebSocketChannelClient::ClosingHandshakeCompletionStatus status, unsigned short code, const String& reason)
{
m_isClosingOrClosed = true;
m_client->didClose(static_cast<WebSocketClient::ClosingHandshakeCompletionStatus>(status), code, WebString(reason));
@@ -210,10 +210,4 @@ void WebSocketImpl::didClose(ClosingHandshakeCompletionStatus status, unsigned s
m_client->didClose(m_bufferedAmount - m_bufferedAmountAfterClose, static_cast<WebSocketClient::ClosingHandshakeCompletionStatus>(status), code, WebString(reason));
}
-void WebSocketImpl::trace(blink::Visitor* visitor)
-{
- visitor->trace(m_private);
- blink::WebSocketChannelClient::trace(visitor);
-}
-
} // namespace blink
« no previous file with comments | « Source/web/WebSocketImpl.h ('k') | Source/web/web.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698