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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "wtf/Forward.h" | 43 #include "wtf/Forward.h" |
44 #include "wtf/text/AtomicStringHash.h" | 44 #include "wtf/text/AtomicStringHash.h" |
45 #include <stdint.h> | 45 #include <stdint.h> |
46 | 46 |
47 namespace blink { | 47 namespace blink { |
48 | 48 |
49 class Blob; | 49 class Blob; |
50 class DOMArrayBuffer; | 50 class DOMArrayBuffer; |
51 class DOMArrayBufferView; | 51 class DOMArrayBufferView; |
52 class ExceptionState; | 52 class ExceptionState; |
| 53 class StringOrStringSequence; |
53 | 54 |
54 class DOMWebSocket : public RefCountedGarbageCollectedEventTargetWithInlineData<
DOMWebSocket>, public ActiveDOMObject, public WebSocketChannelClient { | 55 class DOMWebSocket : public RefCountedGarbageCollectedEventTargetWithInlineData<
DOMWebSocket>, public ActiveDOMObject, public WebSocketChannelClient { |
55 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<D
OMWebSocket>); | 56 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<D
OMWebSocket>); |
56 DEFINE_WRAPPERTYPEINFO(); | 57 DEFINE_WRAPPERTYPEINFO(); |
57 USING_GARBAGE_COLLECTED_MIXIN(DOMWebSocket); | 58 USING_GARBAGE_COLLECTED_MIXIN(DOMWebSocket); |
58 public: | 59 public: |
59 static const char* subprotocolSeperator(); | 60 static const char* subprotocolSeperator(); |
60 // DOMWebSocket instances must be used with a wrapper since this class's | 61 // DOMWebSocket instances must be used with a wrapper since this class's |
61 // lifetime management is designed assuming the V8 holds a ref on it while | 62 // lifetime management is designed assuming the V8 holds a ref on it while |
62 // hasPendingActivity() returns true. | 63 // hasPendingActivity() returns true. |
63 static DOMWebSocket* create(ExecutionContext*, const String& url, ExceptionS
tate&); | 64 static DOMWebSocket* create(ExecutionContext*, const String& url, ExceptionS
tate&); |
64 static DOMWebSocket* create(ExecutionContext*, const String& url, const Stri
ng& protocol, ExceptionState&); | 65 static DOMWebSocket* create(ExecutionContext*, const String& url, const Stri
ngOrStringSequence& protocols, ExceptionState&); |
65 static DOMWebSocket* create(ExecutionContext*, const String& url, const Vect
or<String>& protocols, ExceptionState&); | |
66 virtual ~DOMWebSocket(); | 66 virtual ~DOMWebSocket(); |
67 | 67 |
68 enum State { | 68 enum State { |
69 CONNECTING = 0, | 69 CONNECTING = 0, |
70 OPEN = 1, | 70 OPEN = 1, |
71 CLOSING = 2, | 71 CLOSING = 2, |
72 CLOSED = 3 | 72 CLOSED = 3 |
73 }; | 73 }; |
74 | 74 |
75 void connect(const String& url, const Vector<String>& protocols, ExceptionSt
ate&); | 75 void connect(const String& url, const Vector<String>& protocols, ExceptionSt
ate&); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 String m_subprotocol; | 224 String m_subprotocol; |
225 String m_extensions; | 225 String m_extensions; |
226 | 226 |
227 Member<EventQueue> m_eventQueue; | 227 Member<EventQueue> m_eventQueue; |
228 Timer<DOMWebSocket> m_bufferedAmountConsumeTimer; | 228 Timer<DOMWebSocket> m_bufferedAmountConsumeTimer; |
229 }; | 229 }; |
230 | 230 |
231 } // namespace blink | 231 } // namespace blink |
232 | 232 |
233 #endif // DOMWebSocket_h | 233 #endif // DOMWebSocket_h |
OLD | NEW |