summaryrefslogtreecommitdiffstats
path: root/remoting/protocol/pepper_channel.h
blob: de6b93b68ce30490cc5bfec1618f1d904e204bd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef REMOTING_PROTOCOL_PEPPER_CHANNEL_H_
#define REMOTING_PROTOCOL_PEPPER_CHANNEL_H_

#include <string>

#include "base/basictypes.h"
#include "base/threading/non_thread_safe.h"

namespace pp {
class Instance;
}  // namespace pp

namespace cricket {
class Candidate;
}  // namespace cricket

namespace remoting {
namespace protocol {

class ChannelAuthenticator;
struct TransportConfig;

// Interface for stream and datagram channels used by PepperSession.
class PepperChannel : public base::NonThreadSafe {
 public:
  PepperChannel() { }
  virtual ~PepperChannel() { }

  // Connect the channel using specified |config|. The specified
  // |authenticator| is used to authenticate the channel. Takes
  // ownership of |authenticator|.
  virtual void Connect(pp::Instance* pp_instance,
                       const TransportConfig& config,
                       ChannelAuthenticator* authenticator) = 0;

  // Adds |candidate| received from the peer.
  virtual void AddRemoveCandidate(const cricket::Candidate& candidate) = 0;

  // Name of the channel.
  virtual const std::string& name() const = 0;

  // Returns true if the channel is already connected.
  virtual bool is_connected() const = 0;

 protected:
  DISALLOW_COPY_AND_ASSIGN(PepperChannel);
};

}  // namespace protocol
}  // namespace remoting

#endif  // REMOTING_PROTOCOL_PEPPER_CHANNEL_H_