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

Unified Diff: Source/modules/websockets/NewWebSocketChannelImpl.h

Issue 23464050: Implement suspend / resume in NewWebSocketChannelImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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 | « no previous file | Source/modules/websockets/NewWebSocketChannelImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/websockets/NewWebSocketChannelImpl.h
diff --git a/Source/modules/websockets/NewWebSocketChannelImpl.h b/Source/modules/websockets/NewWebSocketChannelImpl.h
index a68b998cd3a76236164a1577b21412b93f163acb..cb5ccaefd82c37d6bcffb3fe9be452fa0f071ef8 100644
--- a/Source/modules/websockets/NewWebSocketChannelImpl.h
+++ b/Source/modules/websockets/NewWebSocketChannelImpl.h
@@ -87,12 +87,19 @@ public:
virtual void suspend() OVERRIDE;
virtual void resume() OVERRIDE;
+ void handleDidConnect();
+ void handleTextMessage(Vector<char>*);
+ void handleBinaryMessage(Vector<char>*);
+ void handleDidReceiveMessageError();
+ void handleDidClose(unsigned short code, const String& reason);
+
private:
enum MessageType {
MessageTypeText,
MessageTypeBlob,
MessageTypeArrayBuffer,
};
+
struct Message {
explicit Message(const String&);
explicit Message(const Blob&);
@@ -107,7 +114,9 @@ private:
bool isMessageText;
Vector<char> data;
};
+
class BlobLoader;
+ class Resumer;
NewWebSocketChannelImpl(ScriptExecutionContext*, WebSocketChannelClient*, const String&, unsigned);
void sendInternal();
@@ -121,10 +130,6 @@ private:
virtual void didClose(WebKit::WebSocketHandle*, unsigned short code, const WebKit::WebString& reason) OVERRIDE;
virtual void didReceiveFlowControl(WebKit::WebSocketHandle*, int64_t quota) OVERRIDE { m_sendingQuota += quota; }
- void handleTextMessage(Vector<char>*);
- void handleBinaryMessage(Vector<char>*);
- void handleDidClose(unsigned short code, const String& reason);
-
// Methods for BlobLoader.
void didFinishLoadingBlob(PassRefPtr<ArrayBuffer>);
void didFailLoadingBlob(FileError::ErrorCode);
@@ -146,6 +151,8 @@ private:
WebSocketChannelClient* m_client;
KURL m_url;
OwnPtr<BlobLoader> m_blobLoader;
+ OwnPtr<Resumer> m_resumer;
+ bool m_isSuspended;
Deque<Message> m_messages;
Vector<char> m_receivingMessageData;
« no previous file with comments | « no previous file | Source/modules/websockets/NewWebSocketChannelImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698