| 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_RENDERER_WEBSOCKETHANDLE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_WEBSOCKETHANDLE_IMPL_H_ |
| 6 #define CONTENT_RENDERER_WEBSOCKETHANDLE_IMPL_H_ | 6 #define CONTENT_RENDERER_WEBSOCKETHANDLE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 size_t size) override; | 48 size_t size) override; |
| 49 void flowControl(int64_t quota) override; | 49 void flowControl(int64_t quota) override; |
| 50 void close(unsigned short code, const blink::WebString& reason) override; | 50 void close(unsigned short code, const blink::WebString& reason) override; |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 ~WebSocketHandleImpl() override; | 53 ~WebSocketHandleImpl() override; |
| 54 void Disconnect(); | 54 void Disconnect(); |
| 55 void OnConnectionError(); | 55 void OnConnectionError(); |
| 56 | 56 |
| 57 // mojom::WebSocketClient methods: | 57 // mojom::WebSocketClient methods: |
| 58 void OnFailChannel(const mojo::String& reason) override; | 58 void OnFailChannel(const std::string& reason) override; |
| 59 void OnStartOpeningHandshake( | 59 void OnStartOpeningHandshake( |
| 60 mojom::WebSocketHandshakeRequestPtr request) override; | 60 mojom::WebSocketHandshakeRequestPtr request) override; |
| 61 void OnFinishOpeningHandshake( | 61 void OnFinishOpeningHandshake( |
| 62 mojom::WebSocketHandshakeResponsePtr response) override; | 62 mojom::WebSocketHandshakeResponsePtr response) override; |
| 63 void OnAddChannelResponse(const mojo::String& selected_protocol, | 63 void OnAddChannelResponse(const std::string& selected_protocol, |
| 64 const mojo::String& extensions) override; | 64 const std::string& extensions) override; |
| 65 void OnDataFrame(bool fin, mojom::WebSocketMessageType type, | 65 void OnDataFrame(bool fin, |
| 66 mojo::Array<uint8_t> data) override; | 66 mojom::WebSocketMessageType type, |
| 67 const std::vector<uint8_t>& data) override; |
| 67 void OnFlowControl(int64_t quota) override; | 68 void OnFlowControl(int64_t quota) override; |
| 68 void OnDropChannel(bool was_clean, uint16_t code, | 69 void OnDropChannel(bool was_clean, |
| 69 const mojo::String& reason) override; | 70 uint16_t code, |
| 71 const std::string& reason) override; |
| 70 void OnClosingHandshake() override; | 72 void OnClosingHandshake() override; |
| 71 | 73 |
| 72 blink::WebSocketHandleClient* client_; | 74 blink::WebSocketHandleClient* client_; |
| 73 | 75 |
| 74 mojom::WebSocketPtr websocket_; | 76 mojom::WebSocketPtr websocket_; |
| 75 mojo::Binding<mojom::WebSocketClient> client_binding_; | 77 mojo::Binding<mojom::WebSocketClient> client_binding_; |
| 76 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 78 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 77 bool did_initialize_; | 79 bool did_initialize_; |
| 78 | 80 |
| 79 DISALLOW_COPY_AND_ASSIGN(WebSocketHandleImpl); | 81 DISALLOW_COPY_AND_ASSIGN(WebSocketHandleImpl); |
| 80 }; | 82 }; |
| 81 | 83 |
| 82 } // namespace content | 84 } // namespace content |
| 83 | 85 |
| 84 #endif // CONTENT_RENDERER_WEBSOCKETHANDLE_IMPL_H_ | 86 #endif // CONTENT_RENDERER_WEBSOCKETHANDLE_IMPL_H_ |
| OLD | NEW |