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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 processPendingTasks(); | 73 processPendingTasks(); |
74 } | 74 } |
75 | 75 |
76 void ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData(PassOwnPtr<Ve
ctor<char> > binaryData) | 76 void ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData(PassOwnPtr<Ve
ctor<char> > binaryData) |
77 { | 77 { |
78 m_pendingTasks.append(createCallbackTask(&didReceiveBinaryDataCallback, this
, binaryData)); | 78 m_pendingTasks.append(createCallbackTask(&didReceiveBinaryDataCallback, this
, binaryData)); |
79 if (!m_suspended) | 79 if (!m_suspended) |
80 processPendingTasks(); | 80 processPendingTasks(); |
81 } | 81 } |
82 | 82 |
83 void ThreadableWebSocketChannelClientWrapper::didConsumeBufferedAmount(unsigned
long consumed) | 83 void ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmount(unsigned l
ong bufferedAmount) |
84 { | 84 { |
85 m_pendingTasks.append(createCallbackTask(&didConsumeBufferedAmountCallback,
this, consumed)); | 85 m_pendingTasks.append(createCallbackTask(&didUpdateBufferedAmountCallback, t
his, bufferedAmount)); |
86 if (!m_suspended) | 86 if (!m_suspended) |
87 processPendingTasks(); | 87 processPendingTasks(); |
88 } | 88 } |
89 | 89 |
90 void ThreadableWebSocketChannelClientWrapper::didStartClosingHandshake() | 90 void ThreadableWebSocketChannelClientWrapper::didStartClosingHandshake() |
91 { | 91 { |
92 m_pendingTasks.append(createCallbackTask(&didStartClosingHandshakeCallback,
this)); | 92 m_pendingTasks.append(createCallbackTask(&didStartClosingHandshakeCallback,
this)); |
93 if (!m_suspended) | 93 if (!m_suspended) |
94 processPendingTasks(); | 94 processPendingTasks(); |
95 } | 95 } |
96 | 96 |
97 void ThreadableWebSocketChannelClientWrapper::didClose(WebSocketChannelClient::C
losingHandshakeCompletionStatus closingHandshakeCompletion, unsigned short code,
const String& reason) | 97 void ThreadableWebSocketChannelClientWrapper::didClose(unsigned long unhandledBu
fferedAmount, WebSocketChannelClient::ClosingHandshakeCompletionStatus closingHa
ndshakeCompletion, unsigned short code, const String& reason) |
98 { | 98 { |
99 m_pendingTasks.append(createCallbackTask(&didCloseCallback, this, closingHan
dshakeCompletion, code, reason)); | 99 m_pendingTasks.append(createCallbackTask(&didCloseCallback, this, unhandledB
ufferedAmount, closingHandshakeCompletion, code, reason)); |
100 if (!m_suspended) | 100 if (!m_suspended) |
101 processPendingTasks(); | 101 processPendingTasks(); |
102 } | 102 } |
103 | 103 |
104 void ThreadableWebSocketChannelClientWrapper::didReceiveMessageError() | 104 void ThreadableWebSocketChannelClientWrapper::didReceiveMessageError() |
105 { | 105 { |
106 m_pendingTasks.append(createCallbackTask(&didReceiveMessageErrorCallback, th
is)); | 106 m_pendingTasks.append(createCallbackTask(&didReceiveMessageErrorCallback, th
is)); |
107 if (!m_suspended) | 107 if (!m_suspended) |
108 processPendingTasks(); | 108 processPendingTasks(); |
109 } | 109 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 wrapper->m_client->didReceiveMessage(message); | 143 wrapper->m_client->didReceiveMessage(message); |
144 } | 144 } |
145 | 145 |
146 void ThreadableWebSocketChannelClientWrapper::didReceiveBinaryDataCallback(Execu
tionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClientWra
pper> wrapper, PassOwnPtr<Vector<char> > binaryData) | 146 void ThreadableWebSocketChannelClientWrapper::didReceiveBinaryDataCallback(Execu
tionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClientWra
pper> wrapper, PassOwnPtr<Vector<char> > binaryData) |
147 { | 147 { |
148 ASSERT_UNUSED(context, !context); | 148 ASSERT_UNUSED(context, !context); |
149 if (wrapper->m_client) | 149 if (wrapper->m_client) |
150 wrapper->m_client->didReceiveBinaryData(binaryData); | 150 wrapper->m_client->didReceiveBinaryData(binaryData); |
151 } | 151 } |
152 | 152 |
153 void ThreadableWebSocketChannelClientWrapper::didConsumeBufferedAmountCallback(E
xecutionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClien
tWrapper> wrapper, unsigned long consumed) | 153 void ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmountCallback(Ex
ecutionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClient
Wrapper> wrapper, unsigned long bufferedAmount) |
154 { | 154 { |
155 ASSERT_UNUSED(context, !context); | 155 ASSERT_UNUSED(context, !context); |
156 if (wrapper->m_client) | 156 if (wrapper->m_client) |
157 wrapper->m_client->didConsumeBufferedAmount(consumed); | 157 wrapper->m_client->didUpdateBufferedAmount(bufferedAmount); |
158 } | 158 } |
159 | 159 |
160 void ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback(E
xecutionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClien
tWrapper> wrapper) | 160 void ThreadableWebSocketChannelClientWrapper::didStartClosingHandshakeCallback(E
xecutionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClien
tWrapper> wrapper) |
161 { | 161 { |
162 ASSERT_UNUSED(context, !context); | 162 ASSERT_UNUSED(context, !context); |
163 if (wrapper->m_client) | 163 if (wrapper->m_client) |
164 wrapper->m_client->didStartClosingHandshake(); | 164 wrapper->m_client->didStartClosingHandshake(); |
165 } | 165 } |
166 | 166 |
167 void ThreadableWebSocketChannelClientWrapper::didCloseCallback(ExecutionContext*
context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClientWrapper> wrappe
r, WebSocketChannelClient::ClosingHandshakeCompletionStatus closingHandshakeComp
letion, unsigned short code, const String& reason) | 167 void ThreadableWebSocketChannelClientWrapper::didCloseCallback(ExecutionContext*
context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClientWrapper> wrappe
r, unsigned long unhandledBufferedAmount, WebSocketChannelClient::ClosingHandsha
keCompletionStatus closingHandshakeCompletion, unsigned short code, const String
& reason) |
168 { | 168 { |
169 ASSERT_UNUSED(context, !context); | 169 ASSERT_UNUSED(context, !context); |
170 if (wrapper->m_client) | 170 if (wrapper->m_client) |
171 wrapper->m_client->didClose(closingHandshakeCompletion, code, reason); | 171 wrapper->m_client->didClose(unhandledBufferedAmount, closingHandshakeCom
pletion, code, reason); |
172 } | 172 } |
173 | 173 |
174 void ThreadableWebSocketChannelClientWrapper::didReceiveMessageErrorCallback(Exe
cutionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClientW
rapper> wrapper) | 174 void ThreadableWebSocketChannelClientWrapper::didReceiveMessageErrorCallback(Exe
cutionContext* context, PassRefPtrWillBeRawPtr<ThreadableWebSocketChannelClientW
rapper> wrapper) |
175 { | 175 { |
176 ASSERT_UNUSED(context, !context); | 176 ASSERT_UNUSED(context, !context); |
177 if (wrapper->m_client) | 177 if (wrapper->m_client) |
178 wrapper->m_client->didReceiveMessageError(); | 178 wrapper->m_client->didReceiveMessageError(); |
179 } | 179 } |
180 | 180 |
181 } // namespace WebCore | 181 } // namespace WebCore |
OLD | NEW |