| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 return webSocket; | 275 return webSocket; |
| 276 } | 276 } |
| 277 | 277 |
| 278 void DOMWebSocket::connect(const String& url, const Vector<String>& protocols, E
xceptionState& exceptionState) | 278 void DOMWebSocket::connect(const String& url, const Vector<String>& protocols, E
xceptionState& exceptionState) |
| 279 { | 279 { |
| 280 | 280 |
| 281 WTF_LOG(Network, "WebSocket %p connect() url='%s'", this, url.utf8().data())
; | 281 WTF_LOG(Network, "WebSocket %p connect() url='%s'", this, url.utf8().data())
; |
| 282 m_url = KURL(KURL(), url); | 282 m_url = KURL(KURL(), url); |
| 283 | 283 |
| 284 if (executionContext()->securityContext().insecureContentPolicy() == Securit
yContext::InsecureContentUpgrade && m_url.protocol() == "ws") { | 284 if (executionContext()->securityContext().insecureRequestsPolicy() == Securi
tyContext::InsecureRequestsUpgrade && m_url.protocol() == "ws") { |
| 285 m_url.setProtocol("wss"); | 285 m_url.setProtocol("wss"); |
| 286 if (m_url.port() == 80) | 286 if (m_url.port() == 80) |
| 287 m_url.setPort(443); | 287 m_url.setPort(443); |
| 288 } | 288 } |
| 289 | 289 |
| 290 if (!m_url.isValid()) { | 290 if (!m_url.isValid()) { |
| 291 m_state = CLOSED; | 291 m_state = CLOSED; |
| 292 exceptionState.throwDOMException(SyntaxError, "The URL '" + url + "' is
invalid."); | 292 exceptionState.throwDOMException(SyntaxError, "The URL '" + url + "' is
invalid."); |
| 293 return; | 293 return; |
| 294 } | 294 } |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 DEFINE_TRACE(DOMWebSocket) | 679 DEFINE_TRACE(DOMWebSocket) |
| 680 { | 680 { |
| 681 visitor->trace(m_channel); | 681 visitor->trace(m_channel); |
| 682 visitor->trace(m_eventQueue); | 682 visitor->trace(m_eventQueue); |
| 683 WebSocketChannelClient::trace(visitor); | 683 WebSocketChannelClient::trace(visitor); |
| 684 RefCountedGarbageCollectedEventTargetWithInlineData<DOMWebSocket>::trace(vis
itor); | 684 RefCountedGarbageCollectedEventTargetWithInlineData<DOMWebSocket>::trace(vis
itor); |
| 685 ActiveDOMObject::trace(visitor); | 685 ActiveDOMObject::trace(visitor); |
| 686 } | 686 } |
| 687 | 687 |
| 688 } // namespace blink | 688 } // namespace blink |
| OLD | NEW |