Chromium Code Reviews| 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 22 matching lines...) Expand all Loading... | |
| 33 #include "modules/websockets/WebSocket.h" | 33 #include "modules/websockets/WebSocket.h" |
| 34 | 34 |
| 35 #include "bindings/v8/ScriptController.h" | 35 #include "bindings/v8/ScriptController.h" |
| 36 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
| 37 #include "core/dom/Event.h" | 37 #include "core/dom/Event.h" |
| 38 #include "core/dom/EventException.h" | 38 #include "core/dom/EventException.h" |
| 39 #include "core/dom/EventListener.h" | 39 #include "core/dom/EventListener.h" |
| 40 #include "core/dom/EventNames.h" | 40 #include "core/dom/EventNames.h" |
| 41 #include "core/dom/ExceptionCode.h" | 41 #include "core/dom/ExceptionCode.h" |
| 42 #include "core/dom/MessageEvent.h" | 42 #include "core/dom/MessageEvent.h" |
| 43 #include "core/dom/ScriptExecutionContext.h" | 43 #include "core/dom/ScriptExecutionContext.h" |
|
tyoshino (SeeGerritForStatus)
2013/05/01 08:03:23
add core/page/ConsoleTypes.h
yhirano
2013/05/01 09:31:44
Done.
| |
| 44 #include "core/fileapi/Blob.h" | 44 #include "core/fileapi/Blob.h" |
| 45 #include "core/inspector/ScriptCallStack.h" | 45 #include "core/inspector/ScriptCallStack.h" |
| 46 #include "core/page/ContentSecurityPolicy.h" | 46 #include "core/page/ContentSecurityPolicy.h" |
| 47 #include "core/page/DOMWindow.h" | 47 #include "core/page/DOMWindow.h" |
| 48 #include "core/page/Frame.h" | 48 #include "core/page/Frame.h" |
| 49 #include "core/page/SecurityOrigin.h" | 49 #include "core/page/SecurityOrigin.h" |
| 50 #include "core/platform/Logging.h" | 50 #include "core/platform/Logging.h" |
| 51 #include "core/platform/network/BlobData.h" | 51 #include "core/platform/network/BlobData.h" |
| 52 #include "modules/websockets/CloseEvent.h" | 52 #include "modules/websockets/CloseEvent.h" |
| 53 #include "modules/websockets/WebSocketChannel.h" | 53 #include "modules/websockets/WebSocketChannel.h" |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 385 scriptExecutionContext()->addConsoleMessage(JSMessageSource, ErrorMe ssageLevel, "WebSocket close message is too long."); | 385 scriptExecutionContext()->addConsoleMessage(JSMessageSource, ErrorMe ssageLevel, "WebSocket close message is too long."); |
| 386 ec = SYNTAX_ERR; | 386 ec = SYNTAX_ERR; |
| 387 return; | 387 return; |
| 388 } | 388 } |
| 389 } | 389 } |
| 390 | 390 |
| 391 if (m_state == CLOSING || m_state == CLOSED) | 391 if (m_state == CLOSING || m_state == CLOSED) |
| 392 return; | 392 return; |
| 393 if (m_state == CONNECTING) { | 393 if (m_state == CONNECTING) { |
| 394 m_state = CLOSING; | 394 m_state = CLOSING; |
| 395 m_channel->fail("WebSocket is closed before the connection is establishe d."); | 395 m_channel->fail("WebSocket is closed before the connection is establishe d.", WarningMessageLevel); |
| 396 return; | 396 return; |
| 397 } | 397 } |
| 398 m_state = CLOSING; | 398 m_state = CLOSING; |
| 399 if (m_channel) | 399 if (m_channel) |
| 400 m_channel->close(code, reason); | 400 m_channel->close(code, reason); |
| 401 } | 401 } |
| 402 | 402 |
| 403 const KURL& WebSocket::url() const | 403 const KURL& WebSocket::url() const |
| 404 { | 404 { |
| 405 return m_url; | 405 return m_url; |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 597 static const size_t minimumPayloadSizeWithEightByteExtendedPayloadLength = 0 x10000; | 597 static const size_t minimumPayloadSizeWithEightByteExtendedPayloadLength = 0 x10000; |
| 598 size_t overhead = hybiBaseFramingOverhead + hybiMaskingKeyLength; | 598 size_t overhead = hybiBaseFramingOverhead + hybiMaskingKeyLength; |
| 599 if (payloadSize >= minimumPayloadSizeWithEightByteExtendedPayloadLength) | 599 if (payloadSize >= minimumPayloadSizeWithEightByteExtendedPayloadLength) |
| 600 overhead += 8; | 600 overhead += 8; |
| 601 else if (payloadSize >= minimumPayloadSizeWithTwoByteExtendedPayloadLength) | 601 else if (payloadSize >= minimumPayloadSizeWithTwoByteExtendedPayloadLength) |
| 602 overhead += 2; | 602 overhead += 2; |
| 603 return overhead; | 603 return overhead; |
| 604 } | 604 } |
| 605 | 605 |
| 606 } // namespace WebCore | 606 } // namespace WebCore |
| OLD | NEW |