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 #ifndef COMPONENTS_HTML_VIEWER_WEB_SOCKET_HANDLE_IMPL_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_WEB_SOCKET_HANDLE_IMPL_H_ |
6 #define COMPONENTS_HTML_VIEWER_WEB_SOCKET_HANDLE_IMPL_H_ | 6 #define COMPONENTS_HTML_VIEWER_WEB_SOCKET_HANDLE_IMPL_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "mojo/message_pump/handle_watcher.h" | 10 #include "mojo/message_pump/handle_watcher.h" |
11 #include "mojo/services/network/public/interfaces/web_socket.mojom.h" | 11 #include "mojo/services/network/public/interfaces/web_socket.mojom.h" |
12 #include "third_party/WebKit/public/platform/WebSocketHandle.h" | 12 #include "third_party/WebKit/public/platform/WebSocketHandle.h" |
13 | 13 |
14 namespace mojo { | 14 namespace mojo { |
15 class NetworkService; | 15 class WebSocketFactory; |
16 class WebSocketWriteQueue; | 16 class WebSocketWriteQueue; |
17 } | 17 } |
18 | 18 |
19 namespace html_viewer { | 19 namespace html_viewer { |
20 | 20 |
21 class WebSocketClientImpl; | 21 class WebSocketClientImpl; |
22 | 22 |
23 // Implements WebSocketHandle by talking to the mojo WebSocket interface. | 23 // Implements WebSocketHandle by talking to the mojo WebSocket interface. |
24 class WebSocketHandleImpl : public blink::WebSocketHandle { | 24 class WebSocketHandleImpl : public blink::WebSocketHandle { |
25 public: | 25 public: |
26 explicit WebSocketHandleImpl(mojo::NetworkService* network_service); | 26 explicit WebSocketHandleImpl(mojo::WebSocketFactory* factory); |
27 | 27 |
28 private: | 28 private: |
29 friend class WebSocketClientImpl; | 29 friend class WebSocketClientImpl; |
30 | 30 |
31 virtual ~WebSocketHandleImpl(); | 31 virtual ~WebSocketHandleImpl(); |
32 | 32 |
33 // blink::WebSocketHandle methods: | 33 // blink::WebSocketHandle methods: |
34 virtual void connect(const blink::WebURL& url, | 34 virtual void connect(const blink::WebURL& url, |
35 const blink::WebVector<blink::WebString>& protocols, | 35 const blink::WebVector<blink::WebString>& protocols, |
36 const blink::WebSecurityOrigin& origin, | 36 const blink::WebSecurityOrigin& origin, |
(...skipping 17 matching lines...) Expand all Loading... |
54 scoped_ptr<mojo::WebSocketWriteQueue> write_queue_; | 54 scoped_ptr<mojo::WebSocketWriteQueue> write_queue_; |
55 // True if close() was called. | 55 // True if close() was called. |
56 bool did_close_; | 56 bool did_close_; |
57 | 57 |
58 DISALLOW_COPY_AND_ASSIGN(WebSocketHandleImpl); | 58 DISALLOW_COPY_AND_ASSIGN(WebSocketHandleImpl); |
59 }; | 59 }; |
60 | 60 |
61 } // namespace html_viewer | 61 } // namespace html_viewer |
62 | 62 |
63 #endif // COMPONENTS_HTML_VIEWER_WEB_SOCKET_HANDLE_IMPL_H_ | 63 #endif // COMPONENTS_HTML_VIEWER_WEB_SOCKET_HANDLE_IMPL_H_ |
OLD | NEW |