| Index: third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
|
| diff --git a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
|
| index 8e05203c6db3420ae5db4a626b47a00e54eb2e28..d779151e0ce0faff1954ec10d93a527708c93b0f 100644
|
| --- a/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
|
| +++ b/third_party/WebKit/Source/modules/websockets/DocumentWebSocketChannel.h
|
| @@ -33,7 +33,6 @@
|
|
|
| #include <stdint.h>
|
| #include <memory>
|
| -#include <utility>
|
| #include "bindings/core/v8/SourceLocation.h"
|
| #include "core/fileapi/Blob.h"
|
| #include "core/fileapi/FileError.h"
|
| @@ -51,43 +50,40 @@
|
| #include "platform/wtf/Vector.h"
|
| #include "platform/wtf/text/CString.h"
|
| #include "platform/wtf/text/WTFString.h"
|
| -#include "public/platform/WebCallbacks.h"
|
|
|
| namespace blink {
|
|
|
| class ThreadableLoadingContext;
|
| class WebSocketHandshakeRequest;
|
| -class WebSocketHandshakeThrottle;
|
|
|
| // This class is a WebSocketChannel subclass that works with a Document in a
|
| // DOMWindow (i.e. works in the main thread).
|
| class MODULES_EXPORT DocumentWebSocketChannel final
|
| : public WebSocketChannel,
|
| - public WebSocketHandleClient,
|
| - public WebCallbacks<void, const WebString&> {
|
| + public WebSocketHandleClient {
|
| 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 DocumentWebSocketChannel* Create(
|
| Document* document,
|
| WebSocketChannelClient* client,
|
| - std::unique_ptr<SourceLocation> location) {
|
| + std::unique_ptr<SourceLocation> location,
|
| + WebSocketHandle* handle = 0) {
|
| DCHECK(document);
|
| return Create(ThreadableLoadingContext::Create(*document), client,
|
| - std::move(location));
|
| + std::move(location), handle);
|
| }
|
| - static DocumentWebSocketChannel* Create(ThreadableLoadingContext*,
|
| - WebSocketChannelClient*,
|
| - std::unique_ptr<SourceLocation>);
|
| - static DocumentWebSocketChannel* CreateForTesting(
|
| - Document*,
|
| - WebSocketChannelClient*,
|
| - std::unique_ptr<SourceLocation>,
|
| - WebSocketHandle*,
|
| - std::unique_ptr<WebSocketHandshakeThrottle>);
|
| -
|
| + static DocumentWebSocketChannel* Create(
|
| + ThreadableLoadingContext* loading_context,
|
| + WebSocketChannelClient* client,
|
| + std::unique_ptr<SourceLocation> location,
|
| + WebSocketHandle* handle = 0) {
|
| + return new DocumentWebSocketChannel(loading_context, client,
|
| + std::move(location), handle);
|
| + }
|
| ~DocumentWebSocketChannel() override;
|
|
|
| // WebSocketChannel functions.
|
| @@ -112,7 +108,6 @@
|
| private:
|
| class BlobLoader;
|
| class Message;
|
| - struct ConnectInfo;
|
|
|
| enum MessageType {
|
| kMessageTypeText,
|
| @@ -131,9 +126,7 @@
|
| DocumentWebSocketChannel(ThreadableLoadingContext*,
|
| WebSocketChannelClient*,
|
| std::unique_ptr<SourceLocation>,
|
| - std::unique_ptr<WebSocketHandle>,
|
| - std::unique_ptr<WebSocketHandshakeThrottle>);
|
| -
|
| + WebSocketHandle*);
|
| void SendInternal(WebSocketHandle::MessageType,
|
| const char* data,
|
| size_t total_size,
|
| @@ -174,11 +167,6 @@
|
| void DidReceiveFlowControl(WebSocketHandle*, int64_t quota) override;
|
| void DidStartClosingHandshake(WebSocketHandle*) override;
|
|
|
| - // WebCallbacks<void, const WebString&> functions. These are called with the
|
| - // results of throttling.
|
| - void OnSuccess() override;
|
| - void OnError(const WebString& console_message) override;
|
| -
|
| // Methods for BlobLoader.
|
| void DidFinishLoadingBlob(DOMArrayBuffer*);
|
| void DidFailLoadingBlob(FileError::ErrorCode);
|
| @@ -210,11 +198,6 @@
|
|
|
| std::unique_ptr<SourceLocation> location_at_construction_;
|
| RefPtr<WebSocketHandshakeRequest> handshake_request_;
|
| - std::unique_ptr<WebSocketHandshakeThrottle> handshake_throttle_;
|
| - // This field is only initialised if the object is still waiting for a
|
| - // throttle response when DidConnect is called.
|
| - std::unique_ptr<ConnectInfo> connect_info_;
|
| - bool throttle_passed_;
|
|
|
| static const uint64_t kReceivedDataSizeForFlowControlHighWaterMark = 1 << 15;
|
| };
|
|
|