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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "wtf/ArrayBuffer.h" | 44 #include "wtf/ArrayBuffer.h" |
45 | 45 |
46 using namespace WebCore; | 46 using namespace WebCore; |
47 | 47 |
48 namespace blink { | 48 namespace blink { |
49 | 49 |
50 WebSocketImpl::WebSocketImpl(const WebDocument& document, WebSocketClient* clien
t) | 50 WebSocketImpl::WebSocketImpl(const WebDocument& document, WebSocketClient* clien
t) |
51 : m_client(client) | 51 : m_client(client) |
52 , m_binaryType(BinaryTypeBlob) | 52 , m_binaryType(BinaryTypeBlob) |
53 { | 53 { |
54 RefPtr<Document> coreDocument = PassRefPtr<Document>(document); | 54 RefPtrWillBeRawPtr<Document> coreDocument = PassRefPtrWillBeRawPtr<Document>
(document); |
55 if (RuntimeEnabledFeatures::experimentalWebSocketEnabled()) { | 55 if (RuntimeEnabledFeatures::experimentalWebSocketEnabled()) { |
56 m_private = NewWebSocketChannelImpl::create(coreDocument.get(), this); | 56 m_private = NewWebSocketChannelImpl::create(coreDocument.get(), this); |
57 } else { | 57 } else { |
58 m_private = MainThreadWebSocketChannel::create(coreDocument.get(), this)
; | 58 m_private = MainThreadWebSocketChannel::create(coreDocument.get(), this)
; |
59 } | 59 } |
60 } | 60 } |
61 | 61 |
62 WebSocketImpl::~WebSocketImpl() | 62 WebSocketImpl::~WebSocketImpl() |
63 { | 63 { |
64 m_private->disconnect(); | 64 m_private->disconnect(); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 { | 159 { |
160 m_client->didStartClosingHandshake(); | 160 m_client->didStartClosingHandshake(); |
161 } | 161 } |
162 | 162 |
163 void WebSocketImpl::didClose(unsigned long bufferedAmount, ClosingHandshakeCompl
etionStatus status, unsigned short code, const String& reason) | 163 void WebSocketImpl::didClose(unsigned long bufferedAmount, ClosingHandshakeCompl
etionStatus status, unsigned short code, const String& reason) |
164 { | 164 { |
165 m_client->didClose(bufferedAmount, static_cast<WebSocketClient::ClosingHands
hakeCompletionStatus>(status), code, WebString(reason)); | 165 m_client->didClose(bufferedAmount, static_cast<WebSocketClient::ClosingHands
hakeCompletionStatus>(status), code, WebString(reason)); |
166 } | 166 } |
167 | 167 |
168 } // namespace blink | 168 } // namespace blink |
OLD | NEW |