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