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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
| 13 #include "base/memory/shared_memory.h" |
13 #include "content/common/websocket.h" | 14 #include "content/common/websocket.h" |
14 #include "ipc/ipc_message.h" | 15 #include "ipc/ipc_message.h" |
15 #include "third_party/WebKit/public/platform/WebVector.h" | 16 #include "third_party/WebKit/public/platform/WebVector.h" |
16 #include "third_party/WebKit/public/platform/modules/websockets/WebSocketHandle.
h" | 17 #include "third_party/WebKit/public/platform/modules/websockets/WebSocketHandle.
h" |
17 | 18 |
18 namespace blink { | 19 namespace blink { |
19 class WebSecurityOrigin; | 20 class WebSecurityOrigin; |
20 class WebString; | 21 class WebString; |
21 class WebURL; | 22 class WebURL; |
22 } // namespace blink | 23 } // namespace blink |
(...skipping 18 matching lines...) Expand all Loading... |
41 size_t size) override; | 42 size_t size) override; |
42 void flowControl(int64_t quota) override; | 43 void flowControl(int64_t quota) override; |
43 void close(unsigned short code, const blink::WebString& reason) override; | 44 void close(unsigned short code, const blink::WebString& reason) override; |
44 | 45 |
45 void Disconnect(); | 46 void Disconnect(); |
46 | 47 |
47 void set_render_frame_id(int id) { | 48 void set_render_frame_id(int id) { |
48 render_frame_id_ = id; | 49 render_frame_id_ = id; |
49 } | 50 } |
50 | 51 |
| 52 void loaderTestTransmit(LoaderTestIPC, bool verifyData, size_t bucketSize, siz
e_t bufferSize, size_t totalSize, blink::WebCallbacks<int, void>*) override; |
| 53 |
51 private: | 54 private: |
| 55 class LoaderTestJob; |
52 ~WebSocketBridge() override; | 56 ~WebSocketBridge() override; |
53 | 57 |
54 void DidConnect(const std::string& selected_protocol, | 58 void DidConnect(const std::string& selected_protocol, |
55 const std::string& extensions); | 59 const std::string& extensions); |
56 void DidStartOpeningHandshake(const WebSocketHandshakeRequest& request); | 60 void DidStartOpeningHandshake(const WebSocketHandshakeRequest& request); |
57 void DidFinishOpeningHandshake(const WebSocketHandshakeResponse& response); | 61 void DidFinishOpeningHandshake(const WebSocketHandshakeResponse& response); |
58 void DidFail(const std::string& message); | 62 void DidFail(const std::string& message); |
59 void DidReceiveData(bool fin, | 63 void DidReceiveData(bool fin, |
60 WebSocketMessageType type, | 64 WebSocketMessageType type, |
61 const std::vector<char>& data); | 65 const std::vector<char>& data); |
62 void DidReceiveFlowControl(int64_t quota); | 66 void DidReceiveFlowControl(int64_t quota); |
63 void DidClose(bool was_clean, unsigned short code, const std::string& reason); | 67 void DidClose(bool was_clean, unsigned short code, const std::string& reason); |
64 void DidStartClosingHandshake(); | 68 void DidStartClosingHandshake(); |
65 | 69 |
| 70 void OnLoaderTransferTest_SetDataBuffer(base::SharedMemoryHandle); |
| 71 void OnLoaderTransferTest_ReceivedAck(); |
| 72 void OnLoaderTransferTest_Done(); |
| 73 |
66 int channel_id_; | 74 int channel_id_; |
67 int render_frame_id_; | 75 int render_frame_id_; |
68 blink::WebSocketHandleClient* client_; | 76 blink::WebSocketHandleClient* client_; |
| 77 scoped_ptr<LoaderTestJob> loader_test_job_; |
69 | 78 |
70 static const int kInvalidChannelId = -1; | 79 static const int kInvalidChannelId = -1; |
71 }; | 80 }; |
72 | 81 |
73 } // namespace content | 82 } // namespace content |
74 | 83 |
75 #endif // CONTENT_CHILD_WEBSOCKET_BRIDGE_H_ | 84 #endif // CONTENT_CHILD_WEBSOCKET_BRIDGE_H_ |
OLD | NEW |