OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_GLUE_WEBSOCKETSTREAMHANDLE_DELEGATE_H_ | 5 #ifndef WEBKIT_GLUE_WEBSOCKETSTREAMHANDLE_DELEGATE_H_ |
6 #define WEBKIT_GLUE_WEBSOCKETSTREAMHANDLE_DELEGATE_H_ | 6 #define WEBKIT_GLUE_WEBSOCKETSTREAMHANDLE_DELEGATE_H_ |
7 | 7 |
| 8 #include "base/string16.h" |
| 9 |
8 class GURL; | 10 class GURL; |
9 | 11 |
10 namespace WebKit { | 12 namespace WebKit { |
11 class WebSocketStreamHandle; | 13 class WebSocketStreamHandle; |
12 } | 14 } |
13 | 15 |
14 namespace webkit_glue { | 16 namespace webkit_glue { |
15 | 17 |
16 class WebSocketStreamHandleDelegate { | 18 class WebSocketStreamHandleDelegate { |
17 public: | 19 public: |
18 WebSocketStreamHandleDelegate() {} | 20 WebSocketStreamHandleDelegate() {} |
19 | 21 |
20 virtual void WillOpenStream(WebKit::WebSocketStreamHandle* handle, | 22 virtual void WillOpenStream(WebKit::WebSocketStreamHandle* handle, |
21 const GURL& url) {} | 23 const GURL& url) {} |
22 virtual void WillSendData(WebKit::WebSocketStreamHandle* handle, | 24 virtual void WillSendData(WebKit::WebSocketStreamHandle* handle, |
23 const char* data, int len) {} | 25 const char* data, int len) {} |
24 | 26 |
25 virtual void DidOpenStream(WebKit::WebSocketStreamHandle* handle, | 27 virtual void DidOpenStream(WebKit::WebSocketStreamHandle* handle, |
26 int max_amount_send_allowed) {} | 28 int max_amount_send_allowed) {} |
27 virtual void DidSendData(WebKit::WebSocketStreamHandle* handle, | 29 virtual void DidSendData(WebKit::WebSocketStreamHandle* handle, |
28 int amount_sent) {} | 30 int amount_sent) {} |
29 virtual void DidReceiveData(WebKit::WebSocketStreamHandle* handle, | 31 virtual void DidReceiveData(WebKit::WebSocketStreamHandle* handle, |
30 const char* data, int len) {} | 32 const char* data, int len) {} |
31 virtual void DidClose(WebKit::WebSocketStreamHandle*) {} | 33 virtual void DidClose(WebKit::WebSocketStreamHandle*) {} |
| 34 virtual void DidFail(WebKit::WebSocketStreamHandle* handle, |
| 35 int error_code, |
| 36 const string16& error_msg) {} |
32 | 37 |
33 protected: | 38 protected: |
34 virtual ~WebSocketStreamHandleDelegate() {} | 39 virtual ~WebSocketStreamHandleDelegate() {} |
35 }; | 40 }; |
36 | 41 |
37 } // namespace webkit_glue | 42 } // namespace webkit_glue |
38 | 43 |
39 #endif // WEBKIT_GLUE_WEBSOCKETSTREAMHANDLE_DELEGATE_H_ | 44 #endif // WEBKIT_GLUE_WEBSOCKETSTREAMHANDLE_DELEGATE_H_ |
OLD | NEW |