| Index: content/child/websocket_bridge.h
|
| diff --git a/content/child/websocket_bridge.h b/content/child/websocket_bridge.h
|
| index ab5e3dca0194a4e84660f230330ed1985cbcc25c..cfe06fcceefbeecc154c7cadf9d2c6a24c7d3cea 100644
|
| --- a/content/child/websocket_bridge.h
|
| +++ b/content/child/websocket_bridge.h
|
| @@ -10,8 +10,8 @@
|
| #include <string>
|
| #include <vector>
|
|
|
| -#include "content/common/websocket.h"
|
| -#include "ipc/ipc_message.h"
|
| +#include "content/common/websocket.mojom.h"
|
| +#include "mojo/public/cpp/bindings/binding.h"
|
| #include "third_party/WebKit/public/platform/WebVector.h"
|
| #include "third_party/WebKit/public/platform/modules/websockets/WebSocketHandle.h"
|
|
|
| @@ -22,13 +22,14 @@ class WebURL;
|
| } // namespace blink
|
|
|
| namespace content {
|
| +class ServiceRegistry;
|
|
|
| -class WebSocketBridge : public blink::WebSocketHandle {
|
| +class WebSocketBridge : public blink::WebSocketHandle,
|
| + public mojom::WebSocketClient {
|
| public:
|
| WebSocketBridge();
|
|
|
| - // Handles an IPC message from the browser process.
|
| - bool OnMessageReceived(const IPC::Message& message);
|
| + void Initialize(ServiceRegistry* registry);
|
|
|
| // WebSocketHandle functions.
|
| void connect(const blink::WebURL& url,
|
| @@ -44,30 +45,28 @@ class WebSocketBridge : public blink::WebSocketHandle {
|
|
|
| void Disconnect();
|
|
|
| - void set_render_frame_id(int id) {
|
| - render_frame_id_ = id;
|
| - }
|
| -
|
| private:
|
| ~WebSocketBridge() override;
|
|
|
| - void DidConnect(const std::string& selected_protocol,
|
| - const std::string& extensions);
|
| - void DidStartOpeningHandshake(const WebSocketHandshakeRequest& request);
|
| - void DidFinishOpeningHandshake(const WebSocketHandshakeResponse& response);
|
| - void DidFail(const std::string& message);
|
| - void DidReceiveData(bool fin,
|
| - WebSocketMessageType type,
|
| - const std::vector<char>& data);
|
| - void DidReceiveFlowControl(int64_t quota);
|
| - void DidClose(bool was_clean, unsigned short code, const std::string& reason);
|
| - void DidStartClosingHandshake();
|
| + void OnFailChannel(const mojo::String& reason) override;
|
| + void OnStartOpeningHandshake(
|
| + mojom::WebSocketHandshakeRequestPtr request) override;
|
| + void OnFinishOpeningHandshake(
|
| + mojom::WebSocketHandshakeResponsePtr response) override;
|
| + void OnAddChannelResponse(const mojo::String& selected_protocol,
|
| + const mojo::String& extensions) override;
|
| + void OnBlobSent() override;
|
| + void OnDataFrame(bool fin, mojom::WebSocketMessageType type,
|
| + mojo::Array<uint8_t> data) override;
|
| + void OnFlowControl(int64_t quota) override;
|
| + void OnDropChannel(bool was_clean, uint16_t code,
|
| + const mojo::String& reason) override;
|
| + void OnClosingHandshake() override;
|
|
|
| - int channel_id_;
|
| - int render_frame_id_;
|
| blink::WebSocketHandleClient* client_;
|
|
|
| - static const int kInvalidChannelId = -1;
|
| + mojom::WebSocketPtr websocket_;
|
| + mojo::Binding<mojom::WebSocketClient> client_binding_;
|
| };
|
|
|
| } // namespace content
|
|
|