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/p2p/p2p_transport_impl.h" | 5 #include "content/renderer/p2p/p2p_transport_impl.h" |
6 | 6 |
7 #include "content/renderer/p2p/ipc_network_manager.h" | 7 #include "content/renderer/p2p/ipc_network_manager.h" |
8 #include "content/renderer/p2p/ipc_socket_factory.h" | 8 #include "content/renderer/p2p/ipc_socket_factory.h" |
9 #include "content/renderer/p2p/port_allocator.h" | 9 #include "content/renderer/p2p/port_allocator.h" |
10 #include "jingle/glue/channel_socket_adapter.h" | 10 #include "jingle/glue/channel_socket_adapter.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 cricket::Candidate candidate; | 118 cricket::Candidate candidate; |
119 if (!jingle_glue::DeserializeP2PCandidate(address, &candidate)) { | 119 if (!jingle_glue::DeserializeP2PCandidate(address, &candidate)) { |
120 LOG(ERROR) << "Failed to parse candidate " << address; | 120 LOG(ERROR) << "Failed to parse candidate " << address; |
121 return false; | 121 return false; |
122 } | 122 } |
123 | 123 |
124 channel_->OnCandidate(candidate); | 124 channel_->OnCandidate(candidate); |
125 return true; | 125 return true; |
126 } | 126 } |
127 | 127 |
128 void P2PTransportImpl::OnRequestSignaling() { | 128 void P2PTransportImpl::OnRequestSignaling( |
129 cricket::TransportChannelImpl* /*channel*/) { | |
Sergey Ulanov
2012/03/19 23:44:08
no need to comment parameter name.
Ronghua Wu (Left Chromium)
2012/03/20 15:19:31
Done.
| |
129 channel_->OnSignalingReady(); | 130 channel_->OnSignalingReady(); |
130 } | 131 } |
131 | 132 |
132 void P2PTransportImpl::OnCandidateReady( | 133 void P2PTransportImpl::OnCandidateReady( |
133 cricket::TransportChannelImpl* channel, | 134 cricket::TransportChannelImpl* channel, |
134 const cricket::Candidate& candidate) { | 135 const cricket::Candidate& candidate) { |
135 event_handler_->OnCandidateReady( | 136 event_handler_->OnCandidateReady( |
136 jingle_glue::SerializeP2PCandidate(candidate)); | 137 jingle_glue::SerializeP2PCandidate(candidate)); |
137 } | 138 } |
138 | 139 |
(...skipping 20 matching lines...) Expand all Loading... | |
159 void P2PTransportImpl::OnTcpConnected(int result) { | 160 void P2PTransportImpl::OnTcpConnected(int result) { |
160 if (result < 0) { | 161 if (result < 0) { |
161 event_handler_->OnError(result); | 162 event_handler_->OnError(result); |
162 return; | 163 return; |
163 } | 164 } |
164 state_ = static_cast<State>(STATE_READABLE | STATE_WRITABLE); | 165 state_ = static_cast<State>(STATE_READABLE | STATE_WRITABLE); |
165 event_handler_->OnStateChange(state_); | 166 event_handler_->OnStateChange(state_); |
166 } | 167 } |
167 | 168 |
168 } // namespace content | 169 } // namespace content |
OLD | NEW |