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 @@
'websockets/CloseEvent.h',
'websockets/DOMWebSocket.cpp',
'websockets/DOMWebSocket.h',
'websockets/NewWebSocketChannelImpl.cpp',
'websockets/NewWebSocketChannelImpl.h',
'websockets/DocumentWebSocketChannel.cpp',
'websockets/DocumentWebSocketChannel.h',
'websockets/WebSocketChannel.cpp',
'websockets/WebSocketChannel.h',
'websockets/WebSocketChannelClient.h',
......@@ -1052,7 +1052,7 @@
'serviceworkers/ResponseTest.cpp',
'serviceworkers/ServiceWorkerContainerTest.cpp',
'websockets/DOMWebSocketTest.cpp',
'websockets/NewWebSocketChannelImplTest.cpp',
'websockets/DocumentWebSocketChannelTest.cpp',
],
},
}
......@@ -28,8 +28,8 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NewWebSocketChannelImpl_h
#define NewWebSocketChannelImpl_h
#ifndef DocumentWebSocketChannel_h
#define DocumentWebSocketChannel_h
#include "core/dom/ContextLifecycleObserver.h"
#include "core/fileapi/Blob.h"
......@@ -57,19 +57,20 @@ class WebSocketHandshakeRequest;
class WebSocketHandshakeRequestInfo;
class WebSocketHandshakeResponseInfo;
// This class may replace MainThreadWebSocketChannel.
class NewWebSocketChannelImpl final : public WebSocketChannel, public WebSocketHandleClient, public ContextLifecycleObserver {
// This class is a WebSocketChannel subclass that works with a Document in a
// DOMWindow (i.e. works in the main thread).
class DocumentWebSocketChannel final : public WebSocketChannel, public WebSocketHandleClient, public ContextLifecycleObserver {
public:
// You can specify the source file and the line number information
// explicitly by passing the last parameter.
// In the usual case, they are set automatically and you don't have to
// pass it.
// 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.
virtual bool connect(const KURL&, const String& protocol) override;
......@@ -121,7 +122,7 @@ private:
class BlobLoader;
NewWebSocketChannelImpl(ExecutionContext*, WebSocketChannelClient*, const String&, unsigned, WebSocketHandle*);
DocumentWebSocketChannel(ExecutionContext*, WebSocketChannelClient*, const String&, unsigned, WebSocketHandle*);
void sendInternal();
void flowControlIfNecessary();
void failAsError(const String& reason) { fail(reason, ErrorMessageLevel, m_sourceURLAtConstruction, m_lineNumberAtConstruction); }
......@@ -187,4 +188,4 @@ private:
} // namespace blink
#endif // NewWebSocketChannelImpl_h
#endif // DocumentWebSocketChannel_h
......@@ -38,7 +38,7 @@
#include "core/inspector/ScriptCallStack.h"
#include "core/workers/WorkerGlobalScope.h"
#include "core/workers/WorkerThread.h"
#include "modules/websockets/NewWebSocketChannelImpl.h"
#include "modules/websockets/DocumentWebSocketChannel.h"
#include "modules/websockets/WebSocketChannelClient.h"
#include "modules/websockets/WorkerThreadableWebSocketChannel.h"
......@@ -63,7 +63,7 @@ WebSocketChannel* WebSocketChannel::create(ExecutionContext* context, WebSocketC
}
Document* document = toDocument(context);
return NewWebSocketChannelImpl::create(document, client, sourceURL, lineNumber);
return DocumentWebSocketChannel::create(document, client, sourceURL, lineNumber);
}
} // namespace blink
......@@ -43,7 +43,7 @@
#include "core/workers/WorkerGlobalScope.h"
#include "core/workers/WorkerLoaderProxy.h"
#include "core/workers/WorkerThread.h"
#include "modules/websockets/NewWebSocketChannelImpl.h"
#include "modules/websockets/DocumentWebSocketChannel.h"
#include "public/platform/Platform.h"
#include "public/platform/WebWaitableEvent.h"
#include "wtf/ArrayBuffer.h"
......@@ -201,7 +201,7 @@ void Peer::initializeInternal(ExecutionContext* context, const String& sourceURL
{
ASSERT(isMainThread());
Document* document = toDocument(context);
m_mainWebSocketChannel = NewWebSocketChannelImpl::create(document, this, sourceURL, lineNumber);
m_mainWebSocketChannel = DocumentWebSocketChannel::create(document, this, sourceURL, lineNumber);
m_syncHelper->signalWorkerThread();
}
......
......@@ -33,7 +33,7 @@
#include "core/dom/Document.h"
#include "core/frame/ConsoleTypes.h"
#include "modules/websockets/NewWebSocketChannelImpl.h"
#include "modules/websockets/DocumentWebSocketChannel.h"
#include "modules/websockets/WebSocketChannel.h"
#include "public/platform/WebArrayBuffer.h"
#include "public/platform/WebString.h"
......@@ -55,7 +55,7 @@ WebSocketImpl::WebSocketImpl(const WebDocument& document, WebSocketClient* clien
, m_bufferedAmountAfterClose(0)
{
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()
......
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