Ryan Keane | deb48b3 | 2019-06-28 16:24:40 -0700 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file |
| 4 | |
| 5 | #include "platform/api/udp_socket.h" |
| 6 | |
| 7 | namespace openscreen { |
| 8 | namespace platform { |
| 9 | |
| 10 | UdpSocket::UdpSocket() { |
| 11 | deletion_callback_ = [](UdpSocket* socket) {}; |
| 12 | } |
| 13 | |
| 14 | UdpSocket::~UdpSocket() { |
| 15 | deletion_callback_(this); |
| 16 | } |
| 17 | |
| 18 | void UdpSocket::SetDeletionCallback(std::function<void(UdpSocket*)> callback) { |
| 19 | deletion_callback_ = callback; |
| 20 | } |
| 21 | |
| 22 | } // namespace platform |
| 23 | } // namespace openscreen |