| 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 2299491e54f8c97109e946be582dcd7992c2326f..fd75f02a4f7b7f9120176061d3cdabc7f4af9f66 100644
|
| --- a/chrome/browser/extensions/api/socket/socket_api.cc
|
| +++ b/chrome/browser/extensions/api/socket/socket_api.cc
|
| @@ -130,9 +130,9 @@ bool SocketCreateFunction::Prepare() {
|
| void SocketCreateFunction::Work() {
|
| Socket* socket = NULL;
|
| if (socket_type_ == kSocketTypeTCP) {
|
| - socket = new TCPSocket(event_notifier_);
|
| + socket = new TCPSocket(extension_->id(), event_notifier_);
|
| } else if (socket_type_== kSocketTypeUDP) {
|
| - socket = new UDPSocket(event_notifier_);
|
| + socket = new UDPSocket(extension_->id(), event_notifier_);
|
| }
|
| DCHECK(socket);
|
|
|
| @@ -147,7 +147,7 @@ bool SocketDestroyFunction::Prepare() {
|
| }
|
|
|
| void SocketDestroyFunction::Work() {
|
| - manager_->Remove(socket_id_);
|
| + manager_->Remove(extension_->id(), socket_id_);
|
| }
|
|
|
| SocketConnectFunction::SocketConnectFunction()
|
| @@ -166,7 +166,7 @@ bool SocketConnectFunction::Prepare() {
|
| }
|
|
|
| void SocketConnectFunction::AsyncWorkStart() {
|
| - socket_ = manager_->Get(socket_id_);
|
| + socket_ = manager_->Get(extension_->id(), socket_id_);
|
| if (!socket_) {
|
| error_ = kSocketNotFoundError;
|
| SetResult(Value::CreateIntegerValue(-1));
|
| @@ -225,7 +225,7 @@ bool SocketDisconnectFunction::Prepare() {
|
| }
|
|
|
| void SocketDisconnectFunction::Work() {
|
| - Socket* socket = manager_->Get(socket_id_);
|
| + Socket* socket = manager_->Get(extension_->id(), socket_id_);
|
| if (socket)
|
| socket->Disconnect();
|
| else
|
| @@ -242,7 +242,7 @@ bool SocketBindFunction::Prepare() {
|
|
|
| void SocketBindFunction::Work() {
|
| int result = -1;
|
| - Socket* socket = manager_->Get(socket_id_);
|
| + Socket* socket = manager_->Get(extension_->id(), socket_id_);
|
|
|
| if (!socket) {
|
| error_ = kSocketNotFoundError;
|
| @@ -278,7 +278,7 @@ bool SocketReadFunction::Prepare() {
|
| }
|
|
|
| void SocketReadFunction::AsyncWorkStart() {
|
| - Socket* socket = manager_->Get(params_->socket_id);
|
| + Socket* socket = manager_->Get(extension_->id(), params_->socket_id);
|
| if (!socket) {
|
| error_ = kSocketNotFoundError;
|
| OnCompleted(-1, NULL);
|
| @@ -326,7 +326,7 @@ bool SocketWriteFunction::Prepare() {
|
| }
|
|
|
| void SocketWriteFunction::AsyncWorkStart() {
|
| - Socket* socket = manager_->Get(socket_id_);
|
| + Socket* socket = manager_->Get(extension_->id(), socket_id_);
|
|
|
| if (!socket) {
|
| error_ = kSocketNotFoundError;
|
| @@ -359,7 +359,7 @@ bool SocketRecvFromFunction::Prepare() {
|
| }
|
|
|
| void SocketRecvFromFunction::AsyncWorkStart() {
|
| - Socket* socket = manager_->Get(params_->socket_id);
|
| + Socket* socket = manager_->Get(extension_->id(), params_->socket_id);
|
| if (!socket) {
|
| error_ = kSocketNotFoundError;
|
| OnCompleted(-1, NULL, std::string(), 0);
|
| @@ -414,7 +414,7 @@ bool SocketSendToFunction::Prepare() {
|
| }
|
|
|
| void SocketSendToFunction::AsyncWorkStart() {
|
| - socket_ = manager_->Get(socket_id_);
|
| + socket_ = manager_->Get(extension_->id(), socket_id_);
|
| if (!socket_) {
|
| error_ = kSocketNotFoundError;
|
| SetResult(Value::CreateIntegerValue(-1));
|
| @@ -473,7 +473,7 @@ bool SocketSetKeepAliveFunction::Prepare() {
|
|
|
| void SocketSetKeepAliveFunction::Work() {
|
| bool result = false;
|
| - Socket* socket = manager_->Get(params_->socket_id);
|
| + Socket* socket = manager_->Get(extension_->id(), params_->socket_id);
|
| if (socket) {
|
| int delay = 0;
|
| if (params_->delay.get())
|
| @@ -499,7 +499,7 @@ bool SocketSetNoDelayFunction::Prepare() {
|
|
|
| void SocketSetNoDelayFunction::Work() {
|
| bool result = false;
|
| - Socket* socket = manager_->Get(params_->socket_id);
|
| + Socket* socket = manager_->Get(extension_->id(), params_->socket_id);
|
| if (socket)
|
| result = socket->SetNoDelay(params_->no_delay);
|
| else
|
| @@ -520,7 +520,7 @@ bool SocketGetInfoFunction::Prepare() {
|
|
|
| void SocketGetInfoFunction::Work() {
|
| api::socket::SocketInfo info;
|
| - Socket* socket = manager_->Get(params_->socket_id);
|
| + Socket* socket = manager_->Get(extension_->id(), params_->socket_id);
|
| if (socket) {
|
| // This represents what we know about the socket, and does not call through
|
| // to the system.
|
|
|