| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 String subprotocol() const; | 53 String subprotocol() const; |
| 54 void setSubprotocol(const String&); | 54 void setSubprotocol(const String&); |
| 55 String extensions() const; | 55 String extensions() const; |
| 56 void setExtensions(const String&); | 56 void setExtensions(const String&); |
| 57 | 57 |
| 58 void clearClient(); | 58 void clearClient(); |
| 59 | 59 |
| 60 void didConnect(); | 60 void didConnect(); |
| 61 void didReceiveMessage(const String& message); | 61 void didReceiveMessage(const String& message); |
| 62 void didReceiveBinaryData(PassOwnPtr<Vector<char> >); | 62 void didReceiveBinaryData(PassOwnPtr<Vector<char> >); |
| 63 void didUpdateBufferedAmount(unsigned long bufferedAmount); | 63 void didIncreaseBufferedAmount(unsigned long); |
| 64 void didDecreaseBufferedAmount(unsigned long); |
| 64 void didStartClosingHandshake(); | 65 void didStartClosingHandshake(); |
| 65 void didClose(unsigned long unhandledBufferedAmount, WebSocketChannelClient:
:ClosingHandshakeCompletionStatus, unsigned short code, const String& reason); | 66 void didClose(unsigned long unhandledBufferedAmount, WebSocketChannelClient:
:ClosingHandshakeCompletionStatus, unsigned short code, const String& reason); |
| 66 void didReceiveMessageError(); | 67 void didReceiveMessageError(); |
| 67 | 68 |
| 68 void suspend(); | 69 void suspend(); |
| 69 void resume(); | 70 void resume(); |
| 70 | 71 |
| 71 private: | 72 private: |
| 72 ThreadableWebSocketChannelClientWrapper(WebSocketChannelClient*); | 73 ThreadableWebSocketChannelClientWrapper(WebSocketChannelClient*); |
| 73 | 74 |
| 74 void processPendingTasks(); | 75 void processPendingTasks(); |
| 75 | 76 |
| 76 static void didConnectCallback(ExecutionContext*, PassRefPtr<ThreadableWebSo
cketChannelClientWrapper>); | 77 static void didConnectCallback(ExecutionContext*, PassRefPtr<ThreadableWebSo
cketChannelClientWrapper>); |
| 77 static void didReceiveMessageCallback(ExecutionContext*, PassRefPtr<Threadab
leWebSocketChannelClientWrapper>, const String& message); | 78 static void didReceiveMessageCallback(ExecutionContext*, PassRefPtr<Threadab
leWebSocketChannelClientWrapper>, const String& message); |
| 78 static void didReceiveBinaryDataCallback(ExecutionContext*, PassRefPtr<Threa
dableWebSocketChannelClientWrapper>, PassOwnPtr<Vector<char> >); | 79 static void didReceiveBinaryDataCallback(ExecutionContext*, PassRefPtr<Threa
dableWebSocketChannelClientWrapper>, PassOwnPtr<Vector<char> >); |
| 79 static void didUpdateBufferedAmountCallback(ExecutionContext*, PassRefPtr<Th
readableWebSocketChannelClientWrapper>, unsigned long bufferedAmount); | 80 static void didIncreaseBufferedAmountCallback(ExecutionContext*, PassRefPtr<
ThreadableWebSocketChannelClientWrapper>, unsigned long); |
| 81 static void didDecreaseBufferedAmountCallback(ExecutionContext*, PassRefPtr<
ThreadableWebSocketChannelClientWrapper>, unsigned long); |
| 80 static void didStartClosingHandshakeCallback(ExecutionContext*, PassRefPtr<T
hreadableWebSocketChannelClientWrapper>); | 82 static void didStartClosingHandshakeCallback(ExecutionContext*, PassRefPtr<T
hreadableWebSocketChannelClientWrapper>); |
| 81 static void didCloseCallback(ExecutionContext*, PassRefPtr<ThreadableWebSock
etChannelClientWrapper>, unsigned long unhandledBufferedAmount, WebSocketChannel
Client::ClosingHandshakeCompletionStatus, unsigned short code, const String& rea
son); | 83 static void didCloseCallback(ExecutionContext*, PassRefPtr<ThreadableWebSock
etChannelClientWrapper>, unsigned long unhandledBufferedAmount, WebSocketChannel
Client::ClosingHandshakeCompletionStatus, unsigned short code, const String& rea
son); |
| 82 static void didReceiveMessageErrorCallback(ExecutionContext*, PassRefPtr<Thr
eadableWebSocketChannelClientWrapper>); | 84 static void didReceiveMessageErrorCallback(ExecutionContext*, PassRefPtr<Thr
eadableWebSocketChannelClientWrapper>); |
| 83 | 85 |
| 84 WebSocketChannelClient* m_client; | 86 WebSocketChannelClient* m_client; |
| 85 // ThreadSafeRefCounted must not have String member variables. | 87 // ThreadSafeRefCounted must not have String member variables. |
| 86 Vector<UChar> m_subprotocol; | 88 Vector<UChar> m_subprotocol; |
| 87 Vector<UChar> m_extensions; | 89 Vector<UChar> m_extensions; |
| 88 bool m_suspended; | 90 bool m_suspended; |
| 89 Vector<OwnPtr<ExecutionContextTask> > m_pendingTasks; | 91 Vector<OwnPtr<ExecutionContextTask> > m_pendingTasks; |
| 90 }; | 92 }; |
| 91 | 93 |
| 92 } // namespace WebCore | 94 } // namespace WebCore |
| 93 | 95 |
| 94 #endif // ThreadableWebSocketChannelClientWrapper_h | 96 #endif // ThreadableWebSocketChannelClientWrapper_h |
| OLD | NEW |