| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 132 |
| 133 WebSocket::WebSocket(ScriptExecutionContext* context) | 133 WebSocket::WebSocket(ScriptExecutionContext* context) |
| 134 : ActiveDOMObject(context) | 134 : ActiveDOMObject(context) |
| 135 , m_state(CONNECTING) | 135 , m_state(CONNECTING) |
| 136 , m_bufferedAmount(0) | 136 , m_bufferedAmount(0) |
| 137 , m_bufferedAmountAfterClose(0) | 137 , m_bufferedAmountAfterClose(0) |
| 138 , m_binaryType(BinaryTypeBlob) | 138 , m_binaryType(BinaryTypeBlob) |
| 139 , m_subprotocol("") | 139 , m_subprotocol("") |
| 140 , m_extensions("") | 140 , m_extensions("") |
| 141 { | 141 { |
| 142 ScriptWrappable::init(this); |
| 142 } | 143 } |
| 143 | 144 |
| 144 WebSocket::~WebSocket() | 145 WebSocket::~WebSocket() |
| 145 { | 146 { |
| 146 if (m_channel) | 147 if (m_channel) |
| 147 m_channel->disconnect(); | 148 m_channel->disconnect(); |
| 148 } | 149 } |
| 149 | 150 |
| 150 PassRefPtr<WebSocket> WebSocket::create(ScriptExecutionContext* context) | 151 PassRefPtr<WebSocket> WebSocket::create(ScriptExecutionContext* context) |
| 151 { | 152 { |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 static const size_t minimumPayloadSizeWithEightByteExtendedPayloadLength = 0
x10000; | 600 static const size_t minimumPayloadSizeWithEightByteExtendedPayloadLength = 0
x10000; |
| 600 size_t overhead = hybiBaseFramingOverhead + hybiMaskingKeyLength; | 601 size_t overhead = hybiBaseFramingOverhead + hybiMaskingKeyLength; |
| 601 if (payloadSize >= minimumPayloadSizeWithEightByteExtendedPayloadLength) | 602 if (payloadSize >= minimumPayloadSizeWithEightByteExtendedPayloadLength) |
| 602 overhead += 8; | 603 overhead += 8; |
| 603 else if (payloadSize >= minimumPayloadSizeWithTwoByteExtendedPayloadLength) | 604 else if (payloadSize >= minimumPayloadSizeWithTwoByteExtendedPayloadLength) |
| 604 overhead += 2; | 605 overhead += 2; |
| 605 return overhead; | 606 return overhead; |
| 606 } | 607 } |
| 607 | 608 |
| 608 } // namespace WebCore | 609 } // namespace WebCore |
| OLD | NEW |