| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 // Handles messages posted to us. | 405 // Handles messages posted to us. |
| 406 virtual void OnMessage(rtc::Message *pmsg); | 406 virtual void OnMessage(rtc::Message *pmsg); |
| 407 | 407 |
| 408 protected: | 408 protected: |
| 409 bool IsCandidateAllocationDone() const; | 409 bool IsCandidateAllocationDone() const; |
| 410 | 410 |
| 411 State state_; | 411 State state_; |
| 412 Error error_; | 412 Error error_; |
| 413 std::string error_desc_; | 413 std::string error_desc_; |
| 414 | 414 |
| 415 // Fires the new description signal according to the current state. | |
| 416 virtual void SignalNewDescription(); | |
| 417 // This method will delete the Transport and TransportChannelImpls | 415 // This method will delete the Transport and TransportChannelImpls |
| 418 // and replace those with the Transport object of the first | 416 // and replace those with the Transport object of the first |
| 419 // MediaContent in bundle_group. | 417 // MediaContent in bundle_group. |
| 420 bool BundleContentGroup(const ContentGroup* bundle_group); | 418 bool BundleContentGroup(const ContentGroup* bundle_group); |
| 421 | 419 |
| 422 private: | 420 private: |
| 423 // Helper methods to push local and remote transport descriptions. | 421 // Helper methods to push local and remote transport descriptions. |
| 424 bool PushdownLocalTransportDescription( | 422 bool PushdownLocalTransportDescription( |
| 425 const SessionDescription* sdesc, ContentAction action, | 423 const SessionDescription* sdesc, ContentAction action, |
| 426 std::string* error_desc); | 424 std::string* error_desc); |
| 427 bool PushdownRemoteTransportDescription( | 425 bool PushdownRemoteTransportDescription( |
| 428 const SessionDescription* sdesc, ContentAction action, | 426 const SessionDescription* sdesc, ContentAction action, |
| 429 std::string* error_desc); | 427 std::string* error_desc); |
| 430 | 428 |
| 431 void MaybeCandidateAllocationDone(); | 429 void MaybeCandidateAllocationDone(); |
| 432 | 430 |
| 433 // Log session state. | 431 // Log session state. |
| 434 void LogState(State old_state, State new_state); | 432 void LogState(State old_state, State new_state); |
| 435 | 433 |
| 436 // Returns true and the TransportInfo of the given |content_name| | 434 // Returns true and the TransportInfo of the given |content_name| |
| 437 // from |description|. Returns false if it's not available. | 435 // from |description|. Returns false if it's not available. |
| 438 static bool GetTransportDescription(const SessionDescription* description, | 436 static bool GetTransportDescription(const SessionDescription* description, |
| 439 const std::string& content_name, | 437 const std::string& content_name, |
| 440 TransportDescription* info); | 438 TransportDescription* info); |
| 441 | 439 |
| 442 // Gets the ContentAction and ContentSource according to the session state. | |
| 443 bool GetContentAction(ContentAction* action, ContentSource* source); | |
| 444 | |
| 445 rtc::Thread* const signaling_thread_; | 440 rtc::Thread* const signaling_thread_; |
| 446 rtc::Thread* const worker_thread_; | 441 rtc::Thread* const worker_thread_; |
| 447 PortAllocator* const port_allocator_; | 442 PortAllocator* const port_allocator_; |
| 448 const std::string sid_; | 443 const std::string sid_; |
| 449 const std::string content_type_; | 444 const std::string content_type_; |
| 450 const std::string transport_type_; | 445 const std::string transport_type_; |
| 451 bool initiator_; | 446 bool initiator_; |
| 452 rtc::SSLIdentity* identity_; | 447 rtc::SSLIdentity* identity_; |
| 453 rtc::SSLProtocolVersion ssl_max_version_; | 448 rtc::SSLProtocolVersion ssl_max_version_; |
| 454 rtc::scoped_ptr<const SessionDescription> local_description_; | 449 rtc::scoped_ptr<const SessionDescription> local_description_; |
| 455 rtc::scoped_ptr<SessionDescription> remote_description_; | 450 rtc::scoped_ptr<SessionDescription> remote_description_; |
| 456 uint64 ice_tiebreaker_; | 451 uint64 ice_tiebreaker_; |
| 457 // This flag will be set to true after the first role switch. This flag | 452 // This flag will be set to true after the first role switch. This flag |
| 458 // will enable us to stop any role switch during the call. | 453 // will enable us to stop any role switch during the call. |
| 459 bool role_switch_; | 454 bool role_switch_; |
| 460 TransportMap transports_; | 455 TransportMap transports_; |
| 461 }; | 456 }; |
| 462 | 457 |
| 463 } // namespace cricket | 458 } // namespace cricket |
| 464 | 459 |
| 465 #endif // WEBRTC_P2P_BASE_SESSION_H_ | 460 #endif // WEBRTC_P2P_BASE_SESSION_H_ |
| OLD | NEW |