Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/peer_connection_tracker.h" | 5 #include "content/renderer/media/peer_connection_tracker.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 default: | 170 default: |
| 171 NOTREACHED(); | 171 NOTREACHED(); |
| 172 }; | 172 }; |
| 173 return policy_str; | 173 return policy_str; |
| 174 } | 174 } |
| 175 | 175 |
| 176 static std::string SerializeConfiguration( | 176 static std::string SerializeConfiguration( |
| 177 const webrtc::PeerConnectionInterface::RTCConfiguration& config) { | 177 const webrtc::PeerConnectionInterface::RTCConfiguration& config) { |
| 178 std::ostringstream oss; | 178 std::ostringstream oss; |
| 179 // TODO(hbos): Add serialization of certificate. | 179 // TODO(hbos): Add serialization of certificate. |
| 180 oss << "{ iceServers: " << SerializeServers(config.servers) << ", " | 180 oss << "{ iceServers: " << SerializeServers(config.servers) |
| 181 << "iceTransportPolicy: " << SerializeIceTransportType(config.type) | 181 << ", iceTransportPolicy: " << SerializeIceTransportType(config.type) |
| 182 << ", " | 182 << ", bundlePolicy: " << SerializeBundlePolicy(config.bundle_policy) |
| 183 << "bundlePolicy: " << SerializeBundlePolicy(config.bundle_policy) << ", " | 183 << ", rtcpMuxPolicy: " << SerializeRtcpMuxPolicy(config.rtcp_mux_policy) |
| 184 << "rtcpMuxPolicy: " << SerializeRtcpMuxPolicy(config.rtcp_mux_policy) | 184 << ", iceCandidatePoolSize: " << config.ice_candidate_pool_size << " }"; |
| 185 << "iceCandidatePoolSize: " << config.ice_candidate_pool_size << " }"; | |
| 186 return oss.str(); | 185 return oss.str(); |
| 187 } | 186 } |
| 188 | 187 |
| 189 #define GET_STRING_OF_STATE(state) \ | 188 #define GET_STRING_OF_STATE(state) \ |
|
tommi (sloooow) - chröme
2017/04/24 11:07:48
what about fixing the macro instead?
e.g.
case W
Taylor_Brandstetter
2017/04/24 20:24:40
It seemed simpler to me to have 2 possible enum va
| |
| 190 case WebRTCPeerConnectionHandlerClient::state: \ | 189 case WebRTCPeerConnectionHandlerClient::state: \ |
| 191 result = #state; \ | 190 result = #state; \ |
| 192 break; | 191 break; |
| 193 | 192 |
| 193 // Note: All of these strings need to be kept in sync with | |
| 194 // peer_connection_update_table.js, in order to be displayed as friendly | |
| 195 // strings on chrome://webrtc-internals. | |
| 196 | |
| 194 static const char* GetSignalingStateString( | 197 static const char* GetSignalingStateString( |
| 195 WebRTCPeerConnectionHandlerClient::SignalingState state) { | 198 WebRTCPeerConnectionHandlerClient::SignalingState state) { |
| 196 const char* result = ""; | 199 const char* result = ""; |
| 197 switch (state) { | 200 switch (state) { |
| 198 GET_STRING_OF_STATE(kSignalingStateStable) | 201 GET_STRING_OF_STATE(kSignalingStateStable) |
| 199 GET_STRING_OF_STATE(kSignalingStateHaveLocalOffer) | 202 GET_STRING_OF_STATE(kSignalingStateHaveLocalOffer) |
| 200 GET_STRING_OF_STATE(kSignalingStateHaveRemoteOffer) | 203 GET_STRING_OF_STATE(kSignalingStateHaveRemoteOffer) |
| 201 GET_STRING_OF_STATE(kSignalingStateHaveLocalPrAnswer) | 204 GET_STRING_OF_STATE(kSignalingStateHaveLocalPrAnswer) |
| 202 GET_STRING_OF_STATE(kSignalingStateHaveRemotePrAnswer) | 205 GET_STRING_OF_STATE(kSignalingStateHaveRemotePrAnswer) |
| 203 GET_STRING_OF_STATE(kSignalingStateClosed) | 206 GET_STRING_OF_STATE(kSignalingStateClosed) |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 740 DCHECK(main_thread_.CalledOnValidThread()); | 743 DCHECK(main_thread_.CalledOnValidThread()); |
| 741 SendTarget()->Send(new PeerConnectionTrackerHost_UpdatePeerConnection( | 744 SendTarget()->Send(new PeerConnectionTrackerHost_UpdatePeerConnection( |
| 742 local_id, std::string(callback_type), value)); | 745 local_id, std::string(callback_type), value)); |
| 743 } | 746 } |
| 744 | 747 |
| 745 void PeerConnectionTracker::OverrideSendTargetForTesting(RenderThread* target) { | 748 void PeerConnectionTracker::OverrideSendTargetForTesting(RenderThread* target) { |
| 746 send_target_for_test_ = target; | 749 send_target_for_test_ = target; |
| 747 } | 750 } |
| 748 | 751 |
| 749 } // namespace content | 752 } // namespace content |
| OLD | NEW |