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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <string> | 10 #include <string> |
(...skipping 23 matching lines...) Expand all Loading... |
34 void connect(const blink::WebURL& url, | 34 void connect(const blink::WebURL& url, |
35 const blink::WebVector<blink::WebString>& protocols, | 35 const blink::WebVector<blink::WebString>& protocols, |
36 const blink::WebSecurityOrigin& origin, | 36 const blink::WebSecurityOrigin& origin, |
37 blink::WebSocketHandleClient* client) override; | 37 blink::WebSocketHandleClient* client) override; |
38 void send(bool fin, | 38 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 void flowControl(int64_t quota) override; | 42 void flowControl(int64_t quota) override; |
43 void close(unsigned short code, const blink::WebString& reason) override; | 43 void close(unsigned short code, const blink::WebString& reason) override; |
| 44 void changeBinaryType(BinaryType new_binary_type) override; |
| 45 void confirmBlob() override; |
44 | 46 |
45 void Disconnect(); | 47 void Disconnect(); |
46 | 48 |
47 void set_render_frame_id(int id) { | 49 void set_render_frame_id(int id) { |
48 render_frame_id_ = id; | 50 render_frame_id_ = id; |
49 } | 51 } |
50 | 52 |
51 private: | 53 private: |
52 ~WebSocketBridge() override; | 54 ~WebSocketBridge() override; |
53 | 55 |
54 void DidConnect(const std::string& selected_protocol, | 56 void DidConnect(const std::string& selected_protocol, |
55 const std::string& extensions); | 57 const std::string& extensions); |
56 void DidStartOpeningHandshake(const WebSocketHandshakeRequest& request); | 58 void DidStartOpeningHandshake(const WebSocketHandshakeRequest& request); |
57 void DidFinishOpeningHandshake(const WebSocketHandshakeResponse& response); | 59 void DidFinishOpeningHandshake(const WebSocketHandshakeResponse& response); |
58 void DidFail(const std::string& message); | 60 void DidFail(const std::string& message); |
59 void DidReceiveData(bool fin, | 61 void DidReceiveData(bool fin, |
60 WebSocketMessageType type, | 62 WebSocketMessageType type, |
61 const std::vector<char>& data); | 63 const std::vector<char>& data); |
| 64 void DidReceiveBlob(const std::string& uuid, uint64_t size); |
62 void DidReceiveFlowControl(int64_t quota); | 65 void DidReceiveFlowControl(int64_t quota); |
63 void DidClose(bool was_clean, unsigned short code, const std::string& reason); | 66 void DidClose(bool was_clean, unsigned short code, const std::string& reason); |
64 void DidStartClosingHandshake(); | 67 void DidStartClosingHandshake(); |
65 | 68 |
66 int channel_id_; | 69 int channel_id_; |
67 int render_frame_id_; | 70 int render_frame_id_; |
68 blink::WebSocketHandleClient* client_; | 71 blink::WebSocketHandleClient* client_; |
69 | 72 |
70 static const int kInvalidChannelId = -1; | 73 static const int kInvalidChannelId = -1; |
71 }; | 74 }; |
72 | 75 |
73 } // namespace content | 76 } // namespace content |
74 | 77 |
75 #endif // CONTENT_CHILD_WEBSOCKET_BRIDGE_H_ | 78 #endif // CONTENT_CHILD_WEBSOCKET_BRIDGE_H_ |
OLD | NEW |