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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 class MainThreadWebSocketChannel FINAL : public WebSocketChannel, public SocketS
treamHandleClient, public FileReaderLoaderClient { | 59 class MainThreadWebSocketChannel FINAL : public WebSocketChannel, public SocketS
treamHandleClient, public FileReaderLoaderClient { |
60 USING_GARBAGE_COLLECTED_MIXIN(MainThreadWebSocketChannel); | 60 USING_GARBAGE_COLLECTED_MIXIN(MainThreadWebSocketChannel); |
61 public: | 61 public: |
62 // You can specify the source file and the line number information | 62 // You can specify the source file and the line number information |
63 // explicitly by passing the last parameter. | 63 // explicitly by passing the last parameter. |
64 // In the usual case, they are set automatically and you don't have to | 64 // In the usual case, they are set automatically and you don't have to |
65 // pass it. | 65 // pass it. |
66 static MainThreadWebSocketChannel* create(Document* document, WebSocketChann
elClient* client, const String& sourceURL = String(), unsigned lineNumber = 0) | 66 static MainThreadWebSocketChannel* create(Document* document, WebSocketChann
elClient* client, const String& sourceURL = String(), unsigned lineNumber = 0) |
67 { | 67 { |
68 return adoptRefCountedGarbageCollected(new MainThreadWebSocketChannel(do
cument, client, sourceURL, lineNumber)); | 68 return new MainThreadWebSocketChannel(document, client, sourceURL, lineN
umber); |
69 } | 69 } |
70 virtual ~MainThreadWebSocketChannel(); | 70 virtual ~MainThreadWebSocketChannel(); |
71 | 71 |
72 // WebSocketChannel functions. | 72 // WebSocketChannel functions. |
73 virtual bool connect(const KURL&, const String& protocol) OVERRIDE; | 73 virtual bool connect(const KURL&, const String& protocol) OVERRIDE; |
74 virtual void send(const String& message) OVERRIDE; | 74 virtual void send(const String& message) OVERRIDE; |
75 virtual void send(const ArrayBuffer&, unsigned byteOffset, unsigned byteLeng
th) OVERRIDE; | 75 virtual void send(const ArrayBuffer&, unsigned byteOffset, unsigned byteLeng
th) OVERRIDE; |
76 virtual void send(PassRefPtr<BlobDataHandle>) OVERRIDE; | 76 virtual void send(PassRefPtr<BlobDataHandle>) OVERRIDE; |
77 virtual void send(PassOwnPtr<Vector<char> > data) OVERRIDE; | 77 virtual void send(PassOwnPtr<Vector<char> > data) OVERRIDE; |
78 // Start closing handshake. Use the CloseEventCodeNotSpecified for the code | 78 // Start closing handshake. Use the CloseEventCodeNotSpecified for the code |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 unsigned m_lineNumberAtConstruction; | 243 unsigned m_lineNumberAtConstruction; |
244 | 244 |
245 WebSocketPerMessageDeflate m_perMessageDeflate; | 245 WebSocketPerMessageDeflate m_perMessageDeflate; |
246 | 246 |
247 WebSocketDeflateFramer m_deflateFramer; | 247 WebSocketDeflateFramer m_deflateFramer; |
248 }; | 248 }; |
249 | 249 |
250 } // namespace blink | 250 } // namespace blink |
251 | 251 |
252 #endif // MainThreadWebSocketChannel_h | 252 #endif // MainThreadWebSocketChannel_h |
OLD | NEW |