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_BRIDGE_H_ | 5 #ifndef CONTENT_CHILD_WEBSOCKET_BRIDGE_H_ |
6 #define CONTENT_CHILD_WEBSOCKET_BRIDGE_H_ | 6 #define CONTENT_CHILD_WEBSOCKET_BRIDGE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 27 matching lines...) Expand all Loading... |
38 virtual void send(bool fin, | 38 virtual void send(bool fin, |
39 WebSocketHandle::MessageType type, | 39 WebSocketHandle::MessageType type, |
40 const char* data, | 40 const char* data, |
41 size_t size) OVERRIDE; | 41 size_t size) OVERRIDE; |
42 virtual void flowControl(int64_t quota) OVERRIDE; | 42 virtual void flowControl(int64_t quota) OVERRIDE; |
43 virtual void close(unsigned short code, | 43 virtual void close(unsigned short code, |
44 const blink::WebString& reason) OVERRIDE; | 44 const blink::WebString& reason) OVERRIDE; |
45 | 45 |
46 virtual void Disconnect(); | 46 virtual void Disconnect(); |
47 | 47 |
| 48 void set_render_frame_id(int id) { |
| 49 render_frame_id_ = id; |
| 50 } |
| 51 |
48 private: | 52 private: |
49 virtual ~WebSocketBridge(); | 53 virtual ~WebSocketBridge(); |
50 | 54 |
51 void DidConnect(bool fail, | 55 void DidConnect(bool fail, |
52 const std::string& selected_protocol, | 56 const std::string& selected_protocol, |
53 const std::string& extensions); | 57 const std::string& extensions); |
54 void DidStartOpeningHandshake(const WebSocketHandshakeRequest& request); | 58 void DidStartOpeningHandshake(const WebSocketHandshakeRequest& request); |
55 void DidFinishOpeningHandshake(const WebSocketHandshakeResponse& response); | 59 void DidFinishOpeningHandshake(const WebSocketHandshakeResponse& response); |
56 void DidFail(const std::string& message); | 60 void DidFail(const std::string& message); |
57 void DidReceiveData(bool fin, | 61 void DidReceiveData(bool fin, |
58 WebSocketMessageType type, | 62 WebSocketMessageType type, |
59 const std::vector<char>& data); | 63 const std::vector<char>& data); |
60 void DidReceiveFlowControl(int64_t quota); | 64 void DidReceiveFlowControl(int64_t quota); |
61 void DidClose(bool was_clean, unsigned short code, const std::string& reason); | 65 void DidClose(bool was_clean, unsigned short code, const std::string& reason); |
62 void DidStartClosingHandshake(); | 66 void DidStartClosingHandshake(); |
63 | 67 |
64 int channel_id_; | 68 int channel_id_; |
| 69 int render_frame_id_; |
65 blink::WebSocketHandleClient* client_; | 70 blink::WebSocketHandleClient* client_; |
66 | 71 |
67 static const int kInvalidChannelId = -1; | 72 static const int kInvalidChannelId = -1; |
68 }; | 73 }; |
69 | 74 |
70 } // namespace content | 75 } // namespace content |
71 | 76 |
72 #endif // CONTENT_CHILD_WEBSOCKET_BRIDGE_H_ | 77 #endif // CONTENT_CHILD_WEBSOCKET_BRIDGE_H_ |
OLD | NEW |