| 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 } | 270 } |
| 271 | 271 |
| 272 if (exceptionState.hadException()) | 272 if (exceptionState.hadException()) |
| 273 return nullptr; | 273 return nullptr; |
| 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 UseCounter::count(executionContext(), UseCounter::WebSocket); |
| 280 | 281 |
| 281 WTF_LOG(Network, "WebSocket %p connect() url='%s'", this, url.utf8().data())
; | 282 WTF_LOG(Network, "WebSocket %p connect() url='%s'", this, url.utf8().data())
; |
| 282 m_url = KURL(KURL(), url); | 283 m_url = KURL(KURL(), url); |
| 283 | 284 |
| 284 if (executionContext()->securityContext().insecureRequestsPolicy() == Securi
tyContext::InsecureRequestsUpgrade && m_url.protocol() == "ws") { | 285 if (executionContext()->securityContext().insecureRequestsPolicy() == Securi
tyContext::InsecureRequestsUpgrade && m_url.protocol() == "ws") { |
| 285 UseCounter::count(executionContext(), UseCounter::UpgradeInsecureRequest
sUpgradedRequest); | 286 UseCounter::count(executionContext(), UseCounter::UpgradeInsecureRequest
sUpgradedRequest); |
| 286 m_url.setProtocol("wss"); | 287 m_url.setProtocol("wss"); |
| 287 if (m_url.port() == 80) | 288 if (m_url.port() == 80) |
| 288 m_url.setPort(443); | 289 m_url.setPort(443); |
| 289 } | 290 } |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 DEFINE_TRACE(DOMWebSocket) | 695 DEFINE_TRACE(DOMWebSocket) |
| 695 { | 696 { |
| 696 visitor->trace(m_channel); | 697 visitor->trace(m_channel); |
| 697 visitor->trace(m_eventQueue); | 698 visitor->trace(m_eventQueue); |
| 698 WebSocketChannelClient::trace(visitor); | 699 WebSocketChannelClient::trace(visitor); |
| 699 RefCountedGarbageCollectedEventTargetWithInlineData<DOMWebSocket>::trace(vis
itor); | 700 RefCountedGarbageCollectedEventTargetWithInlineData<DOMWebSocket>::trace(vis
itor); |
| 700 ActiveDOMObject::trace(visitor); | 701 ActiveDOMObject::trace(visitor); |
| 701 } | 702 } |
| 702 | 703 |
| 703 } // namespace blink | 704 } // namespace blink |
| OLD | NEW |