socket.cc 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2017 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. #include "net/socket/socket.h"
  5. #include <set>
  6. #include "net/base/net_errors.h"
  7. namespace net {
  8. Socket::Socket() = default;
  9. Socket::~Socket() = default;
  10. int Socket::ReadIfReady(IOBuffer* buf,
  11. int buf_len,
  12. CompletionOnceCallback callback) {
  13. return ERR_READ_IF_READY_NOT_IMPLEMENTED;
  14. }
  15. int Socket::CancelReadIfReady() {
  16. return ERR_READ_IF_READY_NOT_IMPLEMENTED;
  17. }
  18. void Socket::SetDnsAliases(std::set<std::string> aliases) {
  19. if (aliases == std::set<std::string>({""})) {
  20. // Reset field to empty vector. Necessary because some tests and other
  21. // inputs still use a trivial canonical name of std::string().
  22. dns_aliases_.clear();
  23. return;
  24. }
  25. dns_aliases_ = std::move(aliases);
  26. }
  27. const std::set<std::string>& Socket::GetDnsAliases() const {
  28. return dns_aliases_;
  29. }
  30. } // namespace net