OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/api/socket/socket_api.h" | 5 #include "chrome/browser/extensions/api/socket/socket_api.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chrome/browser/extensions/api/api_resource_controller.h" | 8 #include "chrome/browser/extensions/api/api_resource_controller.h" |
9 #include "chrome/browser/extensions/api/socket/socket.h" | 9 #include "chrome/browser/extensions/api/socket/socket.h" |
10 #include "chrome/browser/extensions/api/socket/tcp_socket.h" | 10 #include "chrome/browser/extensions/api/socket/tcp_socket.h" |
11 #include "chrome/browser/extensions/api/socket/udp_socket.h" | 11 #include "chrome/browser/extensions/api/socket/udp_socket.h" |
12 #include "chrome/browser/extensions/extension_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
13 #include "chrome/common/extensions/api/experimental.socket.h" | 13 #include "chrome/common/extensions/api/experimental_socket.h" |
14 #include "net/base/io_buffer.h" | 14 #include "net/base/io_buffer.h" |
15 #include "net/base/ip_endpoint.h" | 15 #include "net/base/ip_endpoint.h" |
16 | 16 |
17 namespace extensions { | 17 namespace extensions { |
18 | 18 |
19 const char kAddressKey[] = "address"; | 19 const char kAddressKey[] = "address"; |
20 const char kPortKey[] = "port"; | 20 const char kPortKey[] = "port"; |
21 const char kBytesWrittenKey[] = "bytesWritten"; | 21 const char kBytesWrittenKey[] = "bytesWritten"; |
22 const char kDataKey[] = "data"; | 22 const char kDataKey[] = "data"; |
23 const char kResultCodeKey[] = "resultCode"; | 23 const char kResultCodeKey[] = "resultCode"; |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 | 332 |
333 void SocketSendToFunction::OnCompleted(int bytes_written) { | 333 void SocketSendToFunction::OnCompleted(int bytes_written) { |
334 DictionaryValue* result = new DictionaryValue(); | 334 DictionaryValue* result = new DictionaryValue(); |
335 result->SetInteger(kBytesWrittenKey, bytes_written); | 335 result->SetInteger(kBytesWrittenKey, bytes_written); |
336 result_.reset(result); | 336 result_.reset(result); |
337 | 337 |
338 AsyncWorkCompleted(); | 338 AsyncWorkCompleted(); |
339 } | 339 } |
340 | 340 |
341 } // namespace extensions | 341 } // namespace extensions |
OLD | NEW |