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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 if (utf8.length() > maxReasonSizeInBytes) { | 473 if (utf8.length() > maxReasonSizeInBytes) { |
474 exceptionState.throwDOMException(SyntaxError, "The message must not
be greater than " + String::number(maxReasonSizeInBytes) + " bytes."); | 474 exceptionState.throwDOMException(SyntaxError, "The message must not
be greater than " + String::number(maxReasonSizeInBytes) + " bytes."); |
475 return; | 475 return; |
476 } | 476 } |
477 } | 477 } |
478 | 478 |
479 if (m_state == CLOSING || m_state == CLOSED) | 479 if (m_state == CLOSING || m_state == CLOSED) |
480 return; | 480 return; |
481 if (m_state == CONNECTING) { | 481 if (m_state == CONNECTING) { |
482 m_state = CLOSING; | 482 m_state = CLOSING; |
483 m_channel->fail("WebSocket is closed before the connection is establishe
d.", WarningMessageLevel); | 483 m_channel->fail("WebSocket is closed before the connection is establishe
d.", WarningMessageLevel, String(), 0); |
484 return; | 484 return; |
485 } | 485 } |
486 m_state = CLOSING; | 486 m_state = CLOSING; |
487 if (m_channel) | 487 if (m_channel) |
488 m_channel->close(code, reason); | 488 m_channel->close(code, reason); |
489 } | 489 } |
490 | 490 |
491 const KURL& WebSocket::url() const | 491 const KURL& WebSocket::url() const |
492 { | 492 { |
493 return m_url; | 493 return m_url; |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 } | 681 } |
682 | 682 |
683 void WebSocket::trace(Visitor* visitor) | 683 void WebSocket::trace(Visitor* visitor) |
684 { | 684 { |
685 visitor->trace(m_channel); | 685 visitor->trace(m_channel); |
686 visitor->trace(m_eventQueue); | 686 visitor->trace(m_eventQueue); |
687 EventTargetWithInlineData::trace(visitor); | 687 EventTargetWithInlineData::trace(visitor); |
688 } | 688 } |
689 | 689 |
690 } // namespace WebCore | 690 } // namespace WebCore |
OLD | NEW |