OLD | NEW |
---|---|
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 10 matching lines...) Expand all Loading... | |
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | 22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 */ | 26 */ |
27 | 27 |
28 #ifndef TALK_APP_WEBRTC_WEBRTCSESSIONDESCRIPTIONFACTORY_H_ | 28 #ifndef TALK_APP_WEBRTC_WEBRTCSESSIONDESCRIPTIONFACTORY_H_ |
29 #define TALK_APP_WEBRTC_WEBRTCSESSIONDESCRIPTIONFACTORY_H_ | 29 #define TALK_APP_WEBRTC_WEBRTCSESSIONDESCRIPTIONFACTORY_H_ |
30 | 30 |
31 #include "talk/app/webrtc/dtlsidentitystore.h" | |
31 #include "talk/app/webrtc/peerconnectioninterface.h" | 32 #include "talk/app/webrtc/peerconnectioninterface.h" |
33 #include "talk/session/media/mediasession.h" | |
32 #include "webrtc/p2p/base/transportdescriptionfactory.h" | 34 #include "webrtc/p2p/base/transportdescriptionfactory.h" |
33 #include "talk/session/media/mediasession.h" | |
34 #include "webrtc/base/messagehandler.h" | 35 #include "webrtc/base/messagehandler.h" |
35 | 36 |
36 namespace cricket { | 37 namespace cricket { |
37 class ChannelManager; | 38 class ChannelManager; |
38 class TransportDescriptionFactory; | 39 class TransportDescriptionFactory; |
39 } // namespace cricket | 40 } // namespace cricket |
40 | 41 |
41 namespace webrtc { | 42 namespace webrtc { |
42 class CreateSessionDescriptionObserver; | 43 class CreateSessionDescriptionObserver; |
43 class MediaConstraintsInterface; | 44 class MediaConstraintsInterface; |
44 class MediaStreamSignaling; | 45 class MediaStreamSignaling; |
45 class SessionDescriptionInterface; | 46 class SessionDescriptionInterface; |
46 class WebRtcSession; | 47 class WebRtcSession; |
47 | 48 |
48 // DTLS identity request callback class. | 49 // DTLS identity request callback class. |
49 class WebRtcIdentityRequestObserver : public DTLSIdentityRequestObserver, | 50 class WebRtcIdentityRequestObserver : public DtlsIdentityRequestObserver, |
50 public sigslot::has_slots<> { | 51 public sigslot::has_slots<> { |
51 public: | 52 public: |
52 // DTLSIdentityRequestObserver overrides. | 53 // DtlsIdentityRequestObserver overrides. |
53 void OnFailure(int error) override; | 54 void OnFailure(int error) override; |
54 void OnSuccess(const std::string& der_cert, | 55 void OnSuccess(const std::string& der_cert, |
55 const std::string& der_private_key) override; | 56 const std::string& der_private_key) override; |
56 void OnSuccessWithIdentityObj( | 57 void OnSuccess(rtc::scoped_ptr<rtc::SSLIdentity> identity) override; |
57 rtc::scoped_ptr<rtc::SSLIdentity> identity) override; | |
58 | 58 |
59 sigslot::signal1<int> SignalRequestFailed; | 59 sigslot::signal1<int> SignalRequestFailed; |
60 sigslot::signal1<rtc::SSLIdentity*> SignalIdentityReady; | 60 sigslot::signal1<rtc::SSLIdentity*> SignalIdentityReady; |
61 }; | 61 }; |
62 | 62 |
63 struct CreateSessionDescriptionRequest { | 63 struct CreateSessionDescriptionRequest { |
64 enum Type { | 64 enum Type { |
65 kOffer, | 65 kOffer, |
66 kAnswer, | 66 kAnswer, |
67 }; | 67 }; |
(...skipping 10 matching lines...) Expand all Loading... | |
78 rtc::scoped_refptr<CreateSessionDescriptionObserver> observer; | 78 rtc::scoped_refptr<CreateSessionDescriptionObserver> observer; |
79 cricket::MediaSessionOptions options; | 79 cricket::MediaSessionOptions options; |
80 }; | 80 }; |
81 | 81 |
82 // This class is used to create offer/answer session description with regards to | 82 // This class is used to create offer/answer session description with regards to |
83 // the async DTLS identity generation for WebRtcSession. | 83 // the async DTLS identity generation for WebRtcSession. |
84 // It queues the create offer/answer request until the DTLS identity | 84 // It queues the create offer/answer request until the DTLS identity |
85 // request has completed, i.e. when OnIdentityRequestFailed or OnIdentityReady | 85 // request has completed, i.e. when OnIdentityRequestFailed or OnIdentityReady |
86 // is called. | 86 // is called. |
87 class WebRtcSessionDescriptionFactory : public rtc::MessageHandler, | 87 class WebRtcSessionDescriptionFactory : public rtc::MessageHandler, |
88 public sigslot::has_slots<> { | 88 public sigslot::has_slots<> { |
89 public: | 89 public: |
90 WebRtcSessionDescriptionFactory( | 90 WebRtcSessionDescriptionFactory( |
91 rtc::Thread* signaling_thread, | 91 rtc::Thread* signaling_thread, |
92 cricket::ChannelManager* channel_manager, | 92 cricket::ChannelManager* channel_manager, |
93 MediaStreamSignaling* mediastream_signaling, | 93 MediaStreamSignaling* mediastream_signaling, |
94 DTLSIdentityServiceInterface* dtls_identity_service, | 94 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store, |
95 // TODO(jiayl): remove the dependency on session once b/10226852 is fixed. | 95 // TODO(jiayl): remove the dependency on session once b/10226852 is fixed. |
tommi
2015/07/02 11:23:00
this bug has been closed now... can you check the
hbos
2015/07/02 12:28:28
It has been moved to https://code.google.com/p/web
tommi
2015/07/09 16:13:56
just write bug 2264 :)
hbos
2015/07/27 13:29:00
Acknowledged.
| |
96 WebRtcSession* session, | 96 WebRtcSession* session, |
97 const std::string& session_id, | 97 const std::string& session_id, |
98 cricket::DataChannelType dct, | 98 cricket::DataChannelType dct, |
99 bool dtls_enabled); | 99 bool dtls_enabled); |
100 virtual ~WebRtcSessionDescriptionFactory(); | 100 virtual ~WebRtcSessionDescriptionFactory(); |
101 | 101 |
102 static void CopyCandidatesFromSessionDescription( | 102 static void CopyCandidatesFromSessionDescription( |
103 const SessionDescriptionInterface* source_desc, | 103 const SessionDescriptionInterface* source_desc, |
104 SessionDescriptionInterface* dest_desc); | 104 SessionDescriptionInterface* dest_desc); |
105 | 105 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 void OnIdentityRequestFailed(int error); | 143 void OnIdentityRequestFailed(int error); |
144 void SetIdentity(rtc::SSLIdentity* identity); | 144 void SetIdentity(rtc::SSLIdentity* identity); |
145 | 145 |
146 std::queue<CreateSessionDescriptionRequest> | 146 std::queue<CreateSessionDescriptionRequest> |
147 create_session_description_requests_; | 147 create_session_description_requests_; |
148 rtc::Thread* signaling_thread_; | 148 rtc::Thread* signaling_thread_; |
149 MediaStreamSignaling* mediastream_signaling_; | 149 MediaStreamSignaling* mediastream_signaling_; |
150 cricket::TransportDescriptionFactory transport_desc_factory_; | 150 cricket::TransportDescriptionFactory transport_desc_factory_; |
151 cricket::MediaSessionDescriptionFactory session_desc_factory_; | 151 cricket::MediaSessionDescriptionFactory session_desc_factory_; |
152 uint64 session_version_; | 152 uint64 session_version_; |
153 rtc::scoped_ptr<DTLSIdentityServiceInterface> identity_service_; | 153 rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store_; |
154 rtc::scoped_refptr<WebRtcIdentityRequestObserver> | 154 rtc::scoped_refptr<WebRtcIdentityRequestObserver> |
155 identity_request_observer_; | 155 identity_request_observer_; |
156 WebRtcSession* session_; | 156 WebRtcSession* session_; |
157 std::string session_id_; | 157 std::string session_id_; |
158 cricket::DataChannelType data_channel_type_; | 158 cricket::DataChannelType data_channel_type_; |
159 IdentityRequestState identity_request_state_; | 159 IdentityRequestState identity_request_state_; |
160 | 160 |
161 DISALLOW_COPY_AND_ASSIGN(WebRtcSessionDescriptionFactory); | 161 DISALLOW_COPY_AND_ASSIGN(WebRtcSessionDescriptionFactory); |
162 }; | 162 }; |
163 } // namespace webrtc | 163 } // namespace webrtc |
164 | 164 |
165 #endif // TALK_APP_WEBRTC_WEBRTCSESSIONDESCRIPTIONFACTORY_H_ | 165 #endif // TALK_APP_WEBRTC_WEBRTCSESSIONDESCRIPTIONFACTORY_H_ |
OLD | NEW |