| 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 14 matching lines...) Expand all Loading... |
| 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 "bindings/core/v8/ScriptWrappable.h" | 34 #include "bindings/core/v8/ScriptWrappable.h" |
| 35 #include "bindings/core/v8/V8GCRoot.h" |
| 35 #include "core/dom/ActiveDOMObject.h" | 36 #include "core/dom/ActiveDOMObject.h" |
| 36 #include "core/events/EventListener.h" | 37 #include "core/events/EventListener.h" |
| 37 #include "core/events/EventTarget.h" | 38 #include "core/events/EventTarget.h" |
| 38 #include "modules/EventTargetModules.h" | 39 #include "modules/EventTargetModules.h" |
| 39 #include "modules/ModulesExport.h" | 40 #include "modules/ModulesExport.h" |
| 40 #include "modules/websockets/WebSocketChannel.h" | 41 #include "modules/websockets/WebSocketChannel.h" |
| 41 #include "modules/websockets/WebSocketChannelClient.h" | 42 #include "modules/websockets/WebSocketChannelClient.h" |
| 42 #include "platform/Timer.h" | 43 #include "platform/Timer.h" |
| 43 #include "platform/heap/Handle.h" | 44 #include "platform/heap/Handle.h" |
| 44 #include "platform/weborigin/KURL.h" | 45 #include "platform/weborigin/KURL.h" |
| 45 #include "wtf/Deque.h" | 46 #include "wtf/Deque.h" |
| 46 #include "wtf/Forward.h" | 47 #include "wtf/Forward.h" |
| 47 #include "wtf/PassRefPtr.h" | 48 #include "wtf/PassRefPtr.h" |
| 48 #include "wtf/RefPtr.h" | 49 #include "wtf/RefPtr.h" |
| 49 #include "wtf/text/WTFString.h" | 50 #include "wtf/text/WTFString.h" |
| 50 #include <stdint.h> | 51 #include <stdint.h> |
| 51 | 52 |
| 52 namespace blink { | 53 namespace blink { |
| 53 | 54 |
| 54 class Blob; | 55 class Blob; |
| 55 class DOMArrayBuffer; | 56 class DOMArrayBuffer; |
| 56 class DOMArrayBufferView; | 57 class DOMArrayBufferView; |
| 57 class ExceptionState; | 58 class ExceptionState; |
| 58 class ExecutionContext; | 59 class ExecutionContext; |
| 59 class StringOrStringSequence; | 60 class StringOrStringSequence; |
| 60 | 61 |
| 61 class MODULES_EXPORT DOMWebSocket : public RefCountedGarbageCollectedEventTarget
WithInlineData<DOMWebSocket>, public ActiveDOMObject, public WebSocketChannelCli
ent { | 62 class MODULES_EXPORT DOMWebSocket : public RefCountedGarbageCollectedEventTarget
WithInlineData<DOMWebSocket>, public ActiveDOMObject, public WebSocketChannelCli
ent, public V8GCRoot { |
| 62 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(DOMWebSocket); | 63 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(DOMWebSocket); |
| 63 DEFINE_WRAPPERTYPEINFO(); | 64 DEFINE_WRAPPERTYPEINFO(); |
| 64 USING_GARBAGE_COLLECTED_MIXIN(DOMWebSocket); | 65 USING_GARBAGE_COLLECTED_MIXIN(DOMWebSocket); |
| 65 public: | 66 public: |
| 66 static const char* subprotocolSeperator(); | 67 static const char* subprotocolSeperator(); |
| 67 // DOMWebSocket instances must be used with a wrapper since this class's | 68 // DOMWebSocket instances must be used with a wrapper since this class's |
| 68 // lifetime management is designed assuming the V8 holds a ref on it while | 69 // lifetime management is designed assuming the V8 holds a ref on it while |
| 69 // hasPendingActivity() returns true. | 70 // hasPendingActivity() returns true. |
| 70 static DOMWebSocket* create(ExecutionContext*, const String& url, ExceptionS
tate&); | 71 static DOMWebSocket* create(ExecutionContext*, const String& url, ExceptionS
tate&); |
| 71 static DOMWebSocket* create(ExecutionContext*, const String& url, const Stri
ngOrStringSequence& protocols, ExceptionState&); | 72 static DOMWebSocket* create(ExecutionContext*, const String& url, const Stri
ngOrStringSequence& protocols, ExceptionState&); |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 String m_subprotocol; | 240 String m_subprotocol; |
| 240 String m_extensions; | 241 String m_extensions; |
| 241 | 242 |
| 242 Member<EventQueue> m_eventQueue; | 243 Member<EventQueue> m_eventQueue; |
| 243 Timer<DOMWebSocket> m_bufferedAmountConsumeTimer; | 244 Timer<DOMWebSocket> m_bufferedAmountConsumeTimer; |
| 244 }; | 245 }; |
| 245 | 246 |
| 246 } // namespace blink | 247 } // namespace blink |
| 247 | 248 |
| 248 #endif // DOMWebSocket_h | 249 #endif // DOMWebSocket_h |
| OLD | NEW |