| 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 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // General message dispatch. WebSocketDispatcherHost::OnMessageReceived | 43 // General message dispatch. WebSocketDispatcherHost::OnMessageReceived |
| 44 // delegates to this method after looking up the |routing_id|. | 44 // delegates to this method after looking up the |routing_id|. |
| 45 virtual bool OnMessageReceived(const IPC::Message& message); | 45 virtual bool OnMessageReceived(const IPC::Message& message); |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 // Handlers for each message type, dispatched by OnMessageReceived(), as | 48 // Handlers for each message type, dispatched by OnMessageReceived(), as |
| 49 // defined in content/common/websocket_messages.h | 49 // defined in content/common/websocket_messages.h |
| 50 | 50 |
| 51 void OnAddChannelRequest(const GURL& socket_url, | 51 void OnAddChannelRequest(const GURL& socket_url, |
| 52 const std::vector<std::string>& requested_protocols, | 52 const std::vector<std::string>& requested_protocols, |
| 53 const url::Origin& origin); | 53 const url::Origin& origin, |
| 54 int render_frame_id); |
| 54 | 55 |
| 55 void OnSendFrame(bool fin, | 56 void OnSendFrame(bool fin, |
| 56 WebSocketMessageType type, | 57 WebSocketMessageType type, |
| 57 const std::vector<char>& data); | 58 const std::vector<char>& data); |
| 58 | 59 |
| 59 void OnFlowControl(int64 quota); | 60 void OnFlowControl(int64 quota); |
| 60 | 61 |
| 61 void OnDropChannel(bool was_clean, uint16 code, const std::string& reason); | 62 void OnDropChannel(bool was_clean, uint16 code, const std::string& reason); |
| 62 | 63 |
| 63 // The channel we use to send events to the network. | 64 // The channel we use to send events to the network. |
| 64 scoped_ptr<net::WebSocketChannel> channel_; | 65 scoped_ptr<net::WebSocketChannel> channel_; |
| 65 | 66 |
| 67 // The WebSocketHostDispatcher that created this object. |
| 68 WebSocketDispatcherHost* const dispatcher_; |
| 69 |
| 70 // The URL request context for the channel. |
| 71 net::URLRequestContext* const url_request_context_; |
| 72 |
| 66 // The ID used to route messages. | 73 // The ID used to route messages. |
| 67 int routing_id_; | 74 const int routing_id_; |
| 68 | 75 |
| 69 DISALLOW_COPY_AND_ASSIGN(WebSocketHost); | 76 DISALLOW_COPY_AND_ASSIGN(WebSocketHost); |
| 70 }; | 77 }; |
| 71 | 78 |
| 72 } // namespace content | 79 } // namespace content |
| 73 | 80 |
| 74 #endif // CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_HOST_H_ | 81 #endif // CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_HOST_H_ |
| OLD | NEW |