netwerk/sctp/datachannel/DataChannelListener.h

Wed, 31 Dec 2014 06:55:46 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:46 +0100
changeset 1
ca08bd8f51b2
permissions
-rw-r--r--

Added tag TORBROWSER_REPLICA for changeset 6474c204b198

michael@0 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* vim: set ts=2 et sw=2 tw=80: */
michael@0 3 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
michael@0 5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef NETWERK_SCTP_DATACHANNEL_DATACHANNELLISTENER_H_
michael@0 8 #define NETWERK_SCTP_DATACHANNEL_DATACHANNELLISTENER_H_
michael@0 9
michael@0 10 #include "nsISupports.h"
michael@0 11 #include "nsString.h"
michael@0 12
michael@0 13 namespace mozilla {
michael@0 14
michael@0 15 // Implemented by consumers of a Channel to receive messages.
michael@0 16 // Can't nest it in DataChannelConnection because C++ doesn't allow forward
michael@0 17 // refs to embedded classes
michael@0 18 class DataChannelListener {
michael@0 19 public:
michael@0 20 virtual ~DataChannelListener() {}
michael@0 21
michael@0 22 // Called when a DOMString message is received.
michael@0 23 virtual nsresult OnMessageAvailable(nsISupports *aContext,
michael@0 24 const nsACString& message) = 0;
michael@0 25
michael@0 26 // Called when a binary message is received.
michael@0 27 virtual nsresult OnBinaryMessageAvailable(nsISupports *aContext,
michael@0 28 const nsACString& message) = 0;
michael@0 29
michael@0 30 // Called when the channel is connected
michael@0 31 virtual nsresult OnChannelConnected(nsISupports *aContext) = 0;
michael@0 32
michael@0 33 // Called when the channel is closed
michael@0 34 virtual nsresult OnChannelClosed(nsISupports *aContext) = 0;
michael@0 35 };
michael@0 36
michael@0 37 }
michael@0 38
michael@0 39 #endif

mercurial