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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 { | 95 { |
96 } | 96 } |
97 | 97 |
98 void MainThreadWebSocketChannel::connect(const KURL& url, const String& protocol
) | 98 void MainThreadWebSocketChannel::connect(const KURL& url, const String& protocol
) |
99 { | 99 { |
100 LOG(Network, "MainThreadWebSocketChannel %p connect()", this); | 100 LOG(Network, "MainThreadWebSocketChannel %p connect()", this); |
101 ASSERT(!m_handle); | 101 ASSERT(!m_handle); |
102 ASSERT(!m_suspended); | 102 ASSERT(!m_suspended); |
103 m_handshake = adoptPtr(new WebSocketHandshake(url, protocol, m_document)); | 103 m_handshake = adoptPtr(new WebSocketHandshake(url, protocol, m_document)); |
104 m_handshake->reset(); | 104 m_handshake->reset(); |
105 if (m_deflateFramer.canDeflate()) | 105 m_handshake->addExtensionProcessor(m_deflateFramer.createExtensionProcessor(
)); |
106 m_handshake->addExtensionProcessor(m_deflateFramer.createExtensionProces
sor()); | |
107 if (m_identifier) | 106 if (m_identifier) |
108 InspectorInstrumentation::didCreateWebSocket(m_document, m_identifier, u
rl, m_document->url(), protocol); | 107 InspectorInstrumentation::didCreateWebSocket(m_document, m_identifier, u
rl, m_document->url(), protocol); |
109 ref(); | 108 ref(); |
110 m_handle = SocketStreamHandle::create(m_handshake->url(), this); | 109 m_handle = SocketStreamHandle::create(m_handshake->url(), this); |
111 } | 110 } |
112 | 111 |
113 String MainThreadWebSocketChannel::subprotocol() | 112 String MainThreadWebSocketChannel::subprotocol() |
114 { | 113 { |
115 LOG(Network, "MainThreadWebSocketChannel %p subprotocol()", this); | 114 LOG(Network, "MainThreadWebSocketChannel %p subprotocol()", this); |
116 if (!m_handshake || m_handshake->mode() != WebSocketHandshake::Connected) | 115 if (!m_handshake || m_handshake->mode() != WebSocketHandshake::Connected) |
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 return false; | 790 return false; |
792 } | 791 } |
793 | 792 |
794 Vector<char> frameData; | 793 Vector<char> frameData; |
795 frame.makeFrameData(frameData); | 794 frame.makeFrameData(frameData); |
796 | 795 |
797 return m_handle->send(frameData.data(), frameData.size()); | 796 return m_handle->send(frameData.data(), frameData.size()); |
798 } | 797 } |
799 | 798 |
800 } // namespace WebCore | 799 } // namespace WebCore |
OLD | NEW |