Chromium Code Reviews| 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_CHILD_WEBSOCKET_DISPATCHER_H_ | 5 #ifndef CONTENT_CHILD_WEBSOCKET_DISPATCHER_H_ |
| 6 #define CONTENT_CHILD_WEBSOCKET_DISPATCHER_H_ | 6 #define CONTENT_CHILD_WEBSOCKET_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 WebSocketDispatcher(); | 27 WebSocketDispatcher(); |
| 28 ~WebSocketDispatcher() override; | 28 ~WebSocketDispatcher() override; |
| 29 | 29 |
| 30 // Returns a unique channel id | 30 // Returns a unique channel id |
| 31 int AddBridge(WebSocketBridge* bridge); | 31 int AddBridge(WebSocketBridge* bridge); |
| 32 void RemoveBridge(int channel_id); | 32 void RemoveBridge(int channel_id); |
| 33 | 33 |
| 34 // IPC::Listener implementation. | 34 // IPC::Listener implementation. |
| 35 bool OnMessageReceived(const IPC::Message& msg) override; | 35 bool OnMessageReceived(const IPC::Message& msg) override; |
| 36 | 36 |
| 37 bool CanHandleMessage(const IPC::Message& msg) const; | |
|
yhirano
2016/05/26 04:39:15
Can you make this function static because this fun
hajimehoshi
2016/05/26 07:30:44
Done.
| |
| 38 | |
| 37 private: | 39 private: |
| 38 WebSocketBridge* GetBridge(int channel_id, uint32_t type); | 40 WebSocketBridge* GetBridge(int channel_id, uint32_t type); |
| 39 | 41 |
| 40 std::map<int, WebSocketBridge*> bridges_; | 42 std::map<int, WebSocketBridge*> bridges_; |
| 41 int channel_id_max_; | 43 int channel_id_max_; |
| 42 | 44 |
| 43 DISALLOW_COPY_AND_ASSIGN(WebSocketDispatcher); | 45 DISALLOW_COPY_AND_ASSIGN(WebSocketDispatcher); |
| 44 }; | 46 }; |
| 45 | 47 |
| 46 } // namespace content | 48 } // namespace content |
| 47 | 49 |
| 48 #endif // CONTENT_CHILD_WEBSOCKET_DISPATCHER_H_ | 50 #endif // CONTENT_CHILD_WEBSOCKET_DISPATCHER_H_ |
| OLD | NEW |