OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/html_viewer/web_socket_handle_impl.h" | 5 #include "components/html_viewer/web_socket_handle_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "components/html_viewer/blink_basic_type_converters.h" | 11 #include "components/html_viewer/blink_basic_type_converters.h" |
12 #include "mojo/services/network/public/cpp/web_socket_read_queue.h" | 12 #include "mojo/services/network/public/cpp/web_socket_read_queue.h" |
13 #include "mojo/services/network/public/cpp/web_socket_write_queue.h" | 13 #include "mojo/services/network/public/cpp/web_socket_write_queue.h" |
14 #include "mojo/services/network/public/interfaces/web_socket_factory.mojom.h" | 14 #include "mojo/services/network/public/interfaces/web_socket_factory.mojom.h" |
15 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 15 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
16 #include "third_party/WebKit/public/platform/WebSocketHandleClient.h" | 16 #include "third_party/WebKit/public/platform/WebSocketHandleClient.h" |
17 #include "third_party/WebKit/public/platform/WebString.h" | 17 #include "third_party/WebKit/public/platform/WebString.h" |
18 #include "third_party/WebKit/public/platform/WebURL.h" | 18 #include "third_party/WebKit/public/platform/WebURL.h" |
19 #include "third_party/WebKit/public/platform/WebVector.h" | 19 #include "third_party/WebKit/public/platform/WebVector.h" |
20 #include "third_party/mojo/src/mojo/public/cpp/bindings/binding.h" | |
21 | 20 |
22 using blink::WebSecurityOrigin; | 21 using blink::WebSecurityOrigin; |
23 using blink::WebSocketHandle; | 22 using blink::WebSocketHandle; |
24 using blink::WebSocketHandleClient; | 23 using blink::WebSocketHandleClient; |
25 using blink::WebString; | 24 using blink::WebString; |
26 using blink::WebURL; | 25 using blink::WebURL; |
27 using blink::WebVector; | 26 using blink::WebVector; |
28 | 27 |
29 using mojo::ConvertTo; | 28 using mojo::ConvertTo; |
30 using mojo::String; | 29 using mojo::String; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 const char* data) { | 215 const char* data) { |
217 web_socket_->Send(fin, ConvertTo<WebSocket::MessageType>(type), num_bytes); | 216 web_socket_->Send(fin, ConvertTo<WebSocket::MessageType>(type), num_bytes); |
218 } | 217 } |
219 | 218 |
220 void WebSocketHandleImpl::Disconnect() { | 219 void WebSocketHandleImpl::Disconnect() { |
221 did_close_ = true; | 220 did_close_ = true; |
222 client_.reset(); | 221 client_.reset(); |
223 } | 222 } |
224 | 223 |
225 } // namespace html_viewer | 224 } // namespace html_viewer |
OLD | NEW |