OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "content/common/websocket.h" | 12 #include "content/common/websocket.h" |
13 | 13 |
14 class GURL; | 14 class GURL; |
15 | 15 |
16 namespace net { | 16 namespace net { |
17 class WebSocketChannel; | 17 class WebSocketChannel; |
18 class URLRequestContext; | 18 class URLRequestContext; |
19 } // namespace net | 19 } // namespace net |
20 | 20 |
21 namespace IPC { | 21 namespace IPC { |
22 class Message; | 22 class Message; |
23 } // namespace IPC | 23 } // namespace IPC |
24 | 24 |
25 namespace content { | 25 namespace content { |
26 | 26 |
27 class WebSocketDispatcherHost; | 27 class WebSocketDispatcherHost; |
28 | 28 |
29 // Host of WebSocketChannel. The lifetime of an instance of this class is | 29 // Host of net::WebSocketChannel. The lifetime of an instance of this class is |
30 // completely controlled by the WebSocketDispatcherHost. | 30 // completely controlled by the WebSocketDispatcherHost object. |
31 class WebSocketHost { | 31 class WebSocketHost { |
32 public: | 32 public: |
33 WebSocketHost(int routing_id, | 33 WebSocketHost(int routing_id, |
34 WebSocketDispatcherHost* dispatcher, | 34 WebSocketDispatcherHost* dispatcher, |
35 net::URLRequestContext* url_request_context); | 35 net::URLRequestContext* url_request_context); |
36 ~WebSocketHost(); | 36 ~WebSocketHost(); |
37 | 37 |
38 // General message dispatch. WebSocketDispatcherHost::OnMessageReceived | 38 // General message dispatch. WebSocketDispatcherHost::OnMessageReceived |
39 // delegates to this method after looking up the |routing_id|. | 39 // delegates to this method after looking up the |routing_id|. |
40 bool OnMessageReceived(const IPC::Message& message, bool* message_was_ok); | 40 bool OnMessageReceived(const IPC::Message& message, bool* message_was_ok); |
(...skipping 19 matching lines...) Expand all Loading... |
60 | 60 |
61 // The ID used to route messages. | 61 // The ID used to route messages. |
62 int routing_id_; | 62 int routing_id_; |
63 | 63 |
64 DISALLOW_COPY_AND_ASSIGN(WebSocketHost); | 64 DISALLOW_COPY_AND_ASSIGN(WebSocketHost); |
65 }; | 65 }; |
66 | 66 |
67 } // namespace content | 67 } // namespace content |
68 | 68 |
69 #endif // CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_HOST_H_ | 69 #endif // CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_HOST_H_ |
OLD | NEW |