| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "core/loader/FrameLoader.h" | 43 #include "core/loader/FrameLoader.h" |
| 44 #include "core/loader/FrameLoaderClient.h" | 44 #include "core/loader/FrameLoaderClient.h" |
| 45 #include "core/loader/MixedContentChecker.h" | 45 #include "core/loader/MixedContentChecker.h" |
| 46 #include "modules/websockets/InspectorWebSocketEvents.h" | 46 #include "modules/websockets/InspectorWebSocketEvents.h" |
| 47 #include "modules/websockets/WebSocketChannelClient.h" | 47 #include "modules/websockets/WebSocketChannelClient.h" |
| 48 #include "modules/websockets/WebSocketFrame.h" | 48 #include "modules/websockets/WebSocketFrame.h" |
| 49 #include "platform/Logging.h" | 49 #include "platform/Logging.h" |
| 50 #include "platform/network/WebSocketHandshakeRequest.h" | 50 #include "platform/network/WebSocketHandshakeRequest.h" |
| 51 #include "platform/weborigin/SecurityOrigin.h" | 51 #include "platform/weborigin/SecurityOrigin.h" |
| 52 #include "public/platform/Platform.h" | 52 #include "public/platform/Platform.h" |
| 53 #include "public/platform/WebSecurityOrigin.h" |
| 53 #include "public/platform/WebSocketHandshakeRequestInfo.h" | 54 #include "public/platform/WebSocketHandshakeRequestInfo.h" |
| 54 #include "public/platform/WebSocketHandshakeResponseInfo.h" | 55 #include "public/platform/WebSocketHandshakeResponseInfo.h" |
| 55 #include "public/platform/WebString.h" | 56 #include "public/platform/WebString.h" |
| 56 #include "public/platform/WebURL.h" | 57 #include "public/platform/WebURL.h" |
| 57 #include "public/platform/WebVector.h" | 58 #include "public/platform/WebVector.h" |
| 58 | 59 |
| 59 using blink::WebSocketHandle; | 60 using blink::WebSocketHandle; |
| 60 | 61 |
| 61 namespace blink { | 62 namespace blink { |
| 62 | 63 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // it. | 154 // it. |
| 154 protocol.split(", ", true, protocols); | 155 protocol.split(", ", true, protocols); |
| 155 } | 156 } |
| 156 WebVector<WebString> webProtocols(protocols.size()); | 157 WebVector<WebString> webProtocols(protocols.size()); |
| 157 for (size_t i = 0; i < protocols.size(); ++i) { | 158 for (size_t i = 0; i < protocols.size(); ++i) { |
| 158 webProtocols[i] = protocols[i]; | 159 webProtocols[i] = protocols[i]; |
| 159 } | 160 } |
| 160 | 161 |
| 161 if (executionContext()->isDocument() && document()->frame()) | 162 if (executionContext()->isDocument() && document()->frame()) |
| 162 document()->frame()->loader().client()->dispatchWillOpenWebSocket(m_hand
le.get()); | 163 document()->frame()->loader().client()->dispatchWillOpenWebSocket(m_hand
le.get()); |
| 163 m_handle->connect(url, webProtocols, *executionContext()->securityOrigin(),
this); | 164 m_handle->connect(url, webProtocols, WebSecurityOrigin(executionContext()->s
ecurityOrigin()), this); |
| 164 | 165 |
| 165 flowControlIfNecessary(); | 166 flowControlIfNecessary(); |
| 166 if (m_identifier) { | 167 if (m_identifier) { |
| 167 TRACE_EVENT_INSTANT1("devtools.timeline", "WebSocketCreate", TRACE_EVENT
_SCOPE_THREAD, "data", InspectorWebSocketCreateEvent::data(document(), m_identif
ier, url, protocol)); | 168 TRACE_EVENT_INSTANT1("devtools.timeline", "WebSocketCreate", TRACE_EVENT
_SCOPE_THREAD, "data", InspectorWebSocketCreateEvent::data(document(), m_identif
ier, url, protocol)); |
| 168 InspectorInstrumentation::didCreateWebSocket(document(), m_identifier, u
rl, protocol); | 169 InspectorInstrumentation::didCreateWebSocket(document(), m_identifier, u
rl, protocol); |
| 169 } | 170 } |
| 170 return true; | 171 return true; |
| 171 } | 172 } |
| 172 | 173 |
| 173 void DocumentWebSocketChannel::send(const CString& message) | 174 void DocumentWebSocketChannel::send(const CString& message) |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 | 576 |
| 576 DEFINE_TRACE(DocumentWebSocketChannel) | 577 DEFINE_TRACE(DocumentWebSocketChannel) |
| 577 { | 578 { |
| 578 visitor->trace(m_blobLoader); | 579 visitor->trace(m_blobLoader); |
| 579 visitor->trace(m_client); | 580 visitor->trace(m_client); |
| 580 WebSocketChannel::trace(visitor); | 581 WebSocketChannel::trace(visitor); |
| 581 ContextLifecycleObserver::trace(visitor); | 582 ContextLifecycleObserver::trace(visitor); |
| 582 } | 583 } |
| 583 | 584 |
| 584 } // namespace blink | 585 } // namespace blink |
| OLD | NEW |