| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 virtual String subprotocol() OVERRIDE; | 76 virtual String subprotocol() OVERRIDE; |
| 77 virtual String extensions() OVERRIDE; | 77 virtual String extensions() OVERRIDE; |
| 78 virtual WebSocketChannel::SendResult send(const String& message) OVERRIDE; | 78 virtual WebSocketChannel::SendResult send(const String& message) OVERRIDE; |
| 79 virtual WebSocketChannel::SendResult send(const ArrayBuffer&, unsigned byteO
ffset, unsigned byteLength) OVERRIDE; | 79 virtual WebSocketChannel::SendResult send(const ArrayBuffer&, unsigned byteO
ffset, unsigned byteLength) OVERRIDE; |
| 80 virtual WebSocketChannel::SendResult send(PassRefPtr<BlobDataHandle>) OVERRI
DE; | 80 virtual WebSocketChannel::SendResult send(PassRefPtr<BlobDataHandle>) OVERRI
DE; |
| 81 virtual WebSocketChannel::SendResult send(PassOwnPtr<Vector<char> >) OVERRID
E | 81 virtual WebSocketChannel::SendResult send(PassOwnPtr<Vector<char> >) OVERRID
E |
| 82 { | 82 { |
| 83 ASSERT_NOT_REACHED(); | 83 ASSERT_NOT_REACHED(); |
| 84 return WebSocketChannel::SendFail; | 84 return WebSocketChannel::SendFail; |
| 85 } | 85 } |
| 86 virtual unsigned long bufferedAmount() const OVERRIDE; | |
| 87 virtual void close(int code, const String& reason) OVERRIDE; | 86 virtual void close(int code, const String& reason) OVERRIDE; |
| 88 virtual void fail(const String& reason, MessageLevel, const String&, unsigne
d) OVERRIDE; | 87 virtual void fail(const String& reason, MessageLevel, const String&, unsigne
d) OVERRIDE; |
| 89 virtual void disconnect() OVERRIDE; // Will suppress didClose(). | 88 virtual void disconnect() OVERRIDE; // Will suppress didClose(). |
| 90 virtual void suspend() OVERRIDE; | 89 virtual void suspend() OVERRIDE; |
| 91 virtual void resume() OVERRIDE; | 90 virtual void resume() OVERRIDE; |
| 92 | 91 |
| 93 virtual void trace(Visitor*) OVERRIDE; | 92 virtual void trace(Visitor*) OVERRIDE; |
| 94 | 93 |
| 95 // Generated by the bridge. The Peer is destructed by an async call from | 94 // Generated by the bridge. The Peer is destructed by an async call from |
| 96 // Bridge, and may outlive the bridge. All methods of this class must | 95 // Bridge, and may outlive the bridge. All methods of this class must |
| (...skipping 16 matching lines...) Expand all Loading... |
| 113 void close(int code, const String& reason); | 112 void close(int code, const String& reason); |
| 114 void fail(const String& reason, MessageLevel, const String& sourceURL, u
nsigned lineNumber); | 113 void fail(const String& reason, MessageLevel, const String& sourceURL, u
nsigned lineNumber); |
| 115 void disconnect(); | 114 void disconnect(); |
| 116 void suspend(); | 115 void suspend(); |
| 117 void resume(); | 116 void resume(); |
| 118 | 117 |
| 119 // WebSocketChannelClient functions. | 118 // WebSocketChannelClient functions. |
| 120 virtual void didConnect() OVERRIDE; | 119 virtual void didConnect() OVERRIDE; |
| 121 virtual void didReceiveMessage(const String& message) OVERRIDE; | 120 virtual void didReceiveMessage(const String& message) OVERRIDE; |
| 122 virtual void didReceiveBinaryData(PassOwnPtr<Vector<char> >) OVERRIDE; | 121 virtual void didReceiveBinaryData(PassOwnPtr<Vector<char> >) OVERRIDE; |
| 123 virtual void didUpdateBufferedAmount(unsigned long bufferedAmount) OVERR
IDE; | 122 virtual void didConsumeBufferedAmount(unsigned long) OVERRIDE; |
| 124 virtual void didStartClosingHandshake() OVERRIDE; | 123 virtual void didStartClosingHandshake() OVERRIDE; |
| 125 virtual void didClose(unsigned long unhandledBufferedAmount, ClosingHand
shakeCompletionStatus, unsigned short code, const String& reason) OVERRIDE; | 124 virtual void didClose(ClosingHandshakeCompletionStatus, unsigned short c
ode, const String& reason) OVERRIDE; |
| 126 virtual void didReceiveMessageError() OVERRIDE; | 125 virtual void didReceiveMessageError() OVERRIDE; |
| 127 | 126 |
| 128 private: | 127 private: |
| 129 Peer(PassRefPtr<WeakReference<Peer> >, PassRefPtrWillBeRawPtr<Threadable
WebSocketChannelClientWrapper>, WorkerLoaderProxy&, ExecutionContext*, const Str
ing& sourceURL, unsigned lineNumber, PassOwnPtr<ThreadableWebSocketChannelSyncHe
lper>); | 128 Peer(PassRefPtr<WeakReference<Peer> >, PassRefPtrWillBeRawPtr<Threadable
WebSocketChannelClientWrapper>, WorkerLoaderProxy&, ExecutionContext*, const Str
ing& sourceURL, unsigned lineNumber, PassOwnPtr<ThreadableWebSocketChannelSyncHe
lper>); |
| 130 | 129 |
| 131 const RefPtrWillBePersistent<ThreadableWebSocketChannelClientWrapper> m_
workerClientWrapper; | 130 const RefPtrWillBePersistent<ThreadableWebSocketChannelClientWrapper> m_
workerClientWrapper; |
| 132 WorkerLoaderProxy& m_loaderProxy; | 131 WorkerLoaderProxy& m_loaderProxy; |
| 133 RefPtrWillBePersistent<WebSocketChannel> m_mainWebSocketChannel; | 132 RefPtrWillBePersistent<WebSocketChannel> m_mainWebSocketChannel; |
| 134 OwnPtr<ThreadableWebSocketChannelSyncHelper> m_syncHelper; | 133 OwnPtr<ThreadableWebSocketChannelSyncHelper> m_syncHelper; |
| 135 WeakPtrFactory<Peer> m_weakFactory; | 134 WeakPtrFactory<Peer> m_weakFactory; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 183 |
| 185 const RefPtrWillBeMember<ThreadableWebSocketChannelClientWrapper> m_workerCl
ientWrapper; | 184 const RefPtrWillBeMember<ThreadableWebSocketChannelClientWrapper> m_workerCl
ientWrapper; |
| 186 RefPtr<Bridge> m_bridge; | 185 RefPtr<Bridge> m_bridge; |
| 187 String m_sourceURLAtConnection; | 186 String m_sourceURLAtConnection; |
| 188 unsigned m_lineNumberAtConnection; | 187 unsigned m_lineNumberAtConnection; |
| 189 }; | 188 }; |
| 190 | 189 |
| 191 } // namespace WebCore | 190 } // namespace WebCore |
| 192 | 191 |
| 193 #endif // WorkerThreadableWebSocketChannel_h | 192 #endif // WorkerThreadableWebSocketChannel_h |
| OLD | NEW |