Let PacketSource::NextPacket() return an std::unique_ptr
The return type of PacketSource::NextPacket() is changed from a naked pointer to an std::uniqe_ptr. The interface contract was and still is that the ownership is passed from the callee to the caller, but a unique_ptr makes this explicit. BUG=webrtc:2692 Review-Url: https://codereview.webrtc.org/2005873002 Cr-Commit-Position: refs/heads/master@{#12884}
This commit is contained in:
committed by
Commit bot
parent
1672ab271c
commit
46ba49c622
@ -107,7 +107,7 @@ int main(int argc, char* argv[]) {
|
||||
int cycles = -1;
|
||||
std::unique_ptr<webrtc::test::Packet> packet;
|
||||
while (true) {
|
||||
packet.reset(file_source->NextPacket());
|
||||
packet = file_source->NextPacket();
|
||||
if (!packet.get()) {
|
||||
// End of file reached.
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user