| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_PROTOCOL_PEPPER_CHANNEL_H_ | 5 #ifndef REMOTING_PROTOCOL_PEPPER_CHANNEL_H_ |
| 6 #define REMOTING_PROTOCOL_PEPPER_CHANNEL_H_ | 6 #define REMOTING_PROTOCOL_PEPPER_CHANNEL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/non_thread_safe.h" |
| 12 | 13 |
| 13 namespace pp { | 14 namespace pp { |
| 14 class Instance; | 15 class Instance; |
| 15 } // namespace pp | 16 } // namespace pp |
| 16 | 17 |
| 17 namespace cricket { | 18 namespace cricket { |
| 18 class Candidate; | 19 class Candidate; |
| 19 } // namespace cricket | 20 } // namespace cricket |
| 20 | 21 |
| 21 namespace remoting { | 22 namespace remoting { |
| 22 namespace protocol { | 23 namespace protocol { |
| 23 | 24 |
| 24 class ChannelAuthenticator; | 25 class ChannelAuthenticator; |
| 25 struct TransportConfig; | 26 struct TransportConfig; |
| 26 | 27 |
| 27 // Interface for stream and datagram channels used by PepperSession. | 28 // Interface for stream and datagram channels used by PepperSession. |
| 28 class PepperChannel : public base::NonThreadSafe { | 29 class PepperChannel : public base::NonThreadSafe { |
| 29 public: | 30 public: |
| 30 PepperChannel() { } | 31 PepperChannel() { } |
| 31 virtual ~PepperChannel() { } | 32 virtual ~PepperChannel() { } |
| 32 | 33 |
| 33 // Connect the channel using specified |config|. The specified | 34 // Connect the channel using specified |config|. The specified |
| 34 // |authenticator| is used to authenticate the channel. Takes | 35 // |authenticator| is used to authenticate the channel. |
| 35 // ownership of |authenticator|. | |
| 36 virtual void Connect(pp::Instance* pp_instance, | 36 virtual void Connect(pp::Instance* pp_instance, |
| 37 const TransportConfig& config, | 37 const TransportConfig& config, |
| 38 ChannelAuthenticator* authenticator) = 0; | 38 scoped_ptr<ChannelAuthenticator> authenticator) = 0; |
| 39 | 39 |
| 40 // Adds |candidate| received from the peer. | 40 // Adds |candidate| received from the peer. |
| 41 virtual void AddRemoveCandidate(const cricket::Candidate& candidate) = 0; | 41 virtual void AddRemoveCandidate(const cricket::Candidate& candidate) = 0; |
| 42 | 42 |
| 43 // Name of the channel. | 43 // Name of the channel. |
| 44 virtual const std::string& name() const = 0; | 44 virtual const std::string& name() const = 0; |
| 45 | 45 |
| 46 // Returns true if the channel is already connected. | 46 // Returns true if the channel is already connected. |
| 47 virtual bool is_connected() const = 0; | 47 virtual bool is_connected() const = 0; |
| 48 | 48 |
| 49 protected: | 49 protected: |
| 50 DISALLOW_COPY_AND_ASSIGN(PepperChannel); | 50 DISALLOW_COPY_AND_ASSIGN(PepperChannel); |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 } // namespace protocol | 53 } // namespace protocol |
| 54 } // namespace remoting | 54 } // namespace remoting |
| 55 | 55 |
| 56 #endif // REMOTING_PROTOCOL_PEPPER_CHANNEL_H_ | 56 #endif // REMOTING_PROTOCOL_PEPPER_CHANNEL_H_ |
| OLD | NEW |