Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: net/websockets/websocket_event_interface.h

Issue 12764006: WebSocketChannel implementation (Closed) Base URL: http://git.chromium.org/chromium/src.git@web_socket_dispatcher
Patch Set: Add unit tests and fix bugs. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_
6 #define NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "base/basictypes.h"
12
13 namespace net {
14
15 class NET_EXPORT WebSocketEventInterface {
16 public:
17 typedef int WebSocketMessageType;
18 virtual ~WebSocketEventInterface() {}
19 virtual void OnAddChannelResponse(bool fail,
20 const std::string& selected_protocol) = 0;
21 virtual void OnSendFrame(bool fin,
22 WebSocketMessageType type,
23 const std::vector<char>& data) = 0;
24 virtual void OnFlowControl(int64 quota) = 0;
25 // Both the "reason" and "reason_text" are passed through to Javascript, so
26 // care must be taken not to provide details that could be useful to attackers
27 // attempting to use WebSockets to probe networks.
28 virtual void OnDropChannel(unsigned short reason,
29 const std::string& reason_text) = 0;
30
31 protected:
32 WebSocketEventInterface() {}
33
34 private:
35 DISALLOW_COPY_AND_ASSIGN(WebSocketEventInterface);
36 };
37
38 } // namespace net
39
40 #endif // NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698