Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef NETWERK_SCTP_DATACHANNEL_DATACHANNELLISTENER_H_
8 #define NETWERK_SCTP_DATACHANNEL_DATACHANNELLISTENER_H_
10 #include "nsISupports.h"
11 #include "nsString.h"
13 namespace mozilla {
15 // Implemented by consumers of a Channel to receive messages.
16 // Can't nest it in DataChannelConnection because C++ doesn't allow forward
17 // refs to embedded classes
18 class DataChannelListener {
19 public:
20 virtual ~DataChannelListener() {}
22 // Called when a DOMString message is received.
23 virtual nsresult OnMessageAvailable(nsISupports *aContext,
24 const nsACString& message) = 0;
26 // Called when a binary message is received.
27 virtual nsresult OnBinaryMessageAvailable(nsISupports *aContext,
28 const nsACString& message) = 0;
30 // Called when the channel is connected
31 virtual nsresult OnChannelConnected(nsISupports *aContext) = 0;
33 // Called when the channel is closed
34 virtual nsresult OnChannelClosed(nsISupports *aContext) = 0;
35 };
37 }
39 #endif