| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 25 matching lines...) Expand all Loading... |
| 36 #include "core/fileapi/FileReaderLoader.h" | 36 #include "core/fileapi/FileReaderLoader.h" |
| 37 #include "core/fileapi/FileReaderLoaderClient.h" | 37 #include "core/fileapi/FileReaderLoaderClient.h" |
| 38 #include "core/inspector/InspectorInstrumentation.h" | 38 #include "core/inspector/InspectorInstrumentation.h" |
| 39 #include "core/loader/UniqueIdentifier.h" | 39 #include "core/loader/UniqueIdentifier.h" |
| 40 #include "modules/websockets/WebSocketChannelClient.h" | 40 #include "modules/websockets/WebSocketChannelClient.h" |
| 41 #include "modules/websockets/WebSocketFrame.h" | 41 #include "modules/websockets/WebSocketFrame.h" |
| 42 #include "platform/Logging.h" | 42 #include "platform/Logging.h" |
| 43 #include "platform/network/WebSocketHandshakeRequest.h" | 43 #include "platform/network/WebSocketHandshakeRequest.h" |
| 44 #include "platform/weborigin/SecurityOrigin.h" | 44 #include "platform/weborigin/SecurityOrigin.h" |
| 45 #include "public/platform/Platform.h" | 45 #include "public/platform/Platform.h" |
| 46 #include "public/platform/WebSerializedOrigin.h" |
| 46 #include "public/platform/WebSocketHandshakeRequestInfo.h" | 47 #include "public/platform/WebSocketHandshakeRequestInfo.h" |
| 47 #include "public/platform/WebSocketHandshakeResponseInfo.h" | 48 #include "public/platform/WebSocketHandshakeResponseInfo.h" |
| 48 #include "public/platform/WebString.h" | 49 #include "public/platform/WebString.h" |
| 49 #include "public/platform/WebURL.h" | 50 #include "public/platform/WebURL.h" |
| 50 #include "public/platform/WebVector.h" | 51 #include "public/platform/WebVector.h" |
| 51 | 52 |
| 52 using blink::WebSocketHandle; | 53 using blink::WebSocketHandle; |
| 53 | 54 |
| 54 namespace WebCore { | 55 namespace WebCore { |
| 55 | 56 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // empty. | 130 // empty. |
| 130 if (!protocol.isEmpty()) { | 131 if (!protocol.isEmpty()) { |
| 131 // Since protocol is already verified and escaped, we can simply split | 132 // Since protocol is already verified and escaped, we can simply split |
| 132 // it. | 133 // it. |
| 133 protocol.split(", ", true, protocols); | 134 protocol.split(", ", true, protocols); |
| 134 } | 135 } |
| 135 blink::WebVector<blink::WebString> webProtocols(protocols.size()); | 136 blink::WebVector<blink::WebString> webProtocols(protocols.size()); |
| 136 for (size_t i = 0; i < protocols.size(); ++i) { | 137 for (size_t i = 0; i < protocols.size(); ++i) { |
| 137 webProtocols[i] = protocols[i]; | 138 webProtocols[i] = protocols[i]; |
| 138 } | 139 } |
| 139 String origin = executionContext()->securityOrigin()->toString(); | 140 m_handle->connect(url, webProtocols, *executionContext()->securityOrigin(),
this); |
| 140 m_handle->connect(url, webProtocols, origin, this); | |
| 141 flowControlIfNecessary(); | 141 flowControlIfNecessary(); |
| 142 if (m_identifier) | 142 if (m_identifier) |
| 143 InspectorInstrumentation::didCreateWebSocket(document(), m_identifier, u
rl, protocol); | 143 InspectorInstrumentation::didCreateWebSocket(document(), m_identifier, u
rl, protocol); |
| 144 } | 144 } |
| 145 | 145 |
| 146 String NewWebSocketChannelImpl::subprotocol() | 146 String NewWebSocketChannelImpl::subprotocol() |
| 147 { | 147 { |
| 148 WTF_LOG(Network, "NewWebSocketChannelImpl %p subprotocol()", this); | 148 WTF_LOG(Network, "NewWebSocketChannelImpl %p subprotocol()", this); |
| 149 return m_subprotocol; | 149 return m_subprotocol; |
| 150 } | 150 } |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 if (errorCode == FileError::ABORT_ERR) { | 491 if (errorCode == FileError::ABORT_ERR) { |
| 492 // The error is caused by cancel(). | 492 // The error is caused by cancel(). |
| 493 return; | 493 return; |
| 494 } | 494 } |
| 495 // FIXME: Generate human-friendly reason message. | 495 // FIXME: Generate human-friendly reason message. |
| 496 failAsError("Failed to load Blob: error code = " + String::number(errorCode)
); | 496 failAsError("Failed to load Blob: error code = " + String::number(errorCode)
); |
| 497 // |this| can be deleted here. | 497 // |this| can be deleted here. |
| 498 } | 498 } |
| 499 | 499 |
| 500 } // namespace WebCore | 500 } // namespace WebCore |
| OLD | NEW |