| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2009 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 if (state_ != STATE_CONNECTED) { | 200 if (state_ != STATE_CONNECTED) { |
| 201 return -1; | 201 return -1; |
| 202 } | 202 } |
| 203 | 203 |
| 204 if (flags != PF_SRTP_BYPASS && flags != 0) { | 204 if (flags != PF_SRTP_BYPASS && flags != 0) { |
| 205 return -1; | 205 return -1; |
| 206 } | 206 } |
| 207 | 207 |
| 208 PacketMessageData* packet = new PacketMessageData(data, len); | 208 PacketMessageData* packet = new PacketMessageData(data, len); |
| 209 if (async_) { | 209 if (async_) { |
| 210 rtc::Thread::Current()->Post(this, 0, packet); | 210 rtc::Thread::Current()->Post(RTC_FROM_HERE, this, 0, packet); |
| 211 } else { | 211 } else { |
| 212 rtc::Thread::Current()->Send(this, 0, packet); | 212 rtc::Thread::Current()->Send(RTC_FROM_HERE, this, 0, packet); |
| 213 } | 213 } |
| 214 rtc::SentPacket sent_packet(options.packet_id, rtc::TimeMillis()); | 214 rtc::SentPacket sent_packet(options.packet_id, rtc::TimeMillis()); |
| 215 SignalSentPacket(this, sent_packet); | 215 SignalSentPacket(this, sent_packet); |
| 216 return static_cast<int>(len); | 216 return static_cast<int>(len); |
| 217 } | 217 } |
| 218 int SetOption(rtc::Socket::Option opt, int value) override { return true; } | 218 int SetOption(rtc::Socket::Option opt, int value) override { return true; } |
| 219 bool GetOption(rtc::Socket::Option opt, int* value) override { return true; } | 219 bool GetOption(rtc::Socket::Option opt, int* value) override { return true; } |
| 220 int GetError() override { return 0; } | 220 int GetError() override { return 0; } |
| 221 | 221 |
| 222 void AddRemoteCandidate(const Candidate& candidate) override { | 222 void AddRemoteCandidate(const Candidate& candidate) override { |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 SetIceRole(role); | 513 SetIceRole(role); |
| 514 } | 514 } |
| 515 | 515 |
| 516 FakeTransport* GetTransport_n(const std::string& transport_name) { | 516 FakeTransport* GetTransport_n(const std::string& transport_name) { |
| 517 return static_cast<FakeTransport*>( | 517 return static_cast<FakeTransport*>( |
| 518 TransportController::GetTransport_n(transport_name)); | 518 TransportController::GetTransport_n(transport_name)); |
| 519 } | 519 } |
| 520 | 520 |
| 521 void Connect(FakeTransportController* dest) { | 521 void Connect(FakeTransportController* dest) { |
| 522 network_thread()->Invoke<void>( | 522 network_thread()->Invoke<void>( |
| 523 RTC_FROM_HERE, |
| 523 rtc::Bind(&FakeTransportController::Connect_n, this, dest)); | 524 rtc::Bind(&FakeTransportController::Connect_n, this, dest)); |
| 524 } | 525 } |
| 525 | 526 |
| 526 TransportChannel* CreateTransportChannel_n(const std::string& transport_name, | 527 TransportChannel* CreateTransportChannel_n(const std::string& transport_name, |
| 527 int component) override { | 528 int component) override { |
| 528 if (fail_create_channel_) { | 529 if (fail_create_channel_) { |
| 529 return nullptr; | 530 return nullptr; |
| 530 } | 531 } |
| 531 return TransportController::CreateTransportChannel_n(transport_name, | 532 return TransportController::CreateTransportChannel_n(transport_name, |
| 532 component); | 533 component); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 } | 583 } |
| 583 } | 584 } |
| 584 | 585 |
| 585 private: | 586 private: |
| 586 bool fail_create_channel_; | 587 bool fail_create_channel_; |
| 587 }; | 588 }; |
| 588 | 589 |
| 589 } // namespace cricket | 590 } // namespace cricket |
| 590 | 591 |
| 591 #endif // WEBRTC_P2P_BASE_FAKETRANSPORTCONTROLLER_H_ | 592 #endif // WEBRTC_P2P_BASE_FAKETRANSPORTCONTROLLER_H_ |
| OLD | NEW |