OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 String subprotocol() const; | 54 String subprotocol() const; |
55 void setSubprotocol(const String&); | 55 void setSubprotocol(const String&); |
56 String extensions() const; | 56 String extensions() const; |
57 void setExtensions(const String&); | 57 void setExtensions(const String&); |
58 | 58 |
59 void clearClient(); | 59 void clearClient(); |
60 | 60 |
61 void didConnect(); | 61 void didConnect(); |
62 void didReceiveMessage(const String& message); | 62 void didReceiveMessage(const String& message); |
63 void didReceiveBinaryData(PassOwnPtr<Vector<char> >); | 63 void didReceiveBinaryData(PassOwnPtr<Vector<char> >); |
64 void didUpdateBufferedAmount(unsigned long bufferedAmount); | 64 void didConsumeBufferedAmount(unsigned long); |
65 void didStartClosingHandshake(); | 65 void didStartClosingHandshake(); |
66 void didClose(unsigned long unhandledBufferedAmount, WebSocketChannelClient:
:ClosingHandshakeCompletionStatus, unsigned short code, const String& reason); | 66 void didClose(WebSocketChannelClient::ClosingHandshakeCompletionStatus, unsi
gned short code, const String& reason); |
67 void didReceiveMessageError(); | 67 void didReceiveMessageError(); |
68 | 68 |
69 void suspend(); | 69 void suspend(); |
70 void resume(); | 70 void resume(); |
71 | 71 |
72 void trace(Visitor*) { } | 72 void trace(Visitor*) { } |
73 | 73 |
74 private: | 74 private: |
75 ThreadableWebSocketChannelClientWrapper(WebSocketChannelClient*); | 75 ThreadableWebSocketChannelClientWrapper(WebSocketChannelClient*); |
76 | 76 |
77 void processPendingTasks(); | 77 void processPendingTasks(); |
78 | 78 |
79 static void didConnectCallback(ExecutionContext*, PassRefPtrWillBeRawPtr<Thr
eadableWebSocketChannelClientWrapper>); | 79 static void didConnectCallback(ExecutionContext*, PassRefPtrWillBeRawPtr<Thr
eadableWebSocketChannelClientWrapper>); |
80 static void didReceiveMessageCallback(ExecutionContext*, PassRefPtrWillBeRaw
Ptr<ThreadableWebSocketChannelClientWrapper>, const String& message); | 80 static void didReceiveMessageCallback(ExecutionContext*, PassRefPtrWillBeRaw
Ptr<ThreadableWebSocketChannelClientWrapper>, const String& message); |
81 static void didReceiveBinaryDataCallback(ExecutionContext*, PassRefPtrWillBe
RawPtr<ThreadableWebSocketChannelClientWrapper>, PassOwnPtr<Vector<char> >); | 81 static void didReceiveBinaryDataCallback(ExecutionContext*, PassRefPtrWillBe
RawPtr<ThreadableWebSocketChannelClientWrapper>, PassOwnPtr<Vector<char> >); |
82 static void didUpdateBufferedAmountCallback(ExecutionContext*, PassRefPtrWil
lBeRawPtr<ThreadableWebSocketChannelClientWrapper>, unsigned long bufferedAmount
); | 82 static void didConsumeBufferedAmountCallback(ExecutionContext*, PassRefPtrWi
llBeRawPtr<ThreadableWebSocketChannelClientWrapper>, unsigned long); |
83 static void didStartClosingHandshakeCallback(ExecutionContext*, PassRefPtrWi
llBeRawPtr<ThreadableWebSocketChannelClientWrapper>); | 83 static void didStartClosingHandshakeCallback(ExecutionContext*, PassRefPtrWi
llBeRawPtr<ThreadableWebSocketChannelClientWrapper>); |
84 static void didCloseCallback(ExecutionContext*, PassRefPtrWillBeRawPtr<Threa
dableWebSocketChannelClientWrapper>, unsigned long unhandledBufferedAmount, WebS
ocketChannelClient::ClosingHandshakeCompletionStatus, unsigned short code, const
String& reason); | 84 static void didCloseCallback(ExecutionContext*, PassRefPtrWillBeRawPtr<Threa
dableWebSocketChannelClientWrapper>, WebSocketChannelClient::ClosingHandshakeCom
pletionStatus, unsigned short code, const String& reason); |
85 static void didReceiveMessageErrorCallback(ExecutionContext*, PassRefPtrWill
BeRawPtr<ThreadableWebSocketChannelClientWrapper>); | 85 static void didReceiveMessageErrorCallback(ExecutionContext*, PassRefPtrWill
BeRawPtr<ThreadableWebSocketChannelClientWrapper>); |
86 | 86 |
87 WebSocketChannelClient* m_client; | 87 WebSocketChannelClient* m_client; |
88 // ThreadSafeRefCounted must not have String member variables. | 88 // ThreadSafeRefCounted must not have String member variables. |
89 Vector<UChar> m_subprotocol; | 89 Vector<UChar> m_subprotocol; |
90 Vector<UChar> m_extensions; | 90 Vector<UChar> m_extensions; |
91 bool m_suspended; | 91 bool m_suspended; |
92 Vector<OwnPtr<ExecutionContextTask> > m_pendingTasks; | 92 Vector<OwnPtr<ExecutionContextTask> > m_pendingTasks; |
93 }; | 93 }; |
94 | 94 |
95 } // namespace WebCore | 95 } // namespace WebCore |
96 | 96 |
97 #endif // ThreadableWebSocketChannelClientWrapper_h | 97 #endif // ThreadableWebSocketChannelClientWrapper_h |
OLD | NEW |