| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 class WebRtcIdentityRequestObserver : public DtlsIdentityRequestObserver, | 51 class WebRtcIdentityRequestObserver : public DtlsIdentityRequestObserver, |
| 52 public sigslot::has_slots<> { | 52 public sigslot::has_slots<> { |
| 53 public: | 53 public: |
| 54 // DtlsIdentityRequestObserver overrides. | 54 // DtlsIdentityRequestObserver overrides. |
| 55 void OnFailure(int error) override; | 55 void OnFailure(int error) override; |
| 56 void OnSuccess(const std::string& der_cert, | 56 void OnSuccess(const std::string& der_cert, |
| 57 const std::string& der_private_key) override; | 57 const std::string& der_private_key) override; |
| 58 void OnSuccess(rtc::scoped_ptr<rtc::SSLIdentity> identity) override; | 58 void OnSuccess(rtc::scoped_ptr<rtc::SSLIdentity> identity) override; |
| 59 | 59 |
| 60 sigslot::signal1<int> SignalRequestFailed; | 60 sigslot::signal1<int> SignalRequestFailed; |
| 61 sigslot::signal1<rtc::SSLIdentity*> SignalIdentityReady; | 61 sigslot::signal1<const rtc::scoped_refptr<rtc::RTCCertificate>&> |
| 62 SignalCertificateReady; |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 struct CreateSessionDescriptionRequest { | 65 struct CreateSessionDescriptionRequest { |
| 65 enum Type { | 66 enum Type { |
| 66 kOffer, | 67 kOffer, |
| 67 kAnswer, | 68 kAnswer, |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 CreateSessionDescriptionRequest( | 71 CreateSessionDescriptionRequest( |
| 71 Type type, | 72 Type type, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 void CreateOffer( | 128 void CreateOffer( |
| 128 CreateSessionDescriptionObserver* observer, | 129 CreateSessionDescriptionObserver* observer, |
| 129 const PeerConnectionInterface::RTCOfferAnswerOptions& options); | 130 const PeerConnectionInterface::RTCOfferAnswerOptions& options); |
| 130 void CreateAnswer( | 131 void CreateAnswer( |
| 131 CreateSessionDescriptionObserver* observer, | 132 CreateSessionDescriptionObserver* observer, |
| 132 const MediaConstraintsInterface* constraints); | 133 const MediaConstraintsInterface* constraints); |
| 133 | 134 |
| 134 void SetSdesPolicy(cricket::SecurePolicy secure_policy); | 135 void SetSdesPolicy(cricket::SecurePolicy secure_policy); |
| 135 cricket::SecurePolicy SdesPolicy() const; | 136 cricket::SecurePolicy SdesPolicy() const; |
| 136 | 137 |
| 137 sigslot::signal1<rtc::SSLIdentity*> SignalIdentityReady; | 138 sigslot::signal1<const rtc::scoped_refptr<rtc::RTCCertificate>&> |
| 139 SignalCertificateReady; |
| 138 | 140 |
| 139 // For testing. | 141 // For testing. |
| 140 bool waiting_for_certificate_for_testing() const { | 142 bool waiting_for_certificate_for_testing() const { |
| 141 return certificate_request_state_ == CERTIFICATE_WAITING; | 143 return certificate_request_state_ == CERTIFICATE_WAITING; |
| 142 } | 144 } |
| 143 | 145 |
| 144 private: | 146 private: |
| 145 enum CertificateRequestState { | 147 enum CertificateRequestState { |
| 146 CERTIFICATE_NOT_NEEDED, | 148 CERTIFICATE_NOT_NEEDED, |
| 147 CERTIFICATE_WAITING, | 149 CERTIFICATE_WAITING, |
| (...skipping 21 matching lines...) Expand all Loading... |
| 169 // Posts failure notifications for all pending session description requests. | 171 // Posts failure notifications for all pending session description requests. |
| 170 void FailPendingRequests(const std::string& reason); | 172 void FailPendingRequests(const std::string& reason); |
| 171 void PostCreateSessionDescriptionFailed( | 173 void PostCreateSessionDescriptionFailed( |
| 172 CreateSessionDescriptionObserver* observer, | 174 CreateSessionDescriptionObserver* observer, |
| 173 const std::string& error); | 175 const std::string& error); |
| 174 void PostCreateSessionDescriptionSucceeded( | 176 void PostCreateSessionDescriptionSucceeded( |
| 175 CreateSessionDescriptionObserver* observer, | 177 CreateSessionDescriptionObserver* observer, |
| 176 SessionDescriptionInterface* description); | 178 SessionDescriptionInterface* description); |
| 177 | 179 |
| 178 void OnIdentityRequestFailed(int error); | 180 void OnIdentityRequestFailed(int error); |
| 179 void SetIdentity(rtc::SSLIdentity* identity); | 181 void SetCertificate( |
| 182 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate); |
| 180 | 183 |
| 181 std::queue<CreateSessionDescriptionRequest> | 184 std::queue<CreateSessionDescriptionRequest> |
| 182 create_session_description_requests_; | 185 create_session_description_requests_; |
| 183 rtc::Thread* const signaling_thread_; | 186 rtc::Thread* const signaling_thread_; |
| 184 MediaStreamSignaling* const mediastream_signaling_; | 187 MediaStreamSignaling* const mediastream_signaling_; |
| 185 cricket::TransportDescriptionFactory transport_desc_factory_; | 188 cricket::TransportDescriptionFactory transport_desc_factory_; |
| 186 cricket::MediaSessionDescriptionFactory session_desc_factory_; | 189 cricket::MediaSessionDescriptionFactory session_desc_factory_; |
| 187 uint64 session_version_; | 190 uint64 session_version_; |
| 188 const rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store_; | 191 const rtc::scoped_ptr<DtlsIdentityStoreInterface> dtls_identity_store_; |
| 189 const rtc::scoped_refptr<WebRtcIdentityRequestObserver> | 192 const rtc::scoped_refptr<WebRtcIdentityRequestObserver> |
| 190 identity_request_observer_; | 193 identity_request_observer_; |
| 191 // TODO(jiayl): remove the dependency on session once bug 2264 is fixed. | 194 // TODO(jiayl): remove the dependency on session once bug 2264 is fixed. |
| 192 WebRtcSession* const session_; | 195 WebRtcSession* const session_; |
| 193 const std::string session_id_; | 196 const std::string session_id_; |
| 194 const cricket::DataChannelType data_channel_type_; | 197 const cricket::DataChannelType data_channel_type_; |
| 195 CertificateRequestState certificate_request_state_; | 198 CertificateRequestState certificate_request_state_; |
| 196 | 199 |
| 197 DISALLOW_COPY_AND_ASSIGN(WebRtcSessionDescriptionFactory); | 200 DISALLOW_COPY_AND_ASSIGN(WebRtcSessionDescriptionFactory); |
| 198 }; | 201 }; |
| 199 } // namespace webrtc | 202 } // namespace webrtc |
| 200 | 203 |
| 201 #endif // TALK_APP_WEBRTC_WEBRTCSESSIONDESCRIPTIONFACTORY_H_ | 204 #endif // TALK_APP_WEBRTC_WEBRTCSESSIONDESCRIPTIONFACTORY_H_ |
| OLD | NEW |