| Index: chrome/browser/extensions/api/socket/socket_api.cc
|
| diff --git a/chrome/browser/extensions/api/socket/socket_api.cc b/chrome/browser/extensions/api/socket/socket_api.cc
|
| index c870171ba80e7fc1b1b31d73517295fb88fafa4a..69c28f9ac414e54b93f3f5a01c3195d6ff9e3299 100644
|
| --- a/chrome/browser/extensions/api/socket/socket_api.cc
|
| +++ b/chrome/browser/extensions/api/socket/socket_api.cc
|
| @@ -120,7 +120,7 @@ void SocketCreateFunction::Work() {
|
|
|
| DictionaryValue* result = new DictionaryValue();
|
| result->SetInteger(kSocketIdKey, controller()->AddAPIResource(socket));
|
| - result_.reset(result);
|
| + SetSingleResult(result);
|
| }
|
|
|
| bool SocketDestroyFunction::Prepare() {
|
| @@ -154,7 +154,7 @@ void SocketConnectFunction::AfterDnsLookup(int lookup_result) {
|
| if (lookup_result == net::OK) {
|
| StartConnect();
|
| } else {
|
| - result_.reset(Value::CreateIntegerValue(lookup_result));
|
| + SetSingleResult(Value::CreateIntegerValue(lookup_result));
|
| AsyncWorkCompleted();
|
| }
|
| }
|
| @@ -172,7 +172,7 @@ void SocketConnectFunction::StartConnect() {
|
| }
|
|
|
| void SocketConnectFunction::OnConnect(int result) {
|
| - result_.reset(Value::CreateIntegerValue(result));
|
| + SetSingleResult(Value::CreateIntegerValue(result));
|
| AsyncWorkCompleted();
|
| }
|
|
|
| @@ -187,7 +187,7 @@ void SocketDisconnectFunction::Work() {
|
| socket->Disconnect();
|
| else
|
| error_ = kSocketNotFoundError;
|
| - result_.reset(Value::CreateNullValue());
|
| + SetSingleResult(Value::CreateNullValue());
|
| }
|
|
|
| bool SocketBindFunction::Prepare() {
|
| @@ -205,7 +205,7 @@ void SocketBindFunction::Work() {
|
| else
|
| error_ = kSocketNotFoundError;
|
|
|
| - result_.reset(Value::CreateIntegerValue(result));
|
| + SetSingleResult(Value::CreateIntegerValue(result));
|
| }
|
|
|
| SocketReadFunction::SocketReadFunction()
|
| @@ -245,7 +245,7 @@ void SocketReadFunction::OnCompleted(int bytes_read,
|
| // http://crbug.com/127630
|
| result->Set(kDataKey, base::BinaryValue::Create(new char[1], 0));
|
| }
|
| - result_.reset(result);
|
| + SetSingleResult(result);
|
|
|
| AsyncWorkCompleted();
|
| }
|
| @@ -284,7 +284,7 @@ void SocketWriteFunction::AsyncWorkStart() {
|
| void SocketWriteFunction::OnCompleted(int bytes_written) {
|
| DictionaryValue* result = new DictionaryValue();
|
| result->SetInteger(kBytesWrittenKey, bytes_written);
|
| - result_.reset(result);
|
| + SetSingleResult(result);
|
|
|
| AsyncWorkCompleted();
|
| }
|
| @@ -330,7 +330,7 @@ void SocketRecvFromFunction::OnCompleted(int bytes_read,
|
| }
|
| result->SetString(kAddressKey, address);
|
| result->SetInteger(kPortKey, port);
|
| - result_.reset(result);
|
| + SetSingleResult(result);
|
|
|
| AsyncWorkCompleted();
|
| }
|
| @@ -363,7 +363,7 @@ void SocketSendToFunction::AfterDnsLookup(int lookup_result) {
|
| if (lookup_result == net::OK) {
|
| StartSendTo();
|
| } else {
|
| - result_.reset(Value::CreateIntegerValue(lookup_result));
|
| + SetSingleResult(Value::CreateIntegerValue(lookup_result));
|
| AsyncWorkCompleted();
|
| }
|
| }
|
| @@ -383,7 +383,7 @@ void SocketSendToFunction::StartSendTo() {
|
| void SocketSendToFunction::OnCompleted(int bytes_written) {
|
| DictionaryValue* result = new DictionaryValue();
|
| result->SetInteger(kBytesWrittenKey, bytes_written);
|
| - result_.reset(result);
|
| + SetSingleResult(result);
|
|
|
| AsyncWorkCompleted();
|
| }
|
| @@ -411,7 +411,7 @@ void SocketSetKeepAliveFunction::Work() {
|
| } else {
|
| error_ = kSocketNotFoundError;
|
| }
|
| - result_.reset(Value::CreateBooleanValue(result));
|
| + SetSingleResult(Value::CreateBooleanValue(result));
|
| }
|
|
|
| SocketSetNoDelayFunction::SocketSetNoDelayFunction()
|
| @@ -433,7 +433,7 @@ void SocketSetNoDelayFunction::Work() {
|
| result = socket->SetNoDelay(params_->no_delay);
|
| else
|
| error_ = kSocketNotFoundError;
|
| - result_.reset(Value::CreateBooleanValue(result));
|
| + SetSingleResult(Value::CreateBooleanValue(result));
|
| }
|
|
|
| } // namespace extensions
|
|
|