| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef DOMWebSocket_h | 31 #ifndef DOMWebSocket_h |
| 32 #define DOMWebSocket_h | 32 #define DOMWebSocket_h |
| 33 | 33 |
| 34 #include <stddef.h> | |
| 35 #include <stdint.h> | |
| 36 #include <memory> | |
| 37 #include "bindings/core/v8/ActiveScriptWrappable.h" | 34 #include "bindings/core/v8/ActiveScriptWrappable.h" |
| 38 #include "bindings/core/v8/ScriptWrappable.h" | 35 #include "bindings/core/v8/ScriptWrappable.h" |
| 39 #include "core/dom/NotShared.h" | |
| 40 #include "core/dom/SuspendableObject.h" | 36 #include "core/dom/SuspendableObject.h" |
| 41 #include "core/events/EventListener.h" | 37 #include "core/events/EventListener.h" |
| 42 #include "core/events/EventTarget.h" | 38 #include "core/events/EventTarget.h" |
| 43 #include "modules/EventTargetModules.h" | 39 #include "modules/EventTargetModules.h" |
| 44 #include "modules/ModulesExport.h" | 40 #include "modules/ModulesExport.h" |
| 45 #include "modules/websockets/WebSocketChannel.h" | 41 #include "modules/websockets/WebSocketChannel.h" |
| 46 #include "modules/websockets/WebSocketChannelClient.h" | 42 #include "modules/websockets/WebSocketChannelClient.h" |
| 47 #include "platform/Timer.h" | 43 #include "platform/Timer.h" |
| 48 #include "platform/heap/Handle.h" | 44 #include "platform/heap/Handle.h" |
| 49 #include "platform/weborigin/KURL.h" | 45 #include "platform/weborigin/KURL.h" |
| 50 #include "wtf/Deque.h" | 46 #include "wtf/Deque.h" |
| 51 #include "wtf/Forward.h" | 47 #include "wtf/Forward.h" |
| 52 #include "wtf/PassRefPtr.h" | 48 #include "wtf/PassRefPtr.h" |
| 53 #include "wtf/RefPtr.h" | 49 #include "wtf/RefPtr.h" |
| 54 #include "wtf/text/WTFString.h" | 50 #include "wtf/text/WTFString.h" |
| 51 #include <memory> |
| 52 #include <stddef.h> |
| 53 #include <stdint.h> |
| 55 | 54 |
| 56 namespace blink { | 55 namespace blink { |
| 57 | 56 |
| 58 class Blob; | 57 class Blob; |
| 59 class DOMArrayBuffer; | 58 class DOMArrayBuffer; |
| 60 class DOMArrayBufferView; | 59 class DOMArrayBufferView; |
| 61 class ExceptionState; | 60 class ExceptionState; |
| 62 class ExecutionContext; | 61 class ExecutionContext; |
| 63 class StringOrStringSequence; | 62 class StringOrStringSequence; |
| 64 | 63 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 84 ~DOMWebSocket() override; | 83 ~DOMWebSocket() override; |
| 85 | 84 |
| 86 enum State { kConnecting = 0, kOpen = 1, kClosing = 2, kClosed = 3 }; | 85 enum State { kConnecting = 0, kOpen = 1, kClosing = 2, kClosed = 3 }; |
| 87 | 86 |
| 88 void Connect(const String& url, | 87 void Connect(const String& url, |
| 89 const Vector<String>& protocols, | 88 const Vector<String>& protocols, |
| 90 ExceptionState&); | 89 ExceptionState&); |
| 91 | 90 |
| 92 void send(const String& message, ExceptionState&); | 91 void send(const String& message, ExceptionState&); |
| 93 void send(DOMArrayBuffer*, ExceptionState&); | 92 void send(DOMArrayBuffer*, ExceptionState&); |
| 94 void send(NotShared<DOMArrayBufferView>, ExceptionState&); | 93 void send(DOMArrayBufferView*, ExceptionState&); |
| 95 void send(Blob*, ExceptionState&); | 94 void send(Blob*, ExceptionState&); |
| 96 | 95 |
| 97 // To distinguish close method call with the code parameter from one | 96 // To distinguish close method call with the code parameter from one |
| 98 // without, we have these three signatures. Use of | 97 // without, we have these three signatures. Use of |
| 99 // Optional=DefaultIsUndefined in the IDL file doesn't help for now since | 98 // Optional=DefaultIsUndefined in the IDL file doesn't help for now since |
| 100 // it's bound to a value of 0 which is indistinguishable from the case 0 | 99 // it's bound to a value of 0 which is indistinguishable from the case 0 |
| 101 // is passed as code parameter. | 100 // is passed as code parameter. |
| 102 void close(unsigned short code, const String& reason, ExceptionState&); | 101 void close(unsigned short code, const String& reason, ExceptionState&); |
| 103 void close(ExceptionState&); | 102 void close(ExceptionState&); |
| 104 void close(unsigned short code, ExceptionState&); | 103 void close(unsigned short code, ExceptionState&); |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 String subprotocol_; | 252 String subprotocol_; |
| 254 String extensions_; | 253 String extensions_; |
| 255 | 254 |
| 256 Member<EventQueue> event_queue_; | 255 Member<EventQueue> event_queue_; |
| 257 TaskRunnerTimer<DOMWebSocket> buffered_amount_consume_timer_; | 256 TaskRunnerTimer<DOMWebSocket> buffered_amount_consume_timer_; |
| 258 }; | 257 }; |
| 259 | 258 |
| 260 } // namespace blink | 259 } // namespace blink |
| 261 | 260 |
| 262 #endif // DOMWebSocket_h | 261 #endif // DOMWebSocket_h |
| OLD | NEW |