1 // Copyright 2014 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.
5 #ifndef COMPONENTS_DEVTOOLS_BRIDGE_ABSTRACT_PEER_CONNECTION_H_
6 #define COMPONENTS_DEVTOOLS_BRIDGE_ABSTRACT_PEER_CONNECTION_H_
10 #include "base/memory/scoped_ptr.h"
12 namespace devtools_bridge
{
14 class AbstractDataChannel
;
17 * WebRTC PeerConnection adapter for DevTools bridge.
19 class AbstractPeerConnection
{
22 * Delegate is called on signaling thread.
27 virtual ~Delegate() {}
29 virtual void OnIceConnectionChange(bool connected
) = 0;
30 virtual void OnIceCandidate(
31 const std::string
& sdp_mid
,
33 const std::string
& sdp
) = 0;
34 virtual void OnLocalOfferCreatedAndSetSet(
35 const std::string
& description
) = 0;
36 virtual void OnLocalAnswerCreatedAndSetSet(
37 const std::string
& description
) = 0;
38 virtual void OnRemoteDescriptionSet() = 0;
39 virtual void OnFailure(const std::string
& description
) = 0;
42 DISALLOW_COPY_AND_ASSIGN(Delegate
);
45 AbstractPeerConnection() {}
46 virtual ~AbstractPeerConnection() {}
48 virtual void CreateAndSetLocalOffer() = 0;
49 virtual void CreateAndSetLocalAnswer() = 0;
50 virtual void SetRemoteOffer(const std::string
& description
) = 0;
51 virtual void SetRemoteAnswer(const std::string
& description
) = 0;
52 virtual void AddIceCandidate(
53 const std::string
& sdp_mid
,
55 const std::string
& sdp
) = 0;
57 virtual scoped_ptr
<AbstractDataChannel
> CreateDataChannel(int channelId
) = 0;
60 DISALLOW_COPY_AND_ASSIGN(AbstractPeerConnection
);
63 } // namespace devtools_bridge
65 #endif // COMPONENTS_DEVTOOLS_BRIDGE_ABSTRACT_PEER_CONNECTION_H_