summaryrefslogtreecommitdiff
path: root/chromium/net/socket/socket.cc
blob: 143516c572edd27db4d85054bd87f4fe3701346a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "net/socket/socket.h"

#include <set>

#include "net/base/net_errors.h"

namespace net {

Socket::Socket() = default;

Socket::~Socket() = default;

int Socket::ReadIfReady(IOBuffer* buf,
                        int buf_len,
                        CompletionOnceCallback callback) {
  return ERR_READ_IF_READY_NOT_IMPLEMENTED;
}

int Socket::CancelReadIfReady() {
  return ERR_READ_IF_READY_NOT_IMPLEMENTED;
}

void Socket::SetDnsAliases(std::set<std::string> aliases) {
  if (aliases == std::set<std::string>({""})) {
    // Reset field to empty vector. Necessary because some tests and other
    // inputs still use a trivial canonical name of std::string().
    dns_aliases_.clear();
    return;
  }

  dns_aliases_ = std::move(aliases);
}

const std::set<std::string>& Socket::GetDnsAliases() const {
  return dns_aliases_;
}

}  // namespace net