Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/renderer/media/rtc_peer_connection_handler.h" | 5 #include "content/renderer/media/rtc_peer_connection_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 return WebKit::WebRTCPeerConnectionHandlerClient::ICEStateClosed; | 55 return WebKit::WebRTCPeerConnectionHandlerClient::ICEStateClosed; |
| 56 default: | 56 default: |
| 57 NOTREACHED(); | 57 NOTREACHED(); |
| 58 return WebKit::WebRTCPeerConnectionHandlerClient::ICEStateClosed; | 58 return WebKit::WebRTCPeerConnectionHandlerClient::ICEStateClosed; |
| 59 } | 59 } |
| 60 } | 60 } |
| 61 | 61 |
| 62 static WebKit::WebRTCPeerConnectionHandlerClient::ReadyState | 62 static WebKit::WebRTCPeerConnectionHandlerClient::ReadyState |
| 63 GetWebKitReadyState(webrtc::PeerConnectionInterface::ReadyState ready_state) { | 63 GetWebKitReadyState(webrtc::PeerConnectionInterface::ReadyState ready_state) { |
| 64 switch (ready_state) { | 64 switch (ready_state) { |
| 65 case webrtc::PeerConnectionInterface::kNew: | 65 case webrtc::PeerConnectionInterface::kStable: |
| 66 return WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateNew; | 66 return WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateNew; |
|
Ronghua Wu (Left Chromium)
2013/01/11 00:52:32
Per, what should we return here since the WebRTCPe
perkj_chrome
2013/01/11 07:57:01
Please check later today if Tommy Ws cl for adding
Ronghua Wu (Left Chromium)
2013/01/11 19:03:01
Done.
| |
| 67 | 67 |
| 68 case webrtc::PeerConnectionInterface::kHaveLocalOffer: | 68 case webrtc::PeerConnectionInterface::kHaveLocalOffer: |
| 69 case webrtc::PeerConnectionInterface::kHaveLocalPrAnswer: | 69 case webrtc::PeerConnectionInterface::kHaveLocalPrAnswer: |
| 70 case webrtc::PeerConnectionInterface::kHaveRemoteOffer: | 70 case webrtc::PeerConnectionInterface::kHaveRemoteOffer: |
| 71 case webrtc::PeerConnectionInterface::kHaveRemotePrAnswer: | 71 case webrtc::PeerConnectionInterface::kHaveRemotePrAnswer: |
| 72 return WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateOpening; | 72 return WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateOpening; |
| 73 case webrtc::PeerConnectionInterface::kActive: | |
| 74 return WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateActive; | |
| 75 case webrtc::PeerConnectionInterface::kClosed: | 73 case webrtc::PeerConnectionInterface::kClosed: |
| 76 return WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateClosed; | 74 return WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateClosed; |
| 77 default: | 75 default: |
| 78 NOTREACHED(); | 76 NOTREACHED(); |
| 79 return WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateClosed; | 77 return WebKit::WebRTCPeerConnectionHandlerClient::ReadyStateClosed; |
| 80 } | 78 } |
| 81 } | 79 } |
| 82 | 80 |
| 83 static WebKit::WebRTCSessionDescription | 81 static WebKit::WebRTCSessionDescription |
| 84 CreateWebKitSessionDescription( | 82 CreateWebKitSessionDescription( |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 510 native_peer_connection_ = NULL; | 508 native_peer_connection_ = NULL; |
| 511 } | 509 } |
| 512 | 510 |
| 513 void RTCPeerConnectionHandler::OnError() { | 511 void RTCPeerConnectionHandler::OnError() { |
| 514 // TODO(perkj): Implement. | 512 // TODO(perkj): Implement. |
| 515 NOTIMPLEMENTED(); | 513 NOTIMPLEMENTED(); |
| 516 } | 514 } |
| 517 | 515 |
| 518 void RTCPeerConnectionHandler::OnStateChange(StateType state_changed) { | 516 void RTCPeerConnectionHandler::OnStateChange(StateType state_changed) { |
| 519 switch (state_changed) { | 517 switch (state_changed) { |
| 520 case kReadyState: { | 518 case kSignalingState: { |
| 521 WebKit::WebRTCPeerConnectionHandlerClient::ReadyState ready_state = | 519 WebKit::WebRTCPeerConnectionHandlerClient::ReadyState ready_state = |
| 522 GetWebKitReadyState(native_peer_connection_->ready_state()); | 520 GetWebKitReadyState(native_peer_connection_->ready_state()); |
| 523 client_->didChangeReadyState(ready_state); | 521 client_->didChangeReadyState(ready_state); |
| 524 break; | 522 break; |
| 525 } | 523 } |
| 526 case kIceState: { | 524 case kIceState: { |
| 527 WebKit::WebRTCPeerConnectionHandlerClient::ICEState ice_state = | 525 WebKit::WebRTCPeerConnectionHandlerClient::ICEState ice_state = |
| 528 GetWebKitIceState(native_peer_connection_->ice_state()); | 526 GetWebKitIceState(native_peer_connection_->ice_state()); |
| 529 client_->didChangeICEState(ice_state); | 527 client_->didChangeICEState(ice_state); |
| 530 break; | 528 break; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 606 webrtc::SessionDescriptionInterface* native_desc = | 604 webrtc::SessionDescriptionInterface* native_desc = |
| 607 dependency_factory_->CreateSessionDescription(type, sdp); | 605 dependency_factory_->CreateSessionDescription(type, sdp); |
| 608 | 606 |
| 609 LOG_IF(ERROR, !native_desc) << "Failed to create native session description." | 607 LOG_IF(ERROR, !native_desc) << "Failed to create native session description." |
| 610 << " Type: " << type << " SDP: " << sdp; | 608 << " Type: " << type << " SDP: " << sdp; |
| 611 | 609 |
| 612 return native_desc; | 610 return native_desc; |
| 613 } | 611 } |
| 614 | 612 |
| 615 } // namespace content | 613 } // namespace content |
| OLD | NEW |