| 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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 exceptionState.throwDOMException(InvalidStateError, | 212 exceptionState.throwDOMException(InvalidStateError, |
| 213 "Still in CONNECTING state."); | 213 "Still in CONNECTING state."); |
| 214 } | 214 } |
| 215 | 215 |
| 216 const char* DOMWebSocket::subprotocolSeperator() { | 216 const char* DOMWebSocket::subprotocolSeperator() { |
| 217 return ", "; | 217 return ", "; |
| 218 } | 218 } |
| 219 | 219 |
| 220 DOMWebSocket::DOMWebSocket(ExecutionContext* context) | 220 DOMWebSocket::DOMWebSocket(ExecutionContext* context) |
| 221 : ActiveScriptWrappable(this), | 221 : ActiveScriptWrappable(this), |
| 222 ActiveDOMObject(context), | 222 SuspendableObject(context), |
| 223 m_state(kConnecting), | 223 m_state(kConnecting), |
| 224 m_bufferedAmount(0), | 224 m_bufferedAmount(0), |
| 225 m_consumedBufferedAmount(0), | 225 m_consumedBufferedAmount(0), |
| 226 m_bufferedAmountAfterClose(0), | 226 m_bufferedAmountAfterClose(0), |
| 227 m_binaryType(BinaryTypeBlob), | 227 m_binaryType(BinaryTypeBlob), |
| 228 m_binaryTypeChangesAfterOpen(0), | 228 m_binaryTypeChangesAfterOpen(0), |
| 229 m_subprotocol(""), | 229 m_subprotocol(""), |
| 230 m_extensions(""), | 230 m_extensions(""), |
| 231 m_eventQueue(EventQueue::create(this)), | 231 m_eventQueue(EventQueue::create(this)), |
| 232 m_bufferedAmountConsumeTimer( | 232 m_bufferedAmountConsumeTimer( |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 m_binaryType = binaryType; | 643 m_binaryType = binaryType; |
| 644 if (m_state == kOpen || m_state == kClosing) | 644 if (m_state == kOpen || m_state == kClosing) |
| 645 ++m_binaryTypeChangesAfterOpen; | 645 ++m_binaryTypeChangesAfterOpen; |
| 646 } | 646 } |
| 647 | 647 |
| 648 const AtomicString& DOMWebSocket::interfaceName() const { | 648 const AtomicString& DOMWebSocket::interfaceName() const { |
| 649 return EventTargetNames::DOMWebSocket; | 649 return EventTargetNames::DOMWebSocket; |
| 650 } | 650 } |
| 651 | 651 |
| 652 ExecutionContext* DOMWebSocket::getExecutionContext() const { | 652 ExecutionContext* DOMWebSocket::getExecutionContext() const { |
| 653 return ActiveDOMObject::getExecutionContext(); | 653 return SuspendableObject::getExecutionContext(); |
| 654 } | 654 } |
| 655 | 655 |
| 656 void DOMWebSocket::contextDestroyed() { | 656 void DOMWebSocket::contextDestroyed() { |
| 657 NETWORK_DVLOG(1) << "WebSocket " << this << " contextDestroyed()"; | 657 NETWORK_DVLOG(1) << "WebSocket " << this << " contextDestroyed()"; |
| 658 m_eventQueue->contextDestroyed(); | 658 m_eventQueue->contextDestroyed(); |
| 659 if (m_channel) { | 659 if (m_channel) { |
| 660 m_channel->close(WebSocketChannel::CloseEventCodeGoingAway, String()); | 660 m_channel->close(WebSocketChannel::CloseEventCodeGoingAway, String()); |
| 661 releaseChannel(); | 661 releaseChannel(); |
| 662 } | 662 } |
| 663 if (m_state != kClosed) { | 663 if (m_state != kClosed) { |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 default: | 856 default: |
| 857 NOTREACHED(); | 857 NOTREACHED(); |
| 858 } | 858 } |
| 859 } | 859 } |
| 860 | 860 |
| 861 DEFINE_TRACE(DOMWebSocket) { | 861 DEFINE_TRACE(DOMWebSocket) { |
| 862 visitor->trace(m_channel); | 862 visitor->trace(m_channel); |
| 863 visitor->trace(m_eventQueue); | 863 visitor->trace(m_eventQueue); |
| 864 WebSocketChannelClient::trace(visitor); | 864 WebSocketChannelClient::trace(visitor); |
| 865 EventTargetWithInlineData::trace(visitor); | 865 EventTargetWithInlineData::trace(visitor); |
| 866 ActiveDOMObject::trace(visitor); | 866 SuspendableObject::trace(visitor); |
| 867 } | 867 } |
| 868 | 868 |
| 869 } // namespace blink | 869 } // namespace blink |
| OLD | NEW |