Adapt to changes of Chrome 51 API changes (Part 2)
This commit is contained in:
parent
7ba391da7c
commit
a2bd55dd3c
48 changed files with 131 additions and 131 deletions
|
@ -58,7 +58,7 @@ class StreamListenSocket :
|
|||
// |server| is the original listening Socket, connection is the new
|
||||
// Socket that was created.
|
||||
virtual void DidAccept(StreamListenSocket* server,
|
||||
scoped_ptr<StreamListenSocket> connection) = 0;
|
||||
std::unique_ptr<StreamListenSocket> connection) = 0;
|
||||
virtual void DidRead(StreamListenSocket* connection,
|
||||
const char* data,
|
||||
int len) = 0;
|
||||
|
@ -140,7 +140,7 @@ class StreamListenSocketFactory {
|
|||
virtual ~StreamListenSocketFactory() {}
|
||||
|
||||
// Returns a new instance of StreamListenSocket or NULL if an error occurred.
|
||||
virtual scoped_ptr<StreamListenSocket> CreateAndListen(
|
||||
virtual std::unique_ptr<StreamListenSocket> CreateAndListen(
|
||||
StreamListenSocket::Delegate* delegate) const = 0;
|
||||
};
|
||||
|
||||
|
|
|
@ -33,14 +33,14 @@ namespace net {
|
|||
namespace test_server {
|
||||
|
||||
// static
|
||||
scoped_ptr<TCPListenSocket> TCPListenSocket::CreateAndListen(
|
||||
std::unique_ptr<TCPListenSocket> TCPListenSocket::CreateAndListen(
|
||||
const string& ip,
|
||||
uint16_t port,
|
||||
StreamListenSocket::Delegate* del) {
|
||||
SocketDescriptor s = CreateAndBind(ip, port);
|
||||
if (s == kInvalidSocket)
|
||||
return scoped_ptr<TCPListenSocket>();
|
||||
scoped_ptr<TCPListenSocket> sock(new TCPListenSocket(s, del));
|
||||
return std::unique_ptr<TCPListenSocket>();
|
||||
std::unique_ptr<TCPListenSocket> sock(new TCPListenSocket(s, del));
|
||||
sock->Listen();
|
||||
return sock;
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ void TCPListenSocket::Accept() {
|
|||
SocketDescriptor conn = AcceptSocket();
|
||||
if (conn == kInvalidSocket)
|
||||
return;
|
||||
scoped_ptr<TCPListenSocket> sock(new TCPListenSocket(conn, socket_delegate_));
|
||||
std::unique_ptr<TCPListenSocket> sock(new TCPListenSocket(conn, socket_delegate_));
|
||||
#if defined(OS_POSIX)
|
||||
sock->WatchSocket(WAITING_READ);
|
||||
#endif
|
||||
|
|
|
@ -23,7 +23,7 @@ class TCPListenSocket : public StreamListenSocket {
|
|||
|
||||
// Listen on port for the specified IP address. Use 127.0.0.1 to only
|
||||
// accept local connections.
|
||||
static scoped_ptr<TCPListenSocket> CreateAndListen(
|
||||
static std::unique_ptr<TCPListenSocket> CreateAndListen(
|
||||
const std::string& ip,
|
||||
uint16_t port,
|
||||
StreamListenSocket::Delegate* del);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue