1a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// found in the LICENSE file.
45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
5a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#ifndef CONTENT_CHILD_WEB_SOCKET_STREAM_HANDLE_DELEGATE_H_
6a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#define CONTENT_CHILD_WEB_SOCKET_STREAM_HANDLE_DELEGATE_H_
75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "base/strings/string16.h"
95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class GURL;
115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)namespace blink {
135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class WebSocketStreamHandle;
145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}
155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
16a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)namespace content {
175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class WebSocketStreamHandleDelegate {
195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) public:
205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  WebSocketStreamHandleDelegate() {}
215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual void WillOpenStream(blink::WebSocketStreamHandle* handle,
235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                              const GURL& url) {}
245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual void WillSendData(blink::WebSocketStreamHandle* handle,
255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                            const char* data, int len) {}
265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
275d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual void DidOpenStream(blink::WebSocketStreamHandle* handle,
285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                             int max_amount_send_allowed) {}
295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual void DidSendData(blink::WebSocketStreamHandle* handle,
305d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                           int amount_sent) {}
315d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual void DidReceiveData(blink::WebSocketStreamHandle* handle,
325d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                              const char* data, int len) {}
335d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual void DidClose(blink::WebSocketStreamHandle*) {}
345d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual void DidFail(blink::WebSocketStreamHandle* handle,
355d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                       int error_code,
365d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)                       const base::string16& error_msg) {}
375d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
385d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) protected:
395d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  virtual ~WebSocketStreamHandleDelegate() {}
405d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)};
415d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
42a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)}  // namespace content
435d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)
44a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#endif  // CONTENT_CHILD_WEB_SOCKET_STREAM_HANDLE_DELEGATE_H_
45