Chromium Code Reviews| Index: content/child/websocket_dispatcher.h |
| diff --git a/content/child/websocket_dispatcher.h b/content/child/websocket_dispatcher.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1a7fda22c6971444355dfdfdffbeb5aa01d12840 |
| --- /dev/null |
| +++ b/content/child/websocket_dispatcher.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_CHILD_WEBSOCKET_DISPATCHER_H_ |
| +#define CONTENT_CHILD_WEBSOCKET_DISPATCHER_H_ |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/compiler_specific.h" |
| +#include "content/common/websocket.h" |
|
tyoshino (SeeGerritForStatus)
2013/08/29 11:30:59
move this to .cc?
yhirano
2013/08/29 11:45:44
This is necessary to declare OnReceivedData.
yhirano
2013/08/30 05:46:56
Done.
tyoshino (SeeGerritForStatus)
2013/09/03 07:18:30
Got it
|
| +#include "ipc/ipc_listener.h" |
| + |
| +namespace webkit_glue { |
| +class WebSocketHandleBridge; |
| +class WebSocketHandleDelegate; |
| +} |
| + |
| +namespace content { |
| + |
| +// Dispatches WebSocket related messages sent to a child process from the |
| +// main browser process. There is one instance per child process. Messages |
| +// are dispatched on the main child thread. The RenderThread class |
| +// creates an instance of WebSocketDispatcher and delegates calls to it. |
| +class WebSocketDispatcher : public IPC::Listener { |
| + public: |
| + WebSocketDispatcher(); |
| + virtual ~WebSocketDispatcher() {} |
| + |
| + static webkit_glue::WebSocketHandleBridge* CreateBridge( |
| + webkit_glue::WebSocketHandleDelegate* delegate); |
| + |
| + // IPC::Listener implementation. |
| + virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| + |
| + private: |
| + void OnConnected(int channel_id, |
| + bool fail, |
| + std::string selected_protocol, |
| + std::string extensions); |
| + void OnReceivedData(int channel_id, |
| + bool fin, |
| + content::WebSocketMessageType type, |
| + std::vector<char> data); |
|
tyoshino (SeeGerritForStatus)
2013/08/29 11:30:59
Use the same order (fin is last argument) as WebSo
yhirano
2013/08/29 11:45:44
I see, I will change blink-side implementation.
Is
|
| + void OnReceivedFlowControl(int channel_id, int64 quota); |
| + void OnClosed(int channel_id, unsigned short code, std::string reason); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WebSocketDispatcher); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_CHILD_WEBSOCKET_DISPATCHER_H_ |