Commit 9a646ee6 authored by yhirano@chromium.org's avatar yhirano@chromium.org

Rename NewWebSocketChannelImpl to DocumentWebSocketChannel.

As the new WebSocket implementation is used as default and the old one was
deleted, NewWebSocketChannelImpl is not an appropriate name.

BUG=423201
R=ricea@chromium.org

Review URL: https://codereview.chromium.org/690883002

git-svn-id: svn://svn.chromium.org/blink/trunk@184817 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent cb6cdfe6
...@@ -1008,8 +1008,8 @@ ...@@ -1008,8 +1008,8 @@
'websockets/CloseEvent.h', 'websockets/CloseEvent.h',
'websockets/DOMWebSocket.cpp', 'websockets/DOMWebSocket.cpp',
'websockets/DOMWebSocket.h', 'websockets/DOMWebSocket.h',
'websockets/NewWebSocketChannelImpl.cpp', 'websockets/DocumentWebSocketChannel.cpp',
'websockets/NewWebSocketChannelImpl.h', 'websockets/DocumentWebSocketChannel.h',
'websockets/WebSocketChannel.cpp', 'websockets/WebSocketChannel.cpp',
'websockets/WebSocketChannel.h', 'websockets/WebSocketChannel.h',
'websockets/WebSocketChannelClient.h', 'websockets/WebSocketChannelClient.h',
...@@ -1052,7 +1052,7 @@ ...@@ -1052,7 +1052,7 @@
'serviceworkers/ResponseTest.cpp', 'serviceworkers/ResponseTest.cpp',
'serviceworkers/ServiceWorkerContainerTest.cpp', 'serviceworkers/ServiceWorkerContainerTest.cpp',
'websockets/DOMWebSocketTest.cpp', 'websockets/DOMWebSocketTest.cpp',
'websockets/NewWebSocketChannelImplTest.cpp', 'websockets/DocumentWebSocketChannelTest.cpp',
], ],
}, },
} }
...@@ -28,8 +28,8 @@ ...@@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef NewWebSocketChannelImpl_h #ifndef DocumentWebSocketChannel_h
#define NewWebSocketChannelImpl_h #define DocumentWebSocketChannel_h
#include "core/dom/ContextLifecycleObserver.h" #include "core/dom/ContextLifecycleObserver.h"
#include "core/fileapi/Blob.h" #include "core/fileapi/Blob.h"
...@@ -57,19 +57,20 @@ class WebSocketHandshakeRequest; ...@@ -57,19 +57,20 @@ class WebSocketHandshakeRequest;
class WebSocketHandshakeRequestInfo; class WebSocketHandshakeRequestInfo;
class WebSocketHandshakeResponseInfo; class WebSocketHandshakeResponseInfo;
// This class may replace MainThreadWebSocketChannel. // This class is a WebSocketChannel subclass that works with a Document in a
class NewWebSocketChannelImpl final : public WebSocketChannel, public WebSocketHandleClient, public ContextLifecycleObserver { // DOMWindow (i.e. works in the main thread).
class DocumentWebSocketChannel final : public WebSocketChannel, public WebSocketHandleClient, public ContextLifecycleObserver {
public: public:
// You can specify the source file and the line number information // You can specify the source file and the line number information
// explicitly by passing the last parameter. // explicitly by passing the last parameter.
// In the usual case, they are set automatically and you don't have to // In the usual case, they are set automatically and you don't have to
// pass it. // pass it.
// Specify handle explicitly only in tests. // Specify handle explicitly only in tests.
static NewWebSocketChannelImpl* create(ExecutionContext* context, WebSocketChannelClient* client, const String& sourceURL = String(), unsigned lineNumber = 0, WebSocketHandle *handle = 0) static DocumentWebSocketChannel* create(ExecutionContext* context, WebSocketChannelClient* client, const String& sourceURL = String(), unsigned lineNumber = 0, WebSocketHandle *handle = 0)
{ {
return new NewWebSocketChannelImpl(context, client, sourceURL, lineNumber, handle); return new DocumentWebSocketChannel(context, client, sourceURL, lineNumber, handle);
} }
virtual ~NewWebSocketChannelImpl(); virtual ~DocumentWebSocketChannel();
// WebSocketChannel functions. // WebSocketChannel functions.
virtual bool connect(const KURL&, const String& protocol) override; virtual bool connect(const KURL&, const String& protocol) override;
...@@ -121,7 +122,7 @@ private: ...@@ -121,7 +122,7 @@ private:
class BlobLoader; class BlobLoader;
NewWebSocketChannelImpl(ExecutionContext*, WebSocketChannelClient*, const String&, unsigned, WebSocketHandle*); DocumentWebSocketChannel(ExecutionContext*, WebSocketChannelClient*, const String&, unsigned, WebSocketHandle*);
void sendInternal(); void sendInternal();
void flowControlIfNecessary(); void flowControlIfNecessary();
void failAsError(const String& reason) { fail(reason, ErrorMessageLevel, m_sourceURLAtConstruction, m_lineNumberAtConstruction); } void failAsError(const String& reason) { fail(reason, ErrorMessageLevel, m_sourceURLAtConstruction, m_lineNumberAtConstruction); }
...@@ -187,4 +188,4 @@ private: ...@@ -187,4 +188,4 @@ private:
} // namespace blink } // namespace blink
#endif // NewWebSocketChannelImpl_h #endif // DocumentWebSocketChannel_h
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include "core/inspector/ScriptCallStack.h" #include "core/inspector/ScriptCallStack.h"
#include "core/workers/WorkerGlobalScope.h" #include "core/workers/WorkerGlobalScope.h"
#include "core/workers/WorkerThread.h" #include "core/workers/WorkerThread.h"
#include "modules/websockets/NewWebSocketChannelImpl.h" #include "modules/websockets/DocumentWebSocketChannel.h"
#include "modules/websockets/WebSocketChannelClient.h" #include "modules/websockets/WebSocketChannelClient.h"
#include "modules/websockets/WorkerThreadableWebSocketChannel.h" #include "modules/websockets/WorkerThreadableWebSocketChannel.h"
...@@ -63,7 +63,7 @@ WebSocketChannel* WebSocketChannel::create(ExecutionContext* context, WebSocketC ...@@ -63,7 +63,7 @@ WebSocketChannel* WebSocketChannel::create(ExecutionContext* context, WebSocketC
} }
Document* document = toDocument(context); Document* document = toDocument(context);
return NewWebSocketChannelImpl::create(document, client, sourceURL, lineNumber); return DocumentWebSocketChannel::create(document, client, sourceURL, lineNumber);
} }
} // namespace blink } // namespace blink
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#include "core/workers/WorkerGlobalScope.h" #include "core/workers/WorkerGlobalScope.h"
#include "core/workers/WorkerLoaderProxy.h" #include "core/workers/WorkerLoaderProxy.h"
#include "core/workers/WorkerThread.h" #include "core/workers/WorkerThread.h"
#include "modules/websockets/NewWebSocketChannelImpl.h" #include "modules/websockets/DocumentWebSocketChannel.h"
#include "public/platform/Platform.h" #include "public/platform/Platform.h"
#include "public/platform/WebWaitableEvent.h" #include "public/platform/WebWaitableEvent.h"
#include "wtf/ArrayBuffer.h" #include "wtf/ArrayBuffer.h"
...@@ -201,7 +201,7 @@ void Peer::initializeInternal(ExecutionContext* context, const String& sourceURL ...@@ -201,7 +201,7 @@ void Peer::initializeInternal(ExecutionContext* context, const String& sourceURL
{ {
ASSERT(isMainThread()); ASSERT(isMainThread());
Document* document = toDocument(context); Document* document = toDocument(context);
m_mainWebSocketChannel = NewWebSocketChannelImpl::create(document, this, sourceURL, lineNumber); m_mainWebSocketChannel = DocumentWebSocketChannel::create(document, this, sourceURL, lineNumber);
m_syncHelper->signalWorkerThread(); m_syncHelper->signalWorkerThread();
} }
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#include "core/dom/Document.h" #include "core/dom/Document.h"
#include "core/frame/ConsoleTypes.h" #include "core/frame/ConsoleTypes.h"
#include "modules/websockets/NewWebSocketChannelImpl.h" #include "modules/websockets/DocumentWebSocketChannel.h"
#include "modules/websockets/WebSocketChannel.h" #include "modules/websockets/WebSocketChannel.h"
#include "public/platform/WebArrayBuffer.h" #include "public/platform/WebArrayBuffer.h"
#include "public/platform/WebString.h" #include "public/platform/WebString.h"
...@@ -55,7 +55,7 @@ WebSocketImpl::WebSocketImpl(const WebDocument& document, WebSocketClient* clien ...@@ -55,7 +55,7 @@ WebSocketImpl::WebSocketImpl(const WebDocument& document, WebSocketClient* clien
, m_bufferedAmountAfterClose(0) , m_bufferedAmountAfterClose(0)
{ {
RefPtrWillBeRawPtr<Document> coreDocument = PassRefPtrWillBeRawPtr<Document>(document); RefPtrWillBeRawPtr<Document> coreDocument = PassRefPtrWillBeRawPtr<Document>(document);
m_private = NewWebSocketChannelImpl::create(coreDocument.get(), m_channelProxy.get()); m_private = DocumentWebSocketChannel::create(coreDocument.get(), m_channelProxy.get());
} }
WebSocketImpl::~WebSocketImpl() WebSocketImpl::~WebSocketImpl()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment