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 3 // found in the LICENSE file. 4 5 #ifndef WEBKIT_CHILD_WEBSOCKETSTREAMHANDLE_DELEGATE_H_ 6 #define WEBKIT_CHILD_WEBSOCKETSTREAMHANDLE_DELEGATE_H_ 7 8 #include "base/strings/string16.h" 9 10 class GURL; 11 12 namespace blink { 13 class WebSocketStreamHandle; 14 } 15 16 namespace webkit_glue { 17 18 class WebSocketStreamHandleDelegate { 19 public: WebSocketStreamHandleDelegate()20 WebSocketStreamHandleDelegate() {} 21 WillOpenStream(blink::WebSocketStreamHandle * handle,const GURL & url)22 virtual void WillOpenStream(blink::WebSocketStreamHandle* handle, 23 const GURL& url) {} WillSendData(blink::WebSocketStreamHandle * handle,const char * data,int len)24 virtual void WillSendData(blink::WebSocketStreamHandle* handle, 25 const char* data, int len) {} 26 DidOpenStream(blink::WebSocketStreamHandle * handle,int max_amount_send_allowed)27 virtual void DidOpenStream(blink::WebSocketStreamHandle* handle, 28 int max_amount_send_allowed) {} DidSendData(blink::WebSocketStreamHandle * handle,int amount_sent)29 virtual void DidSendData(blink::WebSocketStreamHandle* handle, 30 int amount_sent) {} DidReceiveData(blink::WebSocketStreamHandle * handle,const char * data,int len)31 virtual void DidReceiveData(blink::WebSocketStreamHandle* handle, 32 const char* data, int len) {} DidClose(blink::WebSocketStreamHandle *)33 virtual void DidClose(blink::WebSocketStreamHandle*) {} DidFail(blink::WebSocketStreamHandle * handle,int error_code,const string16 & error_msg)34 virtual void DidFail(blink::WebSocketStreamHandle* handle, 35 int error_code, 36 const string16& error_msg) {} 37 38 protected: ~WebSocketStreamHandleDelegate()39 virtual ~WebSocketStreamHandleDelegate() {} 40 }; 41 42 } // namespace webkit_glue 43 44 #endif // WEBKIT_CHILD_WEBSOCKETSTREAMHANDLE_DELEGATE_H_ 45