| Index: extensions/browser/api/sockets_tcp/sockets_tcp_api.cc
|
| diff --git a/extensions/browser/api/sockets_tcp/sockets_tcp_api.cc b/extensions/browser/api/sockets_tcp/sockets_tcp_api.cc
|
| index b2c06096008d04a3cf4b2a73e742f70c0056d097..cea70b0074b7c3c9d988eb6a608e914ea2c587a1 100644
|
| --- a/extensions/browser/api/sockets_tcp/sockets_tcp_api.cc
|
| +++ b/extensions/browser/api/sockets_tcp/sockets_tcp_api.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "extensions/browser/api/sockets_tcp/sockets_tcp_api.h"
|
|
|
| +#include "base/memory/ptr_util.h"
|
| #include "content/public/browser/browser_context.h"
|
| #include "content/public/browser/storage_partition.h"
|
| #include "content/public/common/socket_permission_request.h"
|
| @@ -468,7 +469,8 @@ void SocketsTcpSecureFunction::AsyncWorkStart() {
|
|
|
| ResumableTCPSocket* socket = GetTcpSocket(params_->socket_id);
|
| if (!socket) {
|
| - SetResult(new base::FundamentalValue(net::ERR_INVALID_ARGUMENT));
|
| + SetResult(
|
| + base::MakeUnique<base::FundamentalValue>(net::ERR_INVALID_ARGUMENT));
|
| error_ = kSocketNotFoundError;
|
| AsyncWorkCompleted();
|
| return;
|
| @@ -481,14 +483,16 @@ void SocketsTcpSecureFunction::AsyncWorkStart() {
|
| // secure()'d.
|
| if (socket->GetSocketType() != Socket::TYPE_TCP ||
|
| socket->ClientStream() == NULL) {
|
| - SetResult(new base::FundamentalValue(net::ERR_INVALID_ARGUMENT));
|
| + SetResult(
|
| + base::MakeUnique<base::FundamentalValue>(net::ERR_INVALID_ARGUMENT));
|
| error_ = kInvalidSocketStateError;
|
| AsyncWorkCompleted();
|
| return;
|
| }
|
|
|
| if (!socket->IsConnected()) {
|
| - SetResult(new base::FundamentalValue(net::ERR_INVALID_ARGUMENT));
|
| + SetResult(
|
| + base::MakeUnique<base::FundamentalValue>(net::ERR_INVALID_ARGUMENT));
|
| error_ = kSocketNotConnectedError;
|
| AsyncWorkCompleted();
|
| return;
|
|
|