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_DISPATCHER_HOST_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_DISPATCHER_HOST_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_DISPATCHER_HOST_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_DISPATCHER_HOST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 int process_id, | 49 int process_id, |
50 const GetRequestContextCallback& get_context_callback); | 50 const GetRequestContextCallback& get_context_callback); |
51 | 51 |
52 // For testing. Specify a factory method that creates mock version of | 52 // For testing. Specify a factory method that creates mock version of |
53 // WebSocketHost. | 53 // WebSocketHost. |
54 WebSocketDispatcherHost(int process_id, | 54 WebSocketDispatcherHost(int process_id, |
55 const GetRequestContextCallback& get_context_callback, | 55 const GetRequestContextCallback& get_context_callback, |
56 const WebSocketHostFactory& websocket_host_factory); | 56 const WebSocketHostFactory& websocket_host_factory); |
57 | 57 |
58 // BrowserMessageFilter: | 58 // BrowserMessageFilter: |
59 virtual bool OnMessageReceived(const IPC::Message& message, | 59 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
60 bool* message_was_ok) OVERRIDE; | |
61 | 60 |
62 // The following methods are used by WebSocketHost::EventInterface to send | 61 // The following methods are used by WebSocketHost::EventInterface to send |
63 // IPCs from the browser to the renderer or child process. Any of them may | 62 // IPCs from the browser to the renderer or child process. Any of them may |
64 // return WEBSOCKET_HOST_DELETED and delete the WebSocketHost on failure, | 63 // return WEBSOCKET_HOST_DELETED and delete the WebSocketHost on failure, |
65 // leading to the WebSocketChannel and EventInterface also being deleted. | 64 // leading to the WebSocketChannel and EventInterface also being deleted. |
66 | 65 |
67 // Sends a WebSocketMsg_AddChannelResponse IPC, and then deletes and | 66 // Sends a WebSocketMsg_AddChannelResponse IPC, and then deletes and |
68 // unregisters the WebSocketHost if |fail| is true. | 67 // unregisters the WebSocketHost if |fail| is true. |
69 WebSocketHostState SendAddChannelResponse( | 68 WebSocketHostState SendAddChannelResponse( |
70 int routing_id, | 69 int routing_id, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 GetRequestContextCallback get_context_callback_; | 144 GetRequestContextCallback get_context_callback_; |
146 | 145 |
147 WebSocketHostFactory websocket_host_factory_; | 146 WebSocketHostFactory websocket_host_factory_; |
148 | 147 |
149 DISALLOW_COPY_AND_ASSIGN(WebSocketDispatcherHost); | 148 DISALLOW_COPY_AND_ASSIGN(WebSocketDispatcherHost); |
150 }; | 149 }; |
151 | 150 |
152 } // namespace content | 151 } // namespace content |
153 | 152 |
154 #endif // CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_DISPATCHER_HOST_H_ | 153 #endif // CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_DISPATCHER_HOST_H_ |
OLD | NEW |