| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 namespace WebCore { | 51 namespace WebCore { |
| 52 | 52 |
| 53 class BlobDataHandle; | 53 class BlobDataHandle; |
| 54 class Document; | 54 class Document; |
| 55 class FileReaderLoader; | 55 class FileReaderLoader; |
| 56 class SocketStreamHandle; | 56 class SocketStreamHandle; |
| 57 class SocketStreamError; | 57 class SocketStreamError; |
| 58 class WebSocketChannelClient; | 58 class WebSocketChannelClient; |
| 59 | 59 |
| 60 class MainThreadWebSocketChannel : public RefCounted<MainThreadWebSocketChannel>
, public SocketStreamHandleClient, public WebSocketChannel, public FileReaderLoa
derClient { | 60 class MainThreadWebSocketChannel FINAL : public RefCounted<MainThreadWebSocketCh
annel>, public SocketStreamHandleClient, public WebSocketChannel, public FileRea
derLoaderClient { |
| 61 WTF_MAKE_FAST_ALLOCATED; | 61 WTF_MAKE_FAST_ALLOCATED; |
| 62 public: | 62 public: |
| 63 // You can specify the source file and the line number information | 63 // You can specify the source file and the line number information |
| 64 // explicitly by passing the last parameter. | 64 // explicitly by passing the last parameter. |
| 65 // In the usual case, they are set automatically and you don't have to | 65 // In the usual case, they are set automatically and you don't have to |
| 66 // pass it. | 66 // pass it. |
| 67 static PassRefPtr<MainThreadWebSocketChannel> create(Document* document, Web
SocketChannelClient* client, const String& sourceURL = String(), unsigned lineNu
mber = 0) { return adoptRef(new MainThreadWebSocketChannel(document, client, sou
rceURL, lineNumber)); } | 67 static PassRefPtr<MainThreadWebSocketChannel> create(Document* document, Web
SocketChannelClient* client, const String& sourceURL = String(), unsigned lineNu
mber = 0) { return adoptRef(new MainThreadWebSocketChannel(document, client, sou
rceURL, lineNumber)); } |
| 68 virtual ~MainThreadWebSocketChannel(); | 68 virtual ~MainThreadWebSocketChannel(); |
| 69 | 69 |
| 70 bool send(const char* data, int length); | 70 bool send(const char* data, int length); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 89 | 89 |
| 90 // SocketStreamHandleClient functions. | 90 // SocketStreamHandleClient functions. |
| 91 virtual void willOpenSocketStream(SocketStreamHandle*) OVERRIDE; | 91 virtual void willOpenSocketStream(SocketStreamHandle*) OVERRIDE; |
| 92 virtual void didOpenSocketStream(SocketStreamHandle*) OVERRIDE; | 92 virtual void didOpenSocketStream(SocketStreamHandle*) OVERRIDE; |
| 93 virtual void didCloseSocketStream(SocketStreamHandle*) OVERRIDE; | 93 virtual void didCloseSocketStream(SocketStreamHandle*) OVERRIDE; |
| 94 virtual void didReceiveSocketStreamData(SocketStreamHandle*, const char*, in
t) OVERRIDE; | 94 virtual void didReceiveSocketStreamData(SocketStreamHandle*, const char*, in
t) OVERRIDE; |
| 95 virtual void didUpdateBufferedAmount(SocketStreamHandle*, size_t bufferedAmo
unt) OVERRIDE; | 95 virtual void didUpdateBufferedAmount(SocketStreamHandle*, size_t bufferedAmo
unt) OVERRIDE; |
| 96 virtual void didFailSocketStream(SocketStreamHandle*, const SocketStreamErro
r&) OVERRIDE; | 96 virtual void didFailSocketStream(SocketStreamHandle*, const SocketStreamErro
r&) OVERRIDE; |
| 97 | 97 |
| 98 // FileReaderLoaderClient functions. | 98 // FileReaderLoaderClient functions. |
| 99 virtual void didStartLoading(); | 99 virtual void didStartLoading() OVERRIDE; |
| 100 virtual void didReceiveData(); | 100 virtual void didReceiveData() OVERRIDE; |
| 101 virtual void didFinishLoading(); | 101 virtual void didFinishLoading() OVERRIDE; |
| 102 virtual void didFail(FileError::ErrorCode); | 102 virtual void didFail(FileError::ErrorCode) OVERRIDE; |
| 103 | 103 |
| 104 using RefCounted<MainThreadWebSocketChannel>::ref; | 104 using RefCounted<MainThreadWebSocketChannel>::ref; |
| 105 using RefCounted<MainThreadWebSocketChannel>::deref; | 105 using RefCounted<MainThreadWebSocketChannel>::deref; |
| 106 | 106 |
| 107 protected: | 107 protected: |
| 108 // WebSocketChannel functions. | 108 // WebSocketChannel functions. |
| 109 virtual void refWebSocketChannel() OVERRIDE { ref(); } | 109 virtual void refWebSocketChannel() OVERRIDE { ref(); } |
| 110 virtual void derefWebSocketChannel() OVERRIDE { deref(); } | 110 virtual void derefWebSocketChannel() OVERRIDE { deref(); } |
| 111 | 111 |
| 112 private: | 112 private: |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 unsigned m_lineNumberAtConstruction; | 227 unsigned m_lineNumberAtConstruction; |
| 228 | 228 |
| 229 WebSocketPerMessageDeflate m_perMessageDeflate; | 229 WebSocketPerMessageDeflate m_perMessageDeflate; |
| 230 | 230 |
| 231 WebSocketDeflateFramer m_deflateFramer; | 231 WebSocketDeflateFramer m_deflateFramer; |
| 232 }; | 232 }; |
| 233 | 233 |
| 234 } // namespace WebCore | 234 } // namespace WebCore |
| 235 | 235 |
| 236 #endif // MainThreadWebSocketChannel_h | 236 #endif // MainThreadWebSocketChannel_h |
| OLD | NEW |