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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 const KURL& WebSocket::url() const | 415 const KURL& WebSocket::url() const |
416 { | 416 { |
417 return m_url; | 417 return m_url; |
418 } | 418 } |
419 | 419 |
420 WebSocket::State WebSocket::readyState() const | 420 WebSocket::State WebSocket::readyState() const |
421 { | 421 { |
422 return m_state; | 422 return m_state; |
423 } | 423 } |
424 | 424 |
425 unsigned long WebSocket::bufferedAmount() const | 425 unsigned WebSocket::bufferedAmount() const |
426 { | 426 { |
427 return saturateAdd(m_bufferedAmount, m_bufferedAmountAfterClose); | 427 return saturateAdd(m_bufferedAmount, m_bufferedAmountAfterClose); |
428 } | 428 } |
429 | 429 |
430 String WebSocket::protocol() const | 430 String WebSocket::protocol() const |
431 { | 431 { |
432 return m_subprotocol; | 432 return m_subprotocol; |
433 } | 433 } |
434 | 434 |
435 String WebSocket::extensions() const | 435 String WebSocket::extensions() const |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 static const size_t minimumPayloadSizeWithEightByteExtendedPayloadLength = 0
x10000; | 613 static const size_t minimumPayloadSizeWithEightByteExtendedPayloadLength = 0
x10000; |
614 size_t overhead = hybiBaseFramingOverhead + hybiMaskingKeyLength; | 614 size_t overhead = hybiBaseFramingOverhead + hybiMaskingKeyLength; |
615 if (payloadSize >= minimumPayloadSizeWithEightByteExtendedPayloadLength) | 615 if (payloadSize >= minimumPayloadSizeWithEightByteExtendedPayloadLength) |
616 overhead += 8; | 616 overhead += 8; |
617 else if (payloadSize >= minimumPayloadSizeWithTwoByteExtendedPayloadLength) | 617 else if (payloadSize >= minimumPayloadSizeWithTwoByteExtendedPayloadLength) |
618 overhead += 2; | 618 overhead += 2; |
619 return overhead; | 619 return overhead; |
620 } | 620 } |
621 | 621 |
622 } // namespace WebCore | 622 } // namespace WebCore |
OLD | NEW |