Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1304)

Side by Side Diff: p2p/base/fakepackettransport.h

Issue 3018513002: Revert of Completed the functionalities of SrtpTransport. (Closed)
Patch Set: Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pc/channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2017 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2017 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 SendPacketInternal(packet); 79 SendPacketInternal(packet);
80 } 80 }
81 SentPacket sent_packet(options.packet_id, TimeMillis()); 81 SentPacket sent_packet(options.packet_id, TimeMillis());
82 SignalSentPacket(this, sent_packet); 82 SignalSentPacket(this, sent_packet);
83 return static_cast<int>(len); 83 return static_cast<int>(len);
84 } 84 }
85 int SetOption(Socket::Option opt, int value) override { return true; } 85 int SetOption(Socket::Option opt, int value) override { return true; }
86 bool GetOption(Socket::Option opt, int* value) override { return true; } 86 bool GetOption(Socket::Option opt, int* value) override { return true; }
87 int GetError() override { return 0; } 87 int GetError() override { return 0; }
88 88
89 const CopyOnWriteBuffer* last_sent_packet() { return &last_sent_packet_; }
90
91 private: 89 private:
92 void set_writable(bool writable) { 90 void set_writable(bool writable) {
93 if (writable_ == writable) { 91 if (writable_ == writable) {
94 return; 92 return;
95 } 93 }
96 writable_ = writable; 94 writable_ = writable;
97 if (writable_) { 95 if (writable_) {
98 SignalReadyToSend(this); 96 SignalReadyToSend(this);
99 } 97 }
100 SignalWritableState(this); 98 SignalWritableState(this);
101 } 99 }
102 100
103 void set_receiving(bool receiving) { 101 void set_receiving(bool receiving) {
104 if (receiving_ == receiving) { 102 if (receiving_ == receiving) {
105 return; 103 return;
106 } 104 }
107 receiving_ = receiving; 105 receiving_ = receiving;
108 SignalReceivingState(this); 106 SignalReceivingState(this);
109 } 107 }
110 108
111 void SendPacketInternal(const CopyOnWriteBuffer& packet) { 109 void SendPacketInternal(const CopyOnWriteBuffer& packet) {
112 last_sent_packet_ = packet;
113 if (dest_) { 110 if (dest_) {
114 dest_->SignalReadPacket(dest_, packet.data<char>(), packet.size(), 111 dest_->SignalReadPacket(dest_, packet.data<char>(), packet.size(),
115 CreatePacketTime(0), 0); 112 CreatePacketTime(0), 0);
116 } 113 }
117 } 114 }
118 115
119 CopyOnWriteBuffer last_sent_packet_;
120 AsyncInvoker invoker_; 116 AsyncInvoker invoker_;
121 std::string debug_name_; 117 std::string debug_name_;
122 FakePacketTransport* dest_ = nullptr; 118 FakePacketTransport* dest_ = nullptr;
123 bool async_ = false; 119 bool async_ = false;
124 int async_delay_ms_ = 0; 120 int async_delay_ms_ = 0;
125 bool writable_ = false; 121 bool writable_ = false;
126 bool receiving_ = false; 122 bool receiving_ = false;
127 }; 123 };
128 124
129 } // namespace rtc 125 } // namespace rtc
130 126
131 #endif // P2P_BASE_FAKEPACKETTRANSPORT_H_ 127 #endif // P2P_BASE_FAKEPACKETTRANSPORT_H_
OLDNEW
« no previous file with comments | « no previous file | pc/channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698