| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "extensions/browser/api/socket/socket_api.h" | 5 #include "extensions/browser/api/socket/socket_api.h" |
| 6 | 6 |
| 7 #include <utility> |
| 7 #include <vector> | 8 #include <vector> |
| 8 | 9 |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/containers/hash_tables.h" | 11 #include "base/containers/hash_tables.h" |
| 11 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 12 #include "content/public/browser/browser_context.h" | 13 #include "content/public/browser/browser_context.h" |
| 13 #include "content/public/browser/resource_context.h" | 14 #include "content/public/browser/resource_context.h" |
| 14 #include "extensions/browser/api/dns/host_resolver_wrapper.h" | 15 #include "extensions/browser/api/dns/host_resolver_wrapper.h" |
| 15 #include "extensions/browser/api/socket/socket.h" | 16 #include "extensions/browser/api/socket/socket.h" |
| 16 #include "extensions/browser/api/socket/tcp_socket.h" | 17 #include "extensions/browser/api/socket/tcp_socket.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 158 } |
| 158 | 159 |
| 159 Socket* socket = GetSocket(socket_id); | 160 Socket* socket = GetSocket(socket_id); |
| 160 if (!socket) { | 161 if (!socket) { |
| 161 error_ = kSocketNotFoundError; | 162 error_ = kSocketNotFoundError; |
| 162 SetResult(new base::FundamentalValue(-1)); | 163 SetResult(new base::FundamentalValue(-1)); |
| 163 AsyncWorkCompleted(); | 164 AsyncWorkCompleted(); |
| 164 return; | 165 return; |
| 165 } | 166 } |
| 166 | 167 |
| 167 socket->set_firewall_hole(hole.Pass()); | 168 socket->set_firewall_hole(std::move(hole)); |
| 168 AsyncWorkCompleted(); | 169 AsyncWorkCompleted(); |
| 169 } | 170 } |
| 170 | 171 |
| 171 #endif // OS_CHROMEOS | 172 #endif // OS_CHROMEOS |
| 172 | 173 |
| 173 SocketExtensionWithDnsLookupFunction::SocketExtensionWithDnsLookupFunction() | 174 SocketExtensionWithDnsLookupFunction::SocketExtensionWithDnsLookupFunction() |
| 174 : resource_context_(NULL) { | 175 : resource_context_(NULL) { |
| 175 } | 176 } |
| 176 | 177 |
| 177 SocketExtensionWithDnsLookupFunction::~SocketExtensionWithDnsLookupFunction() { | 178 SocketExtensionWithDnsLookupFunction::~SocketExtensionWithDnsLookupFunction() { |
| (...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1067 } else { | 1068 } else { |
| 1068 RemoveSocket(params_->socket_id); | 1069 RemoveSocket(params_->socket_id); |
| 1069 error_ = net::ErrorToString(result); | 1070 error_ = net::ErrorToString(result); |
| 1070 } | 1071 } |
| 1071 | 1072 |
| 1072 results_ = api::socket::Secure::Results::Create(result); | 1073 results_ = api::socket::Secure::Results::Create(result); |
| 1073 AsyncWorkCompleted(); | 1074 AsyncWorkCompleted(); |
| 1074 } | 1075 } |
| 1075 | 1076 |
| 1076 } // namespace extensions | 1077 } // namespace extensions |
| OLD | NEW |