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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 processPendingTasks(); | 99 processPendingTasks(); |
100 } | 100 } |
101 | 101 |
102 void ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData(PassOwnPtr<Ve
ctor<char> > binaryData) | 102 void ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData(PassOwnPtr<Ve
ctor<char> > binaryData) |
103 { | 103 { |
104 m_pendingTasks.append(createCallbackTask(&didReceiveBinaryDataCallback, this
, binaryData)); | 104 m_pendingTasks.append(createCallbackTask(&didReceiveBinaryDataCallback, this
, binaryData)); |
105 if (!m_suspended) | 105 if (!m_suspended) |
106 processPendingTasks(); | 106 processPendingTasks(); |
107 } | 107 } |
108 | 108 |
109 void ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmount(unsigned l
ong bufferedAmount) | 109 void ThreadableWebSocketChannelClientWrapper::didConsumeBufferedAmount(unsigned
long consumed) |
110 { | 110 { |
111 m_pendingTasks.append(createCallbackTask(&didUpdateBufferedAmountCallback, t
his, bufferedAmount)); | 111 m_pendingTasks.append(createCallbackTask(&didConsumeBufferedAmountCallback,
this, consumed)); |
112 if (!m_suspended) | 112 if (!m_suspended) |
113 processPendingTasks(); | 113 processPendingTasks(); |
114 } | 114 } |
115 | 115 |
116 void ThreadableWebSocketChannelClientWrapper::didStartClosingHandshake() | 116 void ThreadableWebSocketChannelClientWrapper::didStartClosingHandshake() |
117 { | 117 { |
118 m_pendingTasks.append(createCallbackTask(&didStartClosingHandshakeCallback,
this)); | 118 m_pendingTasks.append(createCallbackTask(&didStartClosingHandshakeCallback,
this)); |
119 if (!m_suspended) | 119 if (!m_suspended) |
120 processPendingTasks(); | 120 processPendingTasks(); |
121 } | 121 } |
122 | 122 |
123 void ThreadableWebSocketChannelClientWrapper::didClose(unsigned long unhandledBu
fferedAmount, WebSocketChannelClient::ClosingHandshakeCompletionStatus closingHa
ndshakeCompletion, unsigned short code, const String& reason) | 123 void ThreadableWebSocketChannelClientWrapper::didClose(WebSocketChannelClient::C
losingHandshakeCompletionStatus closingHandshakeCompletion, unsigned short code,
const String& reason) |
124 { | 124 { |
125 m_pendingTasks.append(createCallbackTask(&didCloseCallback, this, unhandledB
ufferedAmount, closingHandshakeCompletion, code, reason)); | 125 m_pendingTasks.append(createCallbackTask(&didCloseCallback, this, closingHan
dshakeCompletion, code, reason)); |
126 if (!m_suspended) | 126 if (!m_suspended) |
127 processPendingTasks(); | 127 processPendingTasks(); |
128 } | 128 } |
129 | 129 |
130 void ThreadableWebSocketChannelClientWrapper::didReceiveMessageError() | 130 void ThreadableWebSocketChannelClientWrapper::didReceiveMessageError() |
131 { | 131 { |
132 m_pendingTasks.append(createCallbackTask(&didReceiveMessageErrorCallback, th
is)); | 132 m_pendingTasks.append(createCallbackTask(&didReceiveMessageErrorCallback, th
is)); |
133 if (!m_suspended) | 133 if (!m_suspended) |
134 processPendingTasks(); | 134 processPendingTasks(); |
135 } | 135 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 wrapper->m_client->didReceiveMessage(message); | 169 wrapper->m_client->didReceiveMessage(message); |
170 } | 170 } |
171 | 171 |
172 void ThreadableWebSocketChannelClientWrapper::didReceiveBinaryDataCallback(Execu
tionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClientWra
pper> wrapper, PassOwnPtr<Vector<char> > binaryData) | 172 void ThreadableWebSocketChannelClientWrapper::didReceiveBinaryDataCallback(Execu
tionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClientWra
pper> wrapper, PassOwnPtr<Vector<char> > binaryData) |
173 { | 173 { |
174 ASSERT_UNUSED(context, !context); | 174 ASSERT_UNUSED(context, !context); |
175 if (wrapper->m_client) | 175 if (wrapper->m_client) |
176 wrapper->m_client->didReceiveBinaryData(binaryData); | 176 wrapper->m_client->didReceiveBinaryData(binaryData); |
177 } | 177 } |
178 | 178 |
179 void ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmountCallback(Ex
ecutionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClient
Wrapper> wrapper, unsigned long bufferedAmount) | 179 void ThreadableWebSocketChannelClientWrapper::didConsumeBufferedAmountCallback(E
xecutionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClien
tWrapper> wrapper, unsigned long consumed) |
180 { | 180 { |
181 ASSERT_UNUSED(context, !context); | 181 ASSERT_UNUSED(context, !context); |
182 if (wrapper->m_client) | 182 if (wrapper->m_client) |
183 wrapper->m_client->didUpdateBufferedAmount(bufferedAmount); | 183 wrapper->m_client->didConsumeBufferedAmount(consumed); |
184 } | 184 } |
185 | 185 |
186 void ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback(E
xecutionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClien
tWrapper> wrapper) | 186 void ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback(E
xecutionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClien
tWrapper> wrapper) |
187 { | 187 { |
188 ASSERT_UNUSED(context, !context); | 188 ASSERT_UNUSED(context, !context); |
189 if (wrapper->m_client) | 189 if (wrapper->m_client) |
190 wrapper->m_client->didStartClosingHandshake(); | 190 wrapper->m_client->didStartClosingHandshake(); |
191 } | 191 } |
192 | 192 |
193 void ThreadableWebSocketChannelClientWrapper::didCloseCallback(ExecutionContext*
context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClientWrapper> wrappe
r, unsigned long unhandledBufferedAmount, WebSocketChannelClient::ClosingHandsha
keCompletionStatus closingHandshakeCompletion, unsigned short code, const String
& reason) | 193 void ThreadableWebSocketChannelClientWrapper::didCloseCallback(ExecutionContext*
context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClientWrapper> wrappe
r, WebSocketChannelClient::ClosingHandshakeCompletionStatus closingHandshakeComp
letion, unsigned short code, const String& reason) |
194 { | 194 { |
195 ASSERT_UNUSED(context, !context); | 195 ASSERT_UNUSED(context, !context); |
196 if (wrapper->m_client) | 196 if (wrapper->m_client) |
197 wrapper->m_client->didClose(unhandledBufferedAmount, closingHandshakeCom
pletion, code, reason); | 197 wrapper->m_client->didClose(closingHandshakeCompletion, code, reason); |
198 } | 198 } |
199 | 199 |
200 void ThreadableWebSocketChannelClientWrapper::didReceiveMessageErrorCallback(Exe
cutionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClientW
rapper> wrapper) | 200 void ThreadableWebSocketChannelClientWrapper::didReceiveMessageErrorCallback(Exe
cutionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClientW
rapper> wrapper) |
201 { | 201 { |
202 ASSERT_UNUSED(context, !context); | 202 ASSERT_UNUSED(context, !context); |
203 if (wrapper->m_client) | 203 if (wrapper->m_client) |
204 wrapper->m_client->didReceiveMessageError(); | 204 wrapper->m_client->didReceiveMessageError(); |
205 } | 205 } |
206 | 206 |
207 } // namespace WebCore | 207 } // namespace WebCore |
OLD | NEW |