| 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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 // reason might contain unpaired surrogates. Reconstruct it from | 503 // reason might contain unpaired surrogates. Reconstruct it from |
| 504 // utf8. | 504 // utf8. |
| 505 cleansedReason = String::fromUTF8(utf8.data(), utf8.length()); | 505 cleansedReason = String::fromUTF8(utf8.data(), utf8.length()); |
| 506 } | 506 } |
| 507 } | 507 } |
| 508 | 508 |
| 509 if (m_state == CLOSING || m_state == CLOSED) | 509 if (m_state == CLOSING || m_state == CLOSED) |
| 510 return; | 510 return; |
| 511 if (m_state == CONNECTING) { | 511 if (m_state == CONNECTING) { |
| 512 m_state = CLOSING; | 512 m_state = CLOSING; |
| 513 m_channel->fail("WebSocket is closed before the connection is establishe
d.", WarningMessageLevel, String(), 0); | 513 m_channel->fail("WebSocket is closed before the connection is establishe
d.", WarningMessageLevel, nullptr); |
| 514 return; | 514 return; |
| 515 } | 515 } |
| 516 m_state = CLOSING; | 516 m_state = CLOSING; |
| 517 if (m_channel) | 517 if (m_channel) |
| 518 m_channel->close(code, cleansedReason); | 518 m_channel->close(code, cleansedReason); |
| 519 } | 519 } |
| 520 | 520 |
| 521 const KURL& DOMWebSocket::url() const | 521 const KURL& DOMWebSocket::url() const |
| 522 { | 522 { |
| 523 return m_url; | 523 return m_url; |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 714 DEFINE_TRACE(DOMWebSocket) | 714 DEFINE_TRACE(DOMWebSocket) |
| 715 { | 715 { |
| 716 visitor->trace(m_channel); | 716 visitor->trace(m_channel); |
| 717 visitor->trace(m_eventQueue); | 717 visitor->trace(m_eventQueue); |
| 718 WebSocketChannelClient::trace(visitor); | 718 WebSocketChannelClient::trace(visitor); |
| 719 EventTargetWithInlineData::trace(visitor); | 719 EventTargetWithInlineData::trace(visitor); |
| 720 ActiveDOMObject::trace(visitor); | 720 ActiveDOMObject::trace(visitor); |
| 721 } | 721 } |
| 722 | 722 |
| 723 } // namespace blink | 723 } // namespace blink |
| OLD | NEW |