| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 MainThreadWebSocketChannel::~MainThreadWebSocketChannel() | 87 MainThreadWebSocketChannel::~MainThreadWebSocketChannel() |
| 88 { | 88 { |
| 89 } | 89 } |
| 90 | 90 |
| 91 bool MainThreadWebSocketChannel::connect(const KURL& url, const String& protocol
) | 91 bool MainThreadWebSocketChannel::connect(const KURL& url, const String& protocol
) |
| 92 { | 92 { |
| 93 WTF_LOG(Network, "MainThreadWebSocketChannel %p connect()", this); | 93 WTF_LOG(Network, "MainThreadWebSocketChannel %p connect()", this); |
| 94 ASSERT(!m_handle); | 94 ASSERT(!m_handle); |
| 95 ASSERT(!m_suspended); | 95 ASSERT(!m_suspended); |
| 96 | 96 |
| 97 if (MixedContentChecker::shouldBlockWebSocket(m_document->frame(), url)) | 97 if (m_document->frame() && !m_document->frame()->loader().mixedContentChecke
r()->canConnectInsecureWebSocket(m_document->securityOrigin(), url)) |
| 98 return false; | 98 return false; |
| 99 if (MixedContentChecker::isMixedContent(m_document->securityOrigin(), url))
{ | 99 if (MixedContentChecker::isMixedContent(m_document->securityOrigin(), url))
{ |
| 100 String message = "Connecting to a non-secure WebSocket server from a sec
ure origin is deprecated."; | 100 String message = "Connecting to a non-secure WebSocket server from a sec
ure origin is deprecated."; |
| 101 m_document->addConsoleMessage(ConsoleMessage::create(JSMessageSource, Wa
rningMessageLevel, message)); | 101 m_document->addConsoleMessage(ConsoleMessage::create(JSMessageSource, Wa
rningMessageLevel, message)); |
| 102 } | 102 } |
| 103 | 103 |
| 104 m_handshake = new WebSocketHandshake(url, protocol, m_document); | 104 m_handshake = new WebSocketHandshake(url, protocol, m_document); |
| 105 m_handshake->reset(); | 105 m_handshake->reset(); |
| 106 m_handshake->addExtensionProcessor(m_perMessageDeflate.createExtensionProces
sor()); | 106 m_handshake->addExtensionProcessor(m_perMessageDeflate.createExtensionProces
sor()); |
| 107 m_handshake->addExtensionProcessor(m_deflateFramer.createExtensionProcessor(
)); | 107 m_handshake->addExtensionProcessor(m_deflateFramer.createExtensionProcessor(
)); |
| (...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 { | 856 { |
| 857 visitor->trace(m_document); | 857 visitor->trace(m_document); |
| 858 visitor->trace(m_client); | 858 visitor->trace(m_client); |
| 859 visitor->trace(m_handshake); | 859 visitor->trace(m_handshake); |
| 860 visitor->trace(m_handle); | 860 visitor->trace(m_handle); |
| 861 WebSocketChannel::trace(visitor); | 861 WebSocketChannel::trace(visitor); |
| 862 SocketStreamHandleClient::trace(visitor); | 862 SocketStreamHandleClient::trace(visitor); |
| 863 } | 863 } |
| 864 | 864 |
| 865 } // namespace blink | 865 } // namespace blink |
| OLD | NEW |